You are here

function panels_term_from_node_context in Panels 5.2

Same name and namespace in other branches
  1. 6.2 relationships/term_from_node.inc \panels_term_from_node_context()

Return a new context based on an existing context

1 string reference to 'panels_term_from_node_context'
panels_term_from_node_panels_relationships in relationships/term_from_node.inc
@file relationships/term_from_node.inc

File

relationships/term_from_node.inc, line 26
relationships/term_from_node.inc

Code

function panels_term_from_node_context($context = NULL, $conf) {

  // If unset it wants a generic, unfilled context, which is just NULL
  if (empty($context->data)) {
    return panels_context_create_empty('term', NULL);
  }
  if (isset($context->data->taxonomy)) {
    foreach ($context->data->taxonomy as $term) {
      if ($term->vid == $conf['vid']) {
        return panels_context_create('term', $term);
      }
    }
  }
}