You are here

function themekey_redirect_rule_set in ThemeKey 7.3

Stores ThemeKey rules in database. It creates a new dataset or updates an existing one.

Parameters

$item: reference to an associative array containing a ThemeKey rule structure:

  • id
  • property
  • operator
  • value
  • weight
  • theme
  • enabled
  • wildcards
  • parent

$module: name of the module that sets the item

Throws

ThemeKeyRuleConflictException

1 string reference to 'themekey_redirect_rule_set'
themekey_redirect_rule_chain_form_submit in themekey_redirect/themekey_redirect_admin.inc
Form submission handler for themekey_rule_chain_form().

File

themekey_redirect/themekey_redirect_build.inc, line 72
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_redirect_rule_set(&$item, $module = 'themekey_redirect') {
  themekey_abstract_rule_set('themekey_redirect_rules', $item, $module);
  db_update('themekey_redirect_rules')
    ->fields(array(
    'append_path' => $item['append_path'],
  ))
    ->condition('id', $item['id'])
    ->execute();
}