You are here

function themekey_book_themekey_properties in ThemeKey 6.2

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.3 modules/themekey.book.inc \themekey_book_themekey_properties()
  4. 7.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 module ThemeKey:

  • book:bid
  • book:has_children

Return value

array of themekey properties and mapping functions

File

modules/themekey.book.inc, line 19
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('admin/content/book', 'admin/content/book'),
    )),
    'validator' => 'themekey_validator_ctype_digit',
  );
  $attributes['book:has_children'] = array(
    'description' => t('Book: Has Children - Wheter the book has child pages or not. Possible values are "0" for false and "1" for true.'),
    'validator' => 'themekey_validator_nummeric_boolean',
  );
  $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,
  );
}