function themekey_debug_properties in ThemeKey 7
Same name and namespace in other branches
- 6.4 themekey_debug.module \themekey_debug_properties()
- 6.2 themekey_debug.module \themekey_debug_properties()
- 6.3 themekey_debug.module \themekey_debug_properties()
- 7.3 themekey_debug.module \themekey_debug_properties()
- 7.2 themekey_debug.module \themekey_debug_properties()
Iterates over all ThemeKey Properties and prints out their current values.
1 call to themekey_debug_properties()
- themekey_custom_theme in ./
themekey.module - Implements hook_custom_theme().
File
- ./
themekey_debug.module, line 30 - Provides a debug mode for module ThemeKey.
Code
function themekey_debug_properties() {
global $user;
if (1 == $user->uid || user_access('themekey_debug_see_messages', $user) || variable_get('themekey_debug_non_admin_users', FALSE)) {
module_load_include('inc', 'themekey', 'themekey_base');
$properties = variable_get('themekey_properties', array());
$message = t('These are the current values of all available ThemeKey Properties. By clicking the value you can start creating a corresponding Theme Switching Rule.') . '<ul>';
$parameters = themekey_get_global_parameters();
foreach ($properties as $property) {
if (!isset($parameters[$property])) {
themekey_property_value($parameters, $property);
}
$value = '';
if (is_null($parameters[$property])) {
if ('drupal:path' == $property) {
$value = '<em>no debug information</em>';
}
else {
$value = '<em>empty</em>';
}
}
else {
$values = is_array($parameters[$property]) ? $parameters[$property] : array(
$parameters[$property],
);
$links = array();
foreach ($values as $single_value) {
// Don't use the l() function at this early stage of bootstrapping because it will initialize the theme engine. Use url() instead.
$links[] = '<a href="' . url('admin/config/user-interface/themekey', array(
'fragment' => 'themekey_new_rule',
'query' => array(
'property' => $property,
'value' => $single_value,
),
)) . '">' . $single_value . '</a>';
}
$value = implode('<br />', $links);
}
$message .= '<li>' . $property . '<br />' . $value . '</li><br />';
}
$message .= '</ul>';
themekey_set_debug_message($message, array(), FALSE);
}
}