function themekey_abstract_format_rule_as_string in ThemeKey 7.3
3 calls to themekey_abstract_format_rule_as_string()
- themekey_css_format_rule_as_string in themekey_css/
themekey_css.module - themekey_format_rule_as_string in ./
themekey_base.inc - @todo Please document this function.
- themekey_redirect_format_rule_as_string in themekey_redirect/
themekey_redirect.module
File
- ./
themekey_base.inc, line 587 - The functions in this file are the back end of ThemeKey.
Code
function themekey_abstract_format_rule_as_string($themekey_property_id, $options) {
// fallback title
$title = $themekey_property_id;
$item = $options['rule'];
if (!empty($item)) {
$properties = variable_get('themekey_properties', array());
if (!in_array($item->property, $properties)) {
$attributes = variable_get('themekey_attributes', array());
if (!array_key_exists($item->property, $attributes)) {
$item->wildcard = $item->property;
$item->property = 'drupal:path:wildcard';
}
elseif (!empty($attributes[$item->property]['static'])) {
$item->theme = 'triggered';
}
}
$title = '"' . $item->property . ' ';
if (!empty($item->wildcard)) {
$title .= $item->wildcard . ' ';
}
$title .= $item->operator . ' ' . $item->value . ' >>> ' . $item->theme . '"';
}
return $title;
}