You are here

function ctools_terms_context in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/arguments/terms.inc \ctools_terms_context()

Discover if this argument gives us the term we crave.

1 string reference to 'ctools_terms_context'
terms.inc in plugins/arguments/terms.inc
Plugin to provide an argument handler for a Taxonomy term

File

plugins/arguments/terms.inc, line 31
Plugin to provide an argument handler for a Taxonomy term

Code

function ctools_terms_context($arg = NULL, $conf = NULL, $empty = FALSE) {

  // If unset it wants a generic, unfilled context.
  if ($empty) {
    return ctools_context_create_empty('terms');
  }
  $terms = ctools_break_phrase($arg);
  if (empty($terms->value) || !empty($terms->invalid_input)) {
    return FALSE;
  }
  $context = ctools_context_create('terms', $terms);
  $context->original_argument = $arg;
  return $context;
}