function rb_theme_preprocess_html in Rules Bonus Pack 7
Implement hook_preprocess_html().
File
- ./
rb_theme.module, line 11 - A necessary file for letting Drupal know this is a module. All functionality goes into rb_theme.rules.inc.
Code
function rb_theme_preprocess_html(&$vars) {
// Check if the rule has set the static variable
if (rb_theme_static('head_title')) {
$vars['head_title'] = rb_theme_static('head_title');
}
if (rb_theme_static('classes_array')) {
// Split the variable to an array on new lines
$classes = explode("\n", rb_theme_static('classes_array'));
foreach ($classes as $class) {
// Add each class to the classes_array, sanitze the class using
// drupal_html_class
$vars['classes_array'][] = drupal_html_class($class);
}
}
}