function views_plugin_argument_validate_node::options_form in Views (for Drupal 7) 6.3
Same name and namespace in other branches
- 7.3 modules/node/views_plugin_argument_validate_node.inc \views_plugin_argument_validate_node::options_form()
Provide the default form for setting options.
Overrides views_plugin_argument_validate::options_form
File
- modules/
node/ views_plugin_argument_validate_node.inc, line 21 - Contains the 'node' argument validator plugin.
Class
- views_plugin_argument_validate_node
- Validate whether an argument is an acceptable node.
Code
function options_form(&$form, &$form_state) {
$types = node_get_types();
foreach ($types as $type => $info) {
$options[$type] = check_plain(t($info->name));
}
$form['types'] = array(
'#type' => 'checkboxes',
'#title' => t('Types'),
'#options' => $options,
'#default_value' => $this->options['types'],
'#description' => t('If you wish to validate for specific node types, check them; if none are checked, all nodes will pass.'),
);
$form['access'] = array(
'#type' => 'checkbox',
'#title' => t('Validate user has access to the node'),
'#default_value' => $this->options['access'],
);
$form['access_op'] = array(
'#type' => 'radios',
'#title' => t('Access operation to check'),
'#options' => array(
'view' => t('View'),
'update' => t('Edit'),
'delete' => t('Delete'),
),
'#default_value' => $this->options['access_op'],
);
$form['nid_type'] = array(
'#type' => 'select',
'#title' => t('Argument type'),
'#options' => array(
'nid' => t('Node ID'),
'nids' => t('Node IDs separated by , or +'),
),
'#default_value' => $this->options['nid_type'],
);
}