context_condition_book.inc

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

Classes

Namesort descending Description
context_condition_book Expose book properties as a context condition.

File

sites/all/modules/ulmus/context/plugins/context_condition_book.inc
View source
  1. <?php
  2. /**
  3. * Expose book properties as a context condition.
  4. */
  5. class context_condition_book extends context_condition {
  6. function condition_values() {
  7. $values = array();
  8. foreach (book_get_books() as $book) {
  9. $values[$book['menu_name']] = check_plain($book['title']);
  10. }
  11. return $values;
  12. }
  13. function execute($node, $op) {
  14. if (isset($node->book, $node->book['menu_name'])) {
  15. foreach ($this->get_contexts($node->book['menu_name']) as $context) {
  16. $this->condition_met($context, $node->book['menu_name']);
  17. }
  18. }
  19. }
  20. }