You are here

function ctools_context_required::ctools_context_required in Chaos Tool Suite (ctools) 6

Parameters

$title: The first parameter should be the 'title' of the context for use in UYI selectors when multiple contexts qualify.

...: One or more keywords to use for matching which contexts are allowed.

File

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

Class

ctools_context_required
Used to create a method of comparing if a list of contexts match a required context type.

Code

function ctools_context_required($title) {
  $args = func_get_args();
  $this->title = array_shift($args);

  // If we were given restrictions at the end, store them.
  if (count($args) > 1 && is_array(end($args))) {
    $this->restrictions = array_pop($args);
  }
  if (count($args) == 1) {
    $args = array_shift($args);
  }
  $this->keywords = $args;
}