You are here

function ctools_access_summary in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/context.inc \ctools_access_summary()

Get a summary of an access plugin's settings.

3 calls to ctools_access_summary()
ctools_access_admin_render_table in includes/context-access-admin.inc
Render the table. This is used both to render it initially and to rerender it upon ajax response.
ctools_access_group_summary in includes/context.inc
Get a summary of a group of access plugin's settings.
ctools_context_handler_summary in includes/context-task-handler.inc
Get the array of summary strings for the arguments.

File

includes/context.inc, line 1358
Contains code related to the ctools system of 'context'.

Code

function ctools_access_summary($plugin, $contexts, $test) {
  if (!isset($contexts['logged-in-user'])) {
    $contexts['logged-in-user'] = ctools_access_get_loggedin_context();
  }
  $description = '';
  if ($function = ctools_plugin_get_function($plugin, 'summary')) {
    $required_context = isset($plugin['required context']) ? $plugin['required context'] : array();
    $context = isset($test['context']) ? $test['context'] : array();
    $description = $function($test['settings'], ctools_context_select($contexts, $required_context, $context), $plugin);
  }
  if (!empty($test['not'])) {
    $description = "NOT ({$description})";
  }
  return $description;
}