You are here

function themekey_rule_get in ThemeKey 7.2

Same name and namespace in other branches
  1. 6.4 themekey_build.inc \themekey_rule_get()
  2. 6.2 themekey_build.inc \themekey_rule_get()
  3. 6.3 themekey_build.inc \themekey_rule_get()
  4. 7.3 themekey_build.inc \themekey_rule_get()
  5. 7 themekey_build.inc \themekey_rule_get()

Loads ThemeKey rule from database.

Parameters

$id: id of the rule to be loaded from database

Return value

the rule as associative array or NULL

2 calls to themekey_rule_get()
themekey_features_load_rule_childs in ./themekey_features.module
Loads current ThemeKey Rule Chain as array. The difference compared to themekey_load_rules() is, that database stuff like ids, parent ids and weights are stripped for export.
themekey_format_rule_as_string in ./themekey_base.inc
@todo Please document this function.

File

./themekey_build.inc, line 471
The functions in this file are the back end of ThemeKey which should be used only if you configure something, but not when ThemeKey switches themes.

Code

function themekey_rule_get($id) {
  if ($result = db_select('themekey_properties', 'tp')
    ->fields('tp')
    ->condition('id', $id)
    ->execute()) {
    foreach ($result as $item) {
      if ('drupal:path' == $item->property) {
        themekey_complete_path($item);
      }
      return $item;
    }
  }
  return NULL;
}