You are here

function panels_edit_add_access_test_form in Panels 7.3

Same name and namespace in other branches
  1. 6.3 plugins/display_renderers/panels_renderer_editor.class.php \panels_edit_add_access_test_form()

Form to add a visibility rule.

1 string reference to 'panels_edit_add_access_test_form'
panels_renderer_editor::ajax_access_add_test in plugins/display_renderers/panels_renderer_editor.class.php
AJAX entry point for to add a visibility rule.

File

plugins/display_renderers/panels_renderer_editor.class.php, line 1967
Class file to control the main Panels editor.

Code

function panels_edit_add_access_test_form($form, &$form_state) {
  ctools_form_include($form_state, 'plugins', 'panels');
  form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class');
  $display =& $form_state['display'];
  $pane =& $form_state['pane'];
  $plugins = ctools_get_relevant_access_plugins($display->context);
  $options = array();
  foreach ($plugins as $id => $plugin) {
    $options[$id] = $plugin['title'];
  }
  asort($options);
  $form['type'] = array(
    // This ensures that the form item is added to the URL.
    '#type' => 'radios',
    '#options' => $options,
  );
  $form['next'] = array(
    '#type' => 'submit',
    '#value' => t('Next'),
  );
  return $form;
}