You are here

function ctools_access_summary in Chaos Tool Suite (ctools) 7

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

Get a summary of an access plugin's settings.

Return value

string The summary text.

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 1873
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();
    $selected_context = ctools_context_select($contexts, $required_context, $context);
    $description = $function($test['settings'], $selected_context, $plugin);
  }
  if (!empty($test['not'])) {
    $description = "NOT ({$description})";
  }
  return $description;
}