function themekey_taxonomy_themekey_properties in ThemeKey 6.2
Same name and namespace in other branches
- 6.4 modules/themekey.taxonomy.inc \themekey_taxonomy_themekey_properties()
- 6 modules/themekey.taxonomy.inc \themekey_taxonomy_themekey_properties()
- 6.3 modules/themekey.taxonomy.inc \themekey_taxonomy_themekey_properties()
- 7.3 modules/themekey.taxonomy.inc \themekey_taxonomy_themekey_properties()
- 7 modules/themekey.taxonomy.inc \themekey_taxonomy_themekey_properties()
- 7.2 modules/themekey.taxonomy.inc \themekey_taxonomy_themekey_properties()
Implements hook_themekey_properties().
Provides additional properties for module ThemeKey:
- taxonomy:vid
- taxonomy:tid
- taxonomy:tid_and_childs
Return value
array of themekey properties and mapping functions
File
- modules/
themekey.taxonomy.inc, line 20 - Provides some taxonomy stuff as ThemeKey properties.
Code
function themekey_taxonomy_themekey_properties() {
// Attributes for properties ;)
$attributes = array();
$attributes['taxonomy:vid'] = array(
'description' => t('Taxonomy: Vocabulary - The vocabulary id (vid) of a taxonomy vocabulary. See !link for your vocabularies.', array(
'!link' => l('admin/content/taxonomy', 'admin/content/taxonomy'),
)),
'validator' => 'themekey_validator_ctype_digit',
);
$attributes['taxonomy:tid'] = array(
'description' => t('Taxonomy: Term - The term id (tid) of a taxonomy term.'),
'validator' => 'themekey_validator_ctype_digit',
);
$attributes['taxonomy:tid_and_childs'] = array(
'description' => t('Taxonomy: Term and its childs - The term id (tid) of a taxonomy term. If set all child terms of this term will be used too.'),
'validator' => 'themekey_validator_ctype_digit',
);
// Mapping functions
$maps = array();
$maps[] = array(
'src' => 'taxonomy:tid',
'dst' => 'taxonomy:vid',
'callback' => 'themekey_taxonomy_tid2vid',
);
$maps[] = array(
'src' => 'taxonomy:tid',
'dst' => 'taxonomy:tid_and_childs',
'callback' => 'themekey_taxonomy_tid2tid_and_parents',
);
$maps[] = array(
'src' => 'node:nid',
'dst' => 'taxonomy:vid',
'callback' => 'themekey_taxonomy_nid2vid',
);
$maps[] = array(
'src' => 'node:nid',
'dst' => 'taxonomy:tid',
'callback' => 'themekey_taxonomy_nid2tid',
);
$maps[] = array(
'src' => 'node:nid',
'dst' => 'taxonomy:tid_and_childs',
'callback' => 'themekey_taxonomy_nid2tid_and_parents',
);
return array(
'attributes' => $attributes,
'maps' => $maps,
);
}