public UpdateManagerInstall::buildForm(array $form, FormStateInterface $form_state)
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides FormInterface::buildForm
File
- core/modules/update/src/Form/UpdateManagerInstall.php, line 76
Class
- UpdateManagerInstall
- Configure update settings for this site.
Namespace
Drupal\update\Form
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | public function buildForm( array $form , FormStateInterface $form_state ) { $this ->moduleHandler->loadInclude( 'update' , 'inc' , 'update.manager' ); if (!_update_manager_check_backends( $form , 'install' )) { return $form ; } $form [ 'help_text' ] = array ( '#prefix' => '<p>' , '#markup' => $this ->t( 'You can find <a href=":module_url">modules</a> and <a href=":theme_url">themes</a> on <a href=":drupal_org_url">drupal.org</a>. The following file extensions are supported: %extensions.' , array ( '%extensions' => archiver_get_extensions(), )), '#suffix' => '</p>' , ); $form [ 'project_url' ] = array ( '#type' => 'url' , '#title' => $this ->t( 'Install from a URL' ), '#description' => $this ->t( 'For example: %url' , array ( '%url' => 'http://ftp.drupal.org/files/projects/name.tar.gz' )), ); $form [ 'information' ] = array ( '#prefix' => '<strong>' , '#markup' => $this ->t( 'Or' ), '#suffix' => '</strong>' , ); $form [ 'project_upload' ] = array ( '#type' => 'file' , '#title' => $this ->t( 'Upload a module or theme archive to install' ), '#description' => $this ->t( 'For example: %filename from your local computer' , array ( '%filename' => 'name.tar.gz' )), ); $form [ 'actions' ] = array ( '#type' => 'actions' ); $form [ 'actions' ][ 'submit' ] = array ( '#type' => 'submit' , '#button_type' => 'primary' , '#value' => $this ->t( 'Install' ), ); return $form ; } |
Please login to continue.