function context_condition_bookroot::execute in Context 6.3
Same name and namespace in other branches
- 6 plugins/context_condition_bookroot.inc \context_condition_bookroot::execute()
- 7.3 plugins/context_condition_bookroot.inc \context_condition_bookroot::execute()
Overrides context_condition_node::execute
File
- 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_result(db_query("SELECT type FROM {node} WHERE nid = %d", $node->book['bid']));
$book = new stdClass();
$book->type = $type;
parent::execute($book, $op);
}
}