summaryrefslogtreecommitdiff
path: root/sites/all/modules/views/tests/test_plugins/views_test_plugin_access_test_dynamic.inc
diff options
context:
space:
mode:
Diffstat (limited to 'sites/all/modules/views/tests/test_plugins/views_test_plugin_access_test_dynamic.inc')
-rw-r--r--sites/all/modules/views/tests/test_plugins/views_test_plugin_access_test_dynamic.inc26
1 files changed, 26 insertions, 0 deletions
diff --git a/sites/all/modules/views/tests/test_plugins/views_test_plugin_access_test_dynamic.inc b/sites/all/modules/views/tests/test_plugins/views_test_plugin_access_test_dynamic.inc
new file mode 100644
index 000000000..cecec2f96
--- /dev/null
+++ b/sites/all/modules/views/tests/test_plugins/views_test_plugin_access_test_dynamic.inc
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * @file
+ * Definition of views_test_plugin_access_test_dynamic.
+ */
+
+/**
+ * Tests a dynamic access plugin.
+ */
+class views_test_plugin_access_test_dynamic extends views_plugin_access {
+ function option_definition() {
+ $options = parent::option_definition();
+ $options['access'] = array('default' => FALSE, 'bool' => TRUE);
+
+ return $options;
+ }
+
+ function access($account) {
+ return !empty($this->options['access']) && isset($this->view->args[0]) && $this->view->args[0] == variable_get('test_dynamic_access_argument1', NULL) && isset($this->view->args[1]) && $this->view->args[1] == variable_get('test_dynamic_access_argument2', NULL);
+ }
+
+ function get_access_callback() {
+ return array('views_test_test_dynamic_access_callback', array(!empty($options['access']), 1, 2));
+ }
+}