You are here

function panelizer_panelizer_task_edit_settings 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()

General settings for the panel

1 string reference to 'panelizer_panelizer_task_edit_settings'
panelizer_node.inc in plugins/task_handlers/panelizer_node.inc
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.

File

plugins/task_handlers/panelizer_node.inc, line 412
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($form, &$form_state) {
  ctools_include('context');
  ctools_include('context-task-handler');
  $conf = $form_state['handler']->conf;
  $form['title'] = array(
    '#type' => 'textfield',
    '#default_value' => !empty($conf['title']) ? $conf['title'] : t('Panelizer'),
    '#title' => t('Administrative title'),
    '#description' => t('Administrative title of this variant.'),
  );
  $name = isset($conf['name']) ? $conf['name'] : FALSE;
  $form['name'] = array(
    '#type' => 'machine_name',
    '#title' => t('Machine name'),
    '#required' => FALSE,
    '#default_value' => $name,
    '#description' => t("A unique machine-readable name for this variant. It must only contain lowercase letters, numbers, and underscores. This name will be used when exporting the variant. If left empty the variant's name will be used instead."),
    '#size' => 32,
    '#maxlength' => 32,
    '#machine_name' => array(
      'exists' => 'page_manager_handler_check_machine_name',
      'source' => array(
        'title',
      ),
    ),
    '#field_prefix' => '<span dir="ltr">' . $form_state['task_name'] . '__',
    '#field_suffix' => '</span>&lrm;',
  );
  $contexts = ctools_context_handler_get_all_contexts($form_state['task'], $form_state['subtask'], $form_state['handler']);
  $required_context = new ctools_context_required(t('Panelized entity'), 'entity');
  $form['context'] = ctools_context_selector($contexts, $required_context, isset($conf['context']) ? $conf['context'] : '');
  return $form;
}