You are here

function themekey_book_themekey_properties in ThemeKey 7.3

Same name and namespace in other branches
  1. 6.4 modules/themekey.book.inc \themekey_book_themekey_properties()
  2. 6 modules/themekey.book.inc \themekey_book_themekey_properties()
  3. 6.2 modules/themekey.book.inc \themekey_book_themekey_properties()
  4. 6.3 modules/themekey.book.inc \themekey_book_themekey_properties()
  5. 7 modules/themekey.book.inc \themekey_book_themekey_properties()
  6. 7.2 modules/themekey.book.inc \themekey_book_themekey_properties()

Implements hook_themekey_properties().

Provides additional properties for the Themekey module:

  • book:bid
  • book:has_children

Return value

array of themekey properties and mapping functions

File

modules/themekey.book.inc, line 25
Provides some comment attributes as ThemeKey properties.

Code

function themekey_book_themekey_properties() {

  // Attributes for properties
  $attributes = array();
  $attributes['book:bid'] = array(
    'description' => t('Book: ID - The id of the book (bid). This is the node id (nid) of the top book page. See !link for your books', array(
      '!link' => l(t('!path', array(
        '!path' => 'admin/content/book',
      )), 'admin/content/book'),
    )),
    'validator' => 'themekey_validator_ctype_digit',
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
  );
  $attributes['book:has_children'] = array(
    'description' => t('Book: Has Children - Whether the book has child pages or not. Possible values are "0" for false and "1" for true.'),
    'validator' => 'themekey_validator_numeric_boolean',
    'page cache' => THEMEKEY_PAGECACHE_SUPPORTED,
  );
  $maps = array();
  $maps[] = array(
    'src' => 'node:nid',
    'dst' => 'book:bid',
    'callback' => 'themekey_book_nid2bid',
  );
  $maps[] = array(
    'src' => 'node:nid',
    'dst' => 'book:has_children',
    'callback' => 'themekey_book_nid2has_children',
  );
  return array(
    'attributes' => $attributes,
    'maps' => $maps,
  );
}