Projet

Général

Profil

Paste
Télécharger (890 octets) Statistiques
| Branche: | Révision:

root / htmltest / sites / all / modules / entity / modules / book.info.inc @ dd54aff9

1
<?php
2

    
3
/**
4
 * @file
5
 * Provides info about book nodes.
6
 */
7

    
8
/**
9
 * Implements hook_entity_property_info_alter() on top of book module.
10
 *
11
 * @see entity_entity_property_info_alter()
12
 */
13
function entity_metadata_book_entity_property_info_alter(&$info) {
14
  // Add meta-data about the added node properties.
15
  $properties = &$info['node']['properties'];
16

    
17
  $properties['book'] = array(
18
    'label' => t("Book"),
19
    'type' => 'node',
20
    'description' => t("If part of a book, the book to which this book page belongs."),
21
    'getter callback' => 'entity_metadata_book_get_properties',
22
  );
23
  $properties['book_ancestors'] = array(
24
    'label' => t("Book ancestors"),
25
    'type' => 'list<node>',
26
    'computed' => TRUE,
27
    'description' => t("If part of a book, a list of all book pages upwards in the book hierarchy."),
28
    'getter callback' => 'entity_metadata_book_get_properties',
29
  );
30
}