context_condition_bookroot.inc

  1. cis7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
  2. cle7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
  3. ecd7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
  4. elmsmedia7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
  5. harmony7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
  6. icor7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
  7. meedjum_blog7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
  8. mooc7 sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc

Classes

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

File

sites/all/modules/ulmus/context/plugins/context_condition_bookroot.inc
View source
  1. <?php
  2. /**
  3. * Set the context on the basis of the node type of page's book root.
  4. */
  5. class context_condition_bookroot extends context_condition_node {
  6. function execute($node, $op) {
  7. if ($this->condition_used() && !empty($node->book['bid'])) {
  8. $type = db_select('node')
  9. ->fields('node', array('type'))
  10. ->condition('nid', $node->book['nid'])
  11. ->execute()
  12. ->fetchField();
  13. $book = new stdClass();
  14. $book->type = $type;
  15. parent::execute($book, $op);
  16. }
  17. }
  18. }