You are here

function page_manager_page_argument_form_change in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 page_manager/plugins/tasks/page.admin.inc \page_manager_page_argument_form_change()

Basic settings form for a page manager page.

1 string reference to 'page_manager_page_argument_form_change'
page_manager_page_subtask_argument_ajax in page_manager/plugins/tasks/page.admin.inc
Ajax entry point to edit an item

File

page_manager/plugins/tasks/page.admin.inc, line 1097
Administrative functions for the page subtasks.

Code

function page_manager_page_argument_form_change(&$form, &$form_state) {
  $page =& $form_state['page']->subtask['subtask'];
  $keyword =& $form_state['keyword'];
  ctools_include('context');
  $plugins = ctools_get_arguments();
  $options = array();
  foreach ($plugins as $id => $plugin) {
    $options[$id] = $plugin['title'];
  }
  asort($options);
  $options = array(
    '' => t('No context selected'),
  ) + $options;
  $argument = '';
  if (isset($page->arguments[$keyword]) && isset($page->arguments[$keyword]['name'])) {
    $argument = $page->arguments[$keyword]['name'];
  }
  $form['argument'] = array(
    '#type' => 'radios',
    '#options' => $options,
    '#default_value' => $argument,
  );
}