You are here

function panels_context_create_vocabulary in Panels 6.2

Same name and namespace in other branches
  1. 5.2 contexts/vocabulary.inc \panels_context_create_vocabulary()

It's important to remember that $conf is optional here, because contexts are not always created from the UI.

1 string reference to 'panels_context_create_vocabulary'
panels_vocabulary_panels_contexts in contexts/vocabulary.inc
@file contexts/vocabulary.inc

File

contexts/vocabulary.inc, line 27
contexts/vocabulary.inc

Code

function panels_context_create_vocabulary($empty, $data = NULL, $conf = FALSE) {
  $context = new panels_context('vocabulary');
  $context->plugin = 'vocabulary';
  if ($empty) {
    return $context;
  }
  if ($conf) {
    $data = taxonomy_vocabulary_load($data['vid']);
  }
  if (!empty($data)) {
    $context->data = $data;
    $context->title = $data->name;
    $context->argument = $data->vid;
    return $context;
  }
}