function ctools_vid_context in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 plugins/arguments/vid.inc \ctools_vid_context()
 
Discover if this argument gives us the vocabulary we crave.
1 string reference to 'ctools_vid_context'
File
- plugins/
arguments/ vid.inc, line 28  - Plugin to provide an argument handler for a vocabulary id
 
Code
function ctools_vid_context($arg = NULL, $conf = NULL, $empty = FALSE) {
  // If unset it wants a generic, unfilled context.
  if ($empty) {
    return ctools_context_create_empty('vocabulary');
  }
  if (!is_numeric($arg)) {
    return NULL;
  }
  $vocabulary = taxonomy_vocabulary_load($arg);
  if (!$vocabulary) {
    return NULL;
  }
  return ctools_context_create('vocabulary', $vocabulary);
}