You are here

function pagerer_pane_theme_reset_form_submit in Pagerer 7

Pane level settings reset form - submission.

File

./pagerer.admin.inc, line 768
Pagerer administration

Code

function pagerer_pane_theme_reset_form_submit($form, &$form_state) {
  $preset_name = $form_state['build_info']['args'][0];
  $pane = $form_state['build_info']['args'][1];
  $preset = _pagerer_get_preset($preset_name);
  $theme_name = $preset[$pane . '_pane']['theme_name'];
  $theme_registry = theme_get_registry();
  $preset[$pane . '_pane']['theme_variables'] = $theme_registry[$theme_name]['variables'];
  unset($preset[$pane . '_pane']['theme_variables']['element'], $preset[$pane . '_pane']['theme_variables']['parameters']);
  _pagerer_save_preset($preset_name, $preset);
  drupal_set_message(t('The %pane pane configuration has been reset to default %theme theme variables.', array(
    '%theme' => $theme_name,
    '%pane' => $pane,
  )), 'status');
  $form_state['redirect'] = _PAGERER_CONFIG_PATH . '/edit/' . $preset_name;
}