You are here

function themekey_rule_get in ThemeKey 6.2

Same name and namespace in other branches
  1. 6.4 themekey_build.inc \themekey_rule_get()
  2. 6.3 themekey_build.inc \themekey_rule_get()
  3. 7.3 themekey_build.inc \themekey_rule_get()
  4. 7 themekey_build.inc \themekey_rule_get()
  5. 7.2 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

1 call to themekey_rule_get()
themekey_format_rule_as_string in ./themekey_base.inc

File

./themekey_build.inc, line 389
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_query('SELECT * FROM {themekey_properties} WHERE id = %d', $id)) {
    if ($item = db_fetch_array($result)) {
      if ('drupal:path' == $item['property']) {
        themekey_complete_path($item);
      }
      return $item;
    }
  }
  return NULL;
}