You are here

function themekey_complete_path in ThemeKey 6.2

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

Named wildcards in ThemeKey rules based on property drupal:path are stored as serialized array in the database.

This function deserializes those wildcards and inject them back into the value of the rule. This format is needed by ThemeKey's administartion interface.

It's the counterpart of these functions:

Parameters

$item: reference to an associative array containing a ThemeKey rule as returned directly from database

See also

themekey_prepare_path().

themekey_prepare_custom_path().

themekey_load_rules()

2 calls to themekey_complete_path()
themekey_load_rules in ./themekey_build.inc
Loads all ThemeKey Rules from the database. Therefor it uses a recursion to build the rule chains.
themekey_rule_get in ./themekey_build.inc
Loads ThemeKey rule from database.

File

./themekey_build.inc, line 150
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_complete_path(&$item) {
  $item['wildcards'] = unserialize($item['wildcards']);
  if (count($item['wildcards'])) {
    $parts = explode('/', $item['value'], MENU_MAX_PARTS);
    foreach ($item['wildcards'] as $index => $wildcard) {
      $parts[$index] .= $wildcard;
    }
    $item['value'] = implode('/', $parts);
  }
}