You are here

function PanelizerEntityDefault::page_reset in Panelizer 7.3

Switched page callback to give the settings form.

File

plugins/entity/PanelizerEntityDefault.class.php, line 2385
Base class for the Panelizer Entity plugin.

Class

PanelizerEntityDefault
Base class for the Panelizer Entity plugin.

Code

function page_reset($js, $input, $entity, $view_mode) {
  $panelizer = $entity->panelizer[$view_mode];
  $form_state = array(
    'entity' => $entity,
    'revision info' => $this
      ->entity_allows_revisions($entity),
    'panelizer' => $panelizer,
    'view_mode' => $view_mode,
    'no_redirect' => TRUE,
  );
  ctools_include('common', 'panelizer');
  $output = drupal_build_form('panelizer_reset_entity_form', $form_state);
  if (!empty($form_state['executed'])) {
    $this
      ->reset_entity_panelizer($entity, $view_mode);
    drupal_set_message(t('Panelizer display information has been reset.'));
    drupal_goto(dirname(dirname($_GET['q'])));
  }
  return $output;
}