diff options
Diffstat (limited to 'sites/all/modules/entity/modules/book.info.inc')
-rw-r--r-- | sites/all/modules/entity/modules/book.info.inc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sites/all/modules/entity/modules/book.info.inc b/sites/all/modules/entity/modules/book.info.inc new file mode 100644 index 000000000..96629c365 --- /dev/null +++ b/sites/all/modules/entity/modules/book.info.inc @@ -0,0 +1,30 @@ +<?php + +/** + * @file + * Provides info about book nodes. + */ + +/** + * Implements hook_entity_property_info_alter() on top of book module. + * + * @see entity_entity_property_info_alter() + */ +function entity_metadata_book_entity_property_info_alter(&$info) { + // Add meta-data about the added node properties. + $properties = &$info['node']['properties']; + + $properties['book'] = array( + 'label' => t("Book"), + 'type' => 'node', + 'description' => t("If part of a book, the book to which this book page belongs."), + 'getter callback' => 'entity_metadata_book_get_properties', + ); + $properties['book_ancestors'] = array( + 'label' => t("Book ancestors"), + 'type' => 'list<node>', + 'computed' => TRUE, + 'description' => t("If part of a book, a list of all book pages upwards in the book hierarchy."), + 'getter callback' => 'entity_metadata_book_get_properties', + ); +} |