book.info.inc 890 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Provides info about book nodes.
  5. */
  6. /**
  7. * Implements hook_entity_property_info_alter() on top of book module.
  8. *
  9. * @see entity_entity_property_info_alter()
  10. */
  11. function entity_metadata_book_entity_property_info_alter(&$info) {
  12. // Add meta-data about the added node properties.
  13. $properties = &$info['node']['properties'];
  14. $properties['book'] = array(
  15. 'label' => t("Book"),
  16. 'type' => 'node',
  17. 'description' => t("If part of a book, the book to which this book page belongs."),
  18. 'getter callback' => 'entity_metadata_book_get_properties',
  19. );
  20. $properties['book_ancestors'] = array(
  21. 'label' => t("Book ancestors"),
  22. 'type' => 'list<node>',
  23. 'computed' => TRUE,
  24. 'description' => t("If part of a book, a list of all book pages upwards in the book hierarchy."),
  25. 'getter callback' => 'entity_metadata_book_get_properties',
  26. );
  27. }