Drupal 8  8.0.2
FileTransferAuthorizeForm Class Reference
Inheritance diagram for FileTransferAuthorizeForm:

Public Member Functions

 __construct ($root)
 
 getFormId ()
 
 buildForm (array $form, FormStateInterface $form_state)
 
 validateForm (array &$form, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Member Functions

 getFiletransfer ($backend, $settings=array())
 
 addConnectionSettings ($backend)
 
 setConnectionSettingsDefaults (&$element, $key, array $defaults)
 
 runOperation ($filetransfer)
 

Protected Attributes

 $root
 

Detailed Description

Provides the file transfer authorization form.

Constructor & Destructor Documentation

__construct (   $root)

Constructs a new FileTransferAuthorizeForm object.

Parameters
string$rootThe app root.

References Drupal\root().

Here is the call graph for this function:

Member Function Documentation

addConnectionSettings (   $backend)
protected

Generates the Form API array for a given connection backend's settings.

Parameters
string$backendThe name of the backend (e.g. 'ftp', 'ssh', etc).
Returns
array Form API array of connection settings for the given backend.
See Also
hook_filetransfer_backends()

References Drupal\config(), FileTransferAuthorizeForm\getFiletransfer(), and FileTransferAuthorizeForm\setConnectionSettingsDefaults().

Referenced by FileTransferAuthorizeForm\buildForm().

Here is the call graph for this function:

Here is the caller graph for this function:

buildForm ( array  $form,
FormStateInterface  $form_state 
)

{}

References FileTransferAuthorizeForm\addConnectionSettings(), Drupal\config(), FormStateInterface\getValue(), and t().

Here is the call graph for this function:

static create ( ContainerInterface  $container)
static

{}

getFiletransfer (   $backend,
  $settings = array() 
)
protected

Gets a FileTransfer class for a specific transfer method and settings.

Parameters
$backendThe FileTransfer backend to get the class for.
$settingsArray of settings for the FileTransfer.
Returns
|bool An instantiated FileTransfer object for the requested method and settings, or FALSE if there was an error finding or instantiating it.

References Drupal\root().

Referenced by FileTransferAuthorizeForm\addConnectionSettings(), FileTransferAuthorizeForm\submitForm(), and FileTransferAuthorizeForm\validateForm().

Here is the call graph for this function:

Here is the caller graph for this function:

getFormId ( )

{}

runOperation (   $filetransfer)
protected

Runs the operation specified in $_SESSION['authorize_operation'].

Parameters
$filetransferThe FileTransfer object to use for running the operation.
Returns
|null The result of running the operation. If this is an instance of the calling code should use that response for the current page request.

References Drupal\root().

Referenced by FileTransferAuthorizeForm\submitForm().

Here is the call graph for this function:

Here is the caller graph for this function:

setConnectionSettingsDefaults ( $element,
  $key,
array  $defaults 
)
protected

Sets the default settings on a file transfer connection form recursively.

The default settings for the file transfer connection forms are saved in the database. The settings are stored as a nested array in the case of a settings form that has details or otherwise uses a nested structure. Therefore, to properly add defaults, we need to walk through all the children form elements and process those defaults recursively.

Parameters
$elementReference to the Form API form element we're operating on.
$keyThe key for our current form element, if any.
array$defaultsThe default settings for the file transfer backend we're operating on.

References Element\children().

Referenced by FileTransferAuthorizeForm\addConnectionSettings().

Here is the call graph for this function:

Here is the caller graph for this function:

submitForm ( array &  $form,
FormStateInterface  $form_state 
)

{}

References Drupal\config(), FileTransferAuthorizeForm\getFiletransfer(), FormStateInterface\getTriggeringElement(), FormStateInterface\getValue(), FileTransferAuthorizeForm\runOperation(), FormStateInterface\setRebuild(), FormStateInterface\setResponse(), and FormStateInterface\unsetValue().

Here is the call graph for this function:

validateForm ( array &  $form,
FormStateInterface  $form_state 
)

{}

References FileTransferAuthorizeForm\getFiletransfer(), FormStateInterface\getTriggeringElement(), FormStateInterface\getValue(), FormStateInterface\setErrorByName(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: