You are here

function ctools_context_handler_summary in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/context-task-handler.inc \ctools_context_handler_summary()

Get the array of summary strings for the arguments.

These summary strings are used to communicate to the user what arguments the task handlers are selecting.

Parameters

$task: The loaded task plugin.

$subtask: The subtask id.

$handler: The handler to be checked.

File

includes/context-task-handler.inc, line 191
Support for creating 'context' type task handlers.

Code

function ctools_context_handler_summary($task, $subtask, $handler) {
  if (empty($handler->conf['access']['plugins'])) {
    return array();
  }
  ctools_include('context');
  $strings = array();
  $contexts = ctools_context_handler_get_all_contexts($task, $subtask, $handler);
  foreach ($handler->conf['access']['plugins'] as $test) {
    $plugin = ctools_get_access_plugin($test['name']);
    if ($string = ctools_access_summary($plugin, $contexts, $test)) {
      $strings[] = $string;
    }
  }
  return $strings;
}