You are here

function ctools_plugin_example_arg_length_ctools_access_settings in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 ctools_plugin_example/plugins/access/arg_length.inc \ctools_plugin_example_arg_length_ctools_access_settings()

Settings form for the 'by role' access plugin.

1 string reference to 'ctools_plugin_example_arg_length_ctools_access_settings'
arg_length.inc in ctools_plugin_example/plugins/access/arg_length.inc
Plugin to provide access control/visibility based on length of simplecontext argument (in URL).

File

ctools_plugin_example/plugins/access/arg_length.inc, line 25
Plugin to provide access control/visibility based on length of simplecontext argument (in URL).

Code

function ctools_plugin_example_arg_length_ctools_access_settings(&$form, &$form_state, $conf) {
  $form['settings']['greater_than'] = array(
    '#type' => 'radios',
    '#title' => t('Grant access if simplecontext argument length is'),
    '#options' => array(
      1 => t('Greater than'),
      0 => t('Less than or equal to'),
    ),
    '#default_value' => $conf['greater_than'],
  );
  $form['settings']['arg_length'] = array(
    '#type' => 'textfield',
    '#title' => t('Length of simplecontext argument'),
    '#size' => 3,
    '#default_value' => $conf['arg_length'],
    '#description' => t('Access/visibility will be granted based on arg length.'),
  );
}