function context_condition_bookroot::execute

cis7 context_condition_bookroot.inc context_condition_bookroot::execute($node, $op)
cle7 context_condition_bookroot.inc context_condition_bookroot::execute($node, $op)
elmsmedia7 context_condition_bookroot.inc context_condition_bookroot::execute($node, $op)
icor7 context_condition_bookroot.inc context_condition_bookroot::execute($node, $op)
meedjum_blog7 context_condition_bookroot.inc context_condition_bookroot::execute($node, $op)
mooc7 context_condition_bookroot.inc context_condition_bookroot::execute($node, $op)

Overrides context_condition_node::execute

File

sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc, line 7

Class

context_condition_bookroot
Set the context on the basis of the node type of page's book root.

Code

function execute($node, $op) {
  if ($this->condition_used() && !empty($node->book['bid'])) {
    $type = db_select('node')->fields('node', array('type'))->condition('nid', $node->book['nid'])->execute()->fetchField();
    $book = new stdClass();
    $book->type = $type;
    parent::execute($book, $op);
  }
}