function ctools_php_ctools_access_settings
Settings form for the 'by perm' access plugin.
@todo Need a way to provide a list of all available contexts to be used by the eval-ed PHP.
1 string reference to 'ctools_php_ctools_access_settings'
File
-
plugins/
access/ php.inc, line 28
Code
function ctools_php_ctools_access_settings($form, &$form_state, $conf) {
$perms = array();
$form['settings']['description'] = array(
'#type' => 'textfield',
'#title' => t('Administrative desc'),
'#default_value' => $conf['description'],
'#description' => t('A description for this test for administrative purposes.'),
);
$form['settings']['php'] = array(
'#type' => 'textarea',
'#title' => t('PHP Code'),
'#default_value' => $conf['php'],
'#description' => t('Access will be granted if the following PHP code returns <code>TRUE</code>. Do not include <?php ?>. Note that executing incorrect PHP-code can break your Drupal site. All contexts will be available in the <em>$contexts</em> variable.'),
);
if (!user_access('use PHP for settings')) {
$form['settings']['php']['#disabled'] = TRUE;
$form['settings']['php']['#value'] = $conf['php'];
$form['settings']['php']['#description'] .= ' ' . t('You do not have sufficient permissions to edit PHP code.');
}
return $form;
}