You are here

function themekey_format_rule_as_string in ThemeKey 7

Same name and namespace in other branches
  1. 6.4 themekey_base.inc \themekey_format_rule_as_string()
  2. 6.2 themekey_base.inc \themekey_format_rule_as_string()
  3. 6.3 themekey_base.inc \themekey_format_rule_as_string()
  4. 7.3 themekey_base.inc \themekey_format_rule_as_string()
  5. 7.2 themekey_base.inc \themekey_format_rule_as_string()

@todo Please document this function.

See also

http://drupal.org/node/1354

3 calls to themekey_format_rule_as_string()
themekey_admin_delete_rule_confirm in ./themekey_admin.inc
Menu callback -- ask for confirmation of ThemeKey rule deletion
themekey_features_load_rule_childs in ./themekey_features.module
Loads current ThemeKey Rule Chain as array.
themekey_match_rule_childs in ./themekey_base.inc
Helper function of

File

./themekey_base.inc, line 562
The functions in this file are the back end of ThemeKey.

Code

function themekey_format_rule_as_string($themekey_property_id) {
  module_load_include('inc', 'themekey', 'themekey_build');

  // fallback title
  $title = $themekey_property_id;
  $item = themekey_rule_get($themekey_property_id);
  if (!empty($item)) {
    $properties = variable_get('themekey_properties', array());
    if (!in_array($item->property, $properties)) {
      $item->wildcard = $item->property;
      $item->property = 'drupal:path:wildcard';
    }
    $title = '"' . $item->property . ' ';
    if (!empty($item->wildcard)) {
      $title .= $item->wildcard . ' ';
    }
    $title .= $item->operator . ' ' . $item->value . ' >>> ' . $item->theme . '"';
  }
  return $title;
}