function panopoly_theme_selection_form_submit in Panopoly 7
Form submit handler to select the theme
File
- modules/
panopoly/ panopoly_theme/ panopoly_theme.profile.inc, line 56 - panopoly_theme.profile.inc
Code
function panopoly_theme_selection_form_submit($form, &$form_state) {
// Enable and set the theme of choice
$theme = $form_state['values']['theme'];
theme_enable(array(
$theme,
));
variable_set('theme_default', $theme);
// Set the Bartik or Garland logo to be Panopoly's logo
if ($theme == 'bartik' || $theme == 'garland' || $theme == 'responsive_bartik') {
$theme_data = _system_rebuild_theme_data();
$theme_data[$theme]->info['settings']['default_logo'] = 0;
$theme_data[$theme]->info['settings']['logo_path'] = drupal_get_path('module', 'panopoly_theme') . '/images/panopoly_icon_theme.png';
variable_set('theme_' . $theme . '_settings', $theme_data[$theme]->info['settings']);
}
// Flush theme caches so things are right
system_rebuild_theme_data();
drupal_theme_rebuild();
}