You are here

function headerimage_eval_taxonomy in Header image 6

Same name and namespace in other branches
  1. 5 headerimage.module \headerimage_eval_taxonomy()
  2. 7 headerimage.module \headerimage_eval_taxonomy()

Evaluate taxonomy condition

Check if current page has selected taxonomy terms

Parameters

$condition: array of taxonomy term tid's

Return value

true: current page contains one of $condition's tags false: if not null: current page is not a node

1 call to headerimage_eval_taxonomy()
headerimage_select_node in ./headerimage.module
Select a node to be displayed in the block

File

./headerimage.module, line 279
headerimage.module Conditionally display an node in a block.

Code

function headerimage_eval_taxonomy($condition) {
  if (arg(0) == 'node' && is_numeric(arg(1))) {
    if ($node = menu_get_object()) {
      foreach (array_keys($node->taxonomy) as $key) {
        if (isset($condition[$key])) {
          return true;
        }
      }
      return false;
    }
  }
  return null;
}