You are here

function panels_vid_context in Panels 5.2

Same name and namespace in other branches
  1. 6.2 arguments/vid.inc \panels_vid_context()

Discover if this argument gives us the vocabulary we crave.

1 string reference to 'panels_vid_context'
panels_vid_panels_arguments in arguments/vid.inc
@file arguments/vid.inc

File

arguments/vid.inc, line 27
arguments/vid.inc

Code

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

  // If unset it wants a generic, unfilled context.
  if ($empty) {
    return panels_context_create_empty('vocabulary');
  }
  if (!is_numeric($arg)) {
    return FALSE;
  }
  $vocabulary = taxonomy_get_vocabulary($arg);
  if (!$vocabulary) {
    return FALSE;
  }
  return panels_context_create('vocabulary', $vocabulary);
}