You are here

function panelizer_panelizer_task_edit_settings_submit in Panelizer 7.3

Same name and namespace in other branches
  1. 7.2 plugins/task_handlers/panelizer_node.inc \panelizer_panelizer_task_edit_settings_submit()

File

plugins/task_handlers/panelizer_node.inc, line 448
This is the task handler plugin to handle an entity view. NOTE: This is named panelizer_node for historical reasons. It is too much of a pain to change the name of a task handler. This panelizes any entity not just a node.

Code

function panelizer_panelizer_task_edit_settings_submit($form, &$form_state) {
  $machine_name = $form_state['handler']->name;
  $name = $form_state['task_id'] . '__' . $form_state['values']['name'];

  // If new name doesn't equal machine name, we need to update and redirect.
  if ($machine_name !== $name) {
    $form_state['new trail'] = $form_state['trail'];
    $delta = array_search($machine_name, $form_state['new trail']);
    $form_state['new trail'][$delta] = $name;
    $form_state['handler']->name = $name;
  }
  $form_state['handler']->conf['title'] = $form_state['values']['title'];
  $form_state['handler']->conf['name'] = $form_state['values']['name'];
  $form_state['handler']->conf['context'] = $form_state['values']['context'];
}