1 installer.pages.inc | installer_browser_installation_theme_form($form, &$form_state, $projects) |
Form builder for theme install.
Parameters
$projects: An array of projects selected for install, keyed by project name.
File
- core/
modules/ installer/ installer.pages.inc, line 530 - Page callbacks used by the Installer browse pages.
Code
function installer_browser_installation_theme_form($form, &$form_state, $projects) {
backdrop_add_css(backdrop_get_path('module', 'installer') . '/css/installer.css', array('preprocess' => FALSE));
module_load_include('inc', 'installer', 'installer.browser');
$form['instructions'] = array(
'#type' => 'item',
'#markup' => t('The themes you selected have been successfully installed. You may enable installed themes here or on the main !themes page. ', array('!themes' => l(t('Themes'), 'admin/appearance')))
);
$theme_default = config_get('system.core', 'theme_default');
$themes = system_rebuild_theme_data();
foreach ($projects as $project) {
if ($project['type'] == 'theme' && isset($themes[$project['name']])) {
$theme = $project['name'];
$form[$theme] = array(
'#type' => 'fieldset',
'#collapsed' => FALSE,
'#collapsible' => FALSE,
'#title' => $themes[$theme]->info['name'],
'#attributes' => array(
'class' => array('installer-installed-theme'),
),
);
if (file_exists($themes[$theme]->info['screenshot'])) {
$form[$theme]['image'] = array(
'#type' => 'item',
'#markup' => theme('image', array('path' => $themes[$theme]->info['screenshot'])),
'#attributes' => array(
'class' => array('installer-installed-theme-image'),
),
);
}
if ($theme == $theme_default) {
$form[$theme]['is_default'] = array(
'#type' => 'markup',
'#markup' => t('Default theme'),
);
}
else {
$form[$theme]['set'] = array(
'#type' => 'submit',
'#value' => t('Set as default theme'),
'#name' => $theme . '-submit',
'#submit' => array('installer_browser_installation_theme_set'),
);
}
}
}
if (in_array('module', installer_browser_get_installed_types())) {
$form['actions'] = array('#type' => 'actions');
$form['actions']['next_link'] = array(
'#type' => 'submit',
'#value' => t('Next: enable new modules'),
'#submit' => array('installer_browser_installation_theme_next'),
);
}
else {
$form['next_link'] = array(
'#type' => 'submit',
'#value' => t('Finish'),
'#submit' => array('installer_browser_installation_theme_finish'),
);
}
return $form;
}