function update_manager_install_form

7.x update_manager_install_form($form, &$form_state, $context)

Form constructor for the install form of the Update Manager module.

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


$context: String representing the context from which we're trying to install. Allowed values are 'module', 'theme', and 'report'.

See also




Related topics

1 string reference to 'update_manager_install_form'
update_menu in drupal/modules/update/update.module
Implements hook_menu().


drupal/modules/update/, line 496
Administrative screens and processing functions of the Update Manager module.


function update_manager_install_form($form, &$form_state, $context) {
  if (!_update_manager_check_backends($form, 'install')) {
    return $form;

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

  $form['project_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Install from a URL'),
    '#description' => t('For example: %url', array('%url' => '')),

  $form['information'] = array(
    '#prefix' => '<strong>',
    '#markup' => t('Or'),
    '#suffix' => '</strong>',

  $form['project_upload'] = array(
    '#type' => 'file',
    '#title' => t('Upload a module or theme 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(
    '#type' => 'submit',
    '#value' => t('Install'),

  return $form;