1.20.x installer.manager.inc installer_manager_install_form($form, &$form_state)

Form constructor for the install form of the Installer module.

This presents a place to enter a URL or upload an archive file to use to install a new module, theme, or layout.

See also

installer_manager_install_form_validate()

installer_manager_install_form_submit()

update_menu()

Related topics

File

modules/installer/installer.manager.inc, line 503
Administrative screens and processing functions of the Installer module.

Code

function installer_manager_install_form($form, &$form_state) {
  if (!_installer_manager_check_backends($form, 'install')) {
    return $form;
  }

  backdrop_set_title('Manual installation');

  $form['help_text'] = array(
    '#prefix' => '<p>',
    '#markup' => t('You can find modules, themes, and layouts on <a href="https://backdropcms.org">backdropcms.org</a>. The following file extensions are supported: %extensions.', array(
      '%extensions' => archiver_get_extensions(),
    )),
    '#suffix' => '</p>',
  );

  $form['bulk_wrapper'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#title' => t('Install projects by name'),
  );
  $form['bulk_wrapper']['bulk'] = array(
    '#type' => 'textarea',
    '#title' => t('Names'),
    '#description' => t('Enter project names, one name per line. Names must only contain lowercase letters, numbers, and underscores.'),
  );

  $form['project_url_wrapper'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Install from a URL'),
  );
  $form['project_url_wrapper']['project_url'] = array(
    '#type' => 'url',
    '#title' => t('Install from a URL'),
    '#description' => t('For example: %url', array('%url' => 'https://github.com/backdrop-contrib/module/archive/1.x-1.2.3.zip')),
  );

  $form['project_upload_wrapper'] = array(
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#title' => t('Upload a module, theme, or layout archive to install'),
  );
  $form['project_upload_wrapper']['project_upload'] = array(
    '#type' => 'file',
    '#title' => t('Upload a module, theme, or layout archive to install'),
    '#description' => t('For example: %filename from your local computer', array('%filename' => 'name.tar.gz')),
  );

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#ajax' => array(
      'callback' => 'installer_manager_install_modal_callback',
    ),
    '#submit' => array('installer_manager_install_form_submit'),
    '#type' => 'submit',
    '#value' => t('Install'),
  );

  return $form;
}