| 7 update.manager.inc | update_manager_install_form($form, &$form_state, $context) |
| 8 update.manager.inc | update_manager_install_form($form, &$form_state, $context) |
Build the form for the update manager page to install new projects.
This presents a place to enter a URL or upload an archive file to use to install a new module or theme.
_state
Parameters
$form:
$context: String representing the context from which we're trying to install, can be: 'module', 'theme' or 'report'.
Return value
The form array for selecting which project to install.
Related topics
1 string reference to 'update_manager_install_form'
File
- modules/
update/ update.manager.inc, line 478 - Administrative screens and processing functions for the update manager. This allows site administrators with the 'administer software updates' permission to either upgrade existing projects, or download and install new ones, so long as the…
Code
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">drupal.org</a>. The following file extensions are supported: %extensions.', array(
'@module_url' => 'http://drupal.org/project/modules',
'@theme_url' => 'http://drupal.org/project/themes',
'@drupal_org_url' => 'http://drupal.org',
'%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' => 'http://ftp.drupal.org/files/projects/name.tar.gz')),
);
$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;
}
Login or register to post comments