summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_argument.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_argument.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_argument.inc42
1 files changed, 35 insertions, 7 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_argument.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_argument.inc
index 72c07e2..42617e7 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_argument.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/handlers/views_handler_argument.inc
@@ -1,7 +1,13 @@
<?php
/**
- * @defgroup views_argument_handlers Handlers for arguments
+ * @file
+ * @todo.
+ */
+
+/**
+ * @defgroup views_argument_handlers Views argument handlers
+ * Handlers to tell Views how to contextually filter queries.
* @{
*/
@@ -79,6 +85,9 @@ class views_handler_argument extends views_handler {
$this->options['summary']['format'] = $options['style_plugin'];
}
+ // Setup default value.
+ $options['style_options'] = isset($options['style_options']) ? $options['style_options'] : array();
+
if (!isset($options['summary']['sort_order']) && !empty($options['default_action']) && $options['default_action'] == 'summary asc') {
$this->options['default_action'] = 'summary';
$this->options['summary']['sort_order'] = 'asc';
@@ -173,17 +182,17 @@ class views_handler_argument extends views_handler {
$options['exception'] = array(
'contains' => array(
'value' => array('default' => 'all'),
- 'title_enable' => array('default' => 0),
- 'title' => array('default' => t('All'), 'translatable' => TRUE),
+ 'title_enable' => array('default' => FALSE, 'bool' => TRUE),
+ 'title' => array('default' => 'All', 'translatable' => TRUE),
),
);
- $options['title_enable'] = array('default' => 0);
+ $options['title_enable'] = array('default' => FALSE, 'bool' => TRUE);
$options['title'] = array('default' => '', 'translatable' => TRUE);
- $options['breadcrumb_enable'] = array('default' => 0);
+ $options['breadcrumb_enable'] = array('default' => FALSE, 'bool' => TRUE);
$options['breadcrumb'] = array('default' => '', 'translatable' => TRUE);
$options['default_argument_type'] = array('default' => 'fixed', 'export' => 'export_plugin');
$options['default_argument_options'] = array('default' => array(), 'export' => FALSE);
- $options['default_argument_skip_url'] = array('default' => FALSE);
+ $options['default_argument_skip_url'] = array('default' => FALSE, 'bool' => TRUE);
$options['summary_options'] = array('default' => array(), 'export' => FALSE);
$options['summary'] = array(
'contains' => array(
@@ -192,7 +201,7 @@ class views_handler_argument extends views_handler {
'format' => array('default' => 'default_summary', 'export' => 'export_summary'),
),
);
- $options['specify_validation'] = array('default' => 0);
+ $options['specify_validation'] = array('default' => FALSE, 'bool' => TRUE);
$options['validate'] = array(
'contains' => array(
'type' => array('default' => 'none', 'export' => 'export_validation'),
@@ -371,6 +380,7 @@ class views_handler_argument extends views_handler {
'#prefix' => '<div id="edit-options-validate-options-' . $id . '-wrapper">',
'#suffix' => '</div>',
'#type' => 'item',
+ // Even if the plugin has no options add the key to the form_state.
'#input' => TRUE, // trick it into checking input to make #process run
'#dependency' => array(
'edit-options-specify-validation' => array('1'),
@@ -507,6 +517,11 @@ class views_handler_argument extends views_handler {
'method' => 'default_empty',
'breadcrumb' => TRUE, // generate a breadcrumb to here
),
+ 'access denied' => array(
+ 'title' => t('Display "Access Denied"'),
+ 'method' => 'default_access_denied',
+ 'breadcrumb' => FALSE, // generate a breadcrumb to here
+ ),
);
if ($this->view->display_handler->has_path()) {
@@ -565,6 +580,8 @@ class views_handler_argument extends views_handler {
'#suffix' => '</div>',
'#id' => 'edit-options-argument-default-options-' . $id,
'#type' => 'item',
+ // Even if the plugin has no options add the key to the form_state.
+ '#input' => TRUE,
'#dependency' => array(
'radio:options[default_action]' => array('default'),
'edit-options-default-argument-type' => array($id)
@@ -707,6 +724,17 @@ class views_handler_argument extends views_handler {
}
/**
+ * Default action: access denied.
+ *
+ * If an argument was expected and was not given, in this case, report
+ * the view as 'access denied'.
+ */
+ function default_access_denied() {
+ $this->view->build_info['denied'] = TRUE;
+ return FALSE;
+ }
+
+ /**
* Default action: empty
*
* If an argument was expected and was not given, in this case, display