You are here

function ctools_access_ajax_edit_item in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/context-access-admin.inc \ctools_access_ajax_edit_item()

Form to edit the settings of an access test.

2 string references to 'ctools_access_ajax_edit_item'
ctools_access_ajax_add in includes/context-access-admin.inc
AJAX callback to add a new access test to the list.
ctools_access_ajax_edit in includes/context-access-admin.inc
AJAX callback to edit an access test in the list.

File

includes/context-access-admin.inc, line 399
Contains administrative screens for the access control plugins.

Code

function ctools_access_ajax_edit_item($form, &$form_state) {
  $test =& $form_state['test'];
  $plugin =& $form_state['plugin'];
  if (isset($plugin['required context'])) {
    $form['context'] = ctools_context_selector($form_state['contexts'], $plugin['required context'], $test['context']);
  }
  $form['settings'] = array(
    '#tree' => TRUE,
  );
  if ($function = ctools_plugin_get_function($plugin, 'settings form')) {
    $form = $function($form, $form_state, $test['settings']);
  }
  $form['not'] = array(
    '#type' => 'checkbox',
    '#title' => t('Reverse (NOT)'),
    '#default_value' => !empty($test['not']),
  );
  $form['save'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}