function panopoly_theme_selection_form in Panopoly Theme 7
Form to choose the starting theme from list of available options
File
Code
function panopoly_theme_selection_form($form, &$form_state) {
// Set the page title
drupal_set_title(t('Choose a theme'));
// Create a list of theme options, minus the admin and testing themes
$themes = array();
foreach (system_rebuild_theme_data() as $theme) {
if (empty($theme->info['hidden']) && !in_array($theme->name, array(
'test_theme',
'update_test_basetheme',
'update_test_subtheme',
'block_test_theme',
'stark',
'seven',
))) {
$themes[$theme->name] = theme('image', array(
'path' => $theme->info['screenshot'],
)) . '<strong>' . $theme->info['name'] . '</strong><br><p><em>' . $theme->info['description'] . '</em></p><p class="clearfix"></p>';
}
}
$form['theme_wrapper'] = array(
'#title' => t('Starting Theme'),
'#type' => 'fieldset',
);
$form['theme_wrapper']['theme'] = array(
'#type' => 'radios',
'#options' => $themes,
'#default_value' => 'responsive_bartik',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Choose theme',
);
return $form;
}