You are here

function themekey_complete_path in ThemeKey 7

Same name and namespace in other branches
  1. 6.4 themekey_build.inc \themekey_complete_path()
  2. 6.2 themekey_build.inc \themekey_complete_path()
  3. 6.3 themekey_build.inc \themekey_complete_path()
  4. 7.3 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 injects them back into the value of the rule. This format is needed by ThemeKey's administration interface.

It's the counterpart of these functions:

Parameters

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

See also

themekey_prepare_path()

themekey_prepare_custom_path()

themekey_load_rules()

3 calls to themekey_complete_path()
themekey_features_load_rule_childs in ./themekey_features.module
Loads current ThemeKey Rule Chain as array.
themekey_load_rules in ./themekey_build.inc
Loads all ThemeKey Rules from the database. Therefore, it uses recursion to build the rule chains.
themekey_rule_get in ./themekey_build.inc
Loads ThemeKey rule from database.

File

./themekey_build.inc, line 169
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);
  }
}