You are here

function context_entity_prepare_view in Context 7.3

Implementation of hook_entity_prepare_view().

File

./context.core.inc, line 126

Code

function context_entity_prepare_view($prepare, $entity_type) {
  if ($entity_type === 'taxonomy_term' && count($prepare) === 1) {
    $term = reset($prepare);
    $menu = menu_get_object('taxonomy_term', 2);
    if ($menu && $term->tid == $menu->tid && ($plugin = context_get_plugin('condition', 'taxonomy_term'))) {
      $plugin
        ->execute($term, 'view');
    }
  }
}