Skip to content
Snippets Groups Projects
Commit 7cf1fd01 authored by Earl Miles's avatar Earl Miles
Browse files

Make access plugins a little less focused on the term "access" and change...

Make access plugins a little less focused on the term "access" and change selection criteria to selection rules.
parent d89edb79
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Support for creating 'context' type task handlers. * Support for creating 'context' type task handlers.
* *
* Context task handlers expect the task to provide 0 or more contexts. The * Context task handlers expect the task to provide 0 or more contexts. The
* task handler should use those contexts as selection criteria, as well as * task handler should use those contexts as selection rules, as well as
* rendering with them. * rendering with them.
* *
* The functions and forms in this file should be common to every context type * The functions and forms in this file should be common to every context type
...@@ -75,7 +75,7 @@ function ctools_context_handler_render($task, $subtask_id, $contexts, $page = TR ...@@ -75,7 +75,7 @@ function ctools_context_handler_render($task, $subtask_id, $contexts, $page = TR
* The context objects provided by the task. * The context objects provided by the task.
* *
* @return * @return
* TRUE if these contexts match the selection criteria. NULL or FALSE * TRUE if these contexts match the selection rules. NULL or FALSE
* otherwise. * otherwise.
*/ */
function ctools_context_handler_select($handler, $contexts) { function ctools_context_handler_select($handler, $contexts) {
...@@ -205,7 +205,7 @@ function ctools_context_handler_get_task_arguments($task, $subtask_id) { ...@@ -205,7 +205,7 @@ function ctools_context_handler_get_task_arguments($task, $subtask_id) {
} }
/** /**
* Form to choose context based selection criteria for a task handler. * Form to choose context based selection rules for a task handler.
* *
* The configuration will be assumed to go simply in $handler->conf and * The configuration will be assumed to go simply in $handler->conf and
* will be keyed by the argument ID. * will be keyed by the argument ID.
...@@ -228,7 +228,7 @@ function ctools_context_handler_edit_criteria(&$form, &$form_state) { ...@@ -228,7 +228,7 @@ function ctools_context_handler_edit_criteria(&$form, &$form_state) {
} }
/** /**
* Submit handler for criteria selection * Submit handler for rules selection
*/ */
function ctools_context_handler_edit_criteria_submit(&$form, &$form_state) { function ctools_context_handler_edit_criteria_submit(&$form, &$form_state) {
$form_state['handler']->conf['access']['logic'] = $form_state['values']['logic']; $form_state['handler']->conf['access']['logic'] = $form_state['values']['logic'];
......
...@@ -88,8 +88,10 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) { ...@@ -88,8 +88,10 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) {
} }
else if ($type == 'conditions') { else if ($type == 'conditions') {
foreach ($args as $key => $value) { foreach ($args as $key => $value) {
$conditions[] = "$key = " . db_type_placeholder($schema['fields'][$key]['type']); if (isset($schema['fields'][$key])) {
$query_args[] = $value; $conditions[] = "$key = " . db_type_placeholder($schema['fields'][$key]['type']);
$query_args[] = $value;
}
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
function ctools_node_access_ctools_access() { function ctools_node_access_ctools_access() {
$args['node_access'] = array( $args['node_access'] = array(
'title' => t("Node access by node security"), 'title' => t("Node: Access status"),
'description' => t('Control access with built in Drupal node access test.'), 'description' => t('Control access with built in Drupal node access test.'),
'callback' => 'ctools_node_access_ctools_access_check', 'callback' => 'ctools_node_access_ctools_access_check',
'default' => array('type' => 'view'), 'default' => array('type' => 'view'),
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
function ctools_node_language_ctools_access() { function ctools_node_language_ctools_access() {
if (module_exists('locale')) { if (module_exists('locale')) {
$items['node_language'] = array( $items['node_language'] = array(
'title' => t("Node access by language"), 'title' => t("Node: Language"),
'description' => t('Control access by node language.'), 'description' => t('Control access by node language.'),
'callback' => 'ctools_node_language_ctools_access_check', 'callback' => 'ctools_node_language_ctools_access_check',
'default' => array('language' => array()), 'default' => array('language' => array()),
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
function ctools_node_type_ctools_access() { function ctools_node_type_ctools_access() {
$args['node_type'] = array( $args['node_type'] = array(
'title' => t("Node access by type"), 'title' => t("Node: Type"),
'description' => t('Control access by node_type.'), 'description' => t('Control access by node_type.'),
'callback' => 'ctools_node_type_ctools_access_check', 'callback' => 'ctools_node_type_ctools_access_check',
'default' => array('type' => array()), 'default' => array('type' => array()),
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
function ctools_perm_ctools_access() { function ctools_perm_ctools_access() {
$args['perm'] = array( $args['perm'] = array(
'title' => t("Access by user permission string"), 'title' => t("User: Permission string"),
'description' => t('Control access by permission string.'), 'description' => t('Control access by permission string.'),
'callback' => 'ctools_perm_ctools_access_check', 'callback' => 'ctools_perm_ctools_access_check',
'default' => array('perm' => 'access content'), 'default' => array('perm' => 'access content'),
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
function ctools_role_ctools_access() { function ctools_role_ctools_access() {
$args['role'] = array( $args['role'] = array(
'title' => t("Access by user role"), 'title' => t("User: role"),
'description' => t('Control access by role.'), 'description' => t('Control access by role.'),
'callback' => 'ctools_role_ctools_access_check', 'callback' => 'ctools_role_ctools_access_check',
'default' => array('rids' => array()), 'default' => array('rids' => array()),
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
function ctools_site_language_ctools_access() { function ctools_site_language_ctools_access() {
if (module_exists('locale')) { if (module_exists('locale')) {
$items['site_language'] = array( $items['site_language'] = array(
'title' => t("Access by site language"), 'title' => t("User: language"),
'description' => t('Control access by the language the site currently uses.'), 'description' => t('Control access by the language the user or site currently uses.'),
'callback' => 'ctools_site_language_ctools_access_check', 'callback' => 'ctools_site_language_ctools_access_check',
'default' => array('language' => array()), 'default' => array('language' => array()),
'settings form' => 'ctools_site_language_ctools_access_settings', 'settings form' => 'ctools_site_language_ctools_access_settings',
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
*/ */
function ctools_term_vocabulary_ctools_access() { function ctools_term_vocabulary_ctools_access() {
$args['term_vocabulary'] = array( $args['term_vocabulary'] = array(
'title' => t("Term access by vocabulary"), 'title' => t("Taxonomy: Vocabulary"),
'description' => t('Control access by term vocabulary.'), 'description' => t('Control access by term vocabulary.'),
'callback' => 'ctools_term_vocabulary_ctools_access_check', 'callback' => 'ctools_term_vocabulary_ctools_access_check',
'default' => array('vids' => array()), 'default' => array('vids' => array()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment