html.vars.php in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 7.3
File
themes/vartheme/templates/system/html.vars.phpView source
<?php
/**
* Implements hook_preprocess_html().
*
* @see html.tpl.php
* Most of this code is from zen theme, written by JohnAlbin.
*/
function vartheme_preprocess_html(&$variables, $hook) {
global $theme_path, $base_path, $theme;
// Attributes for html element.
$variables['html_attributes_array'] = array(
'lang' => $variables['language']->language,
'dir' => $variables['language']->dir,
'class' => array(
drupal_html_class($theme),
),
);
// Send X-UA-Compatible HTTP header to force IE to use the most recent
// rendering engine or use Chrome's frame rendering engine if available.
// This also prevents the IE compatibility mode button to appear when using
// conditional classes on the html tag.
if (is_null(drupal_get_http_header('X-UA-Compatible'))) {
drupal_add_http_header('X-UA-Compatible', 'IE=edge,chrome=1');
}
// Return early, so the maintenance page does not call any of the code below.
if ($hook != 'html') {
return;
}
// Add clearfix to body to make sure all of it is content are wrapped inside it.
$variables['classes_array'][] = 'clearfix';
// Serialize RDF Namespaces into an RDFa 1.1 prefix attribute.
if ($variables['rdf_namespaces']) {
$prefixes = array();
foreach (explode("\n ", ltrim($variables['rdf_namespaces'])) as $namespace) {
// Remove xlmns: and ending quote and fix prefix formatting.
$prefixes[] = str_replace('="', ': ', substr($namespace, 6, -1));
}
$variables['rdf_namespaces'] = ' prefix="' . implode(' ', $prefixes) . '"';
}
}
/**
* Implements hook_preprocess_html().
*
* @see html.tpl.php
*/
function vartheme_process_html(&$variables, $hook) {
// Flatten out html_attributes.
$variables['html_attributes'] = drupal_attributes($variables['html_attributes_array']);
}
Functions
Name![]() |
Description |
---|---|
vartheme_preprocess_html | Implements hook_preprocess_html(). |
vartheme_process_html | Implements hook_preprocess_html(). |