function mobile_tools_html_head_alter in Mobile Tools 7.2
Same name and namespace in other branches
- 7.3 mobile_tools.module \mobile_tools_html_head_alter()
Implements hook_html_head_alter().
File
- ./
mobile_tools.module, line 151 - Functionality to ease the creation of mixed device environments.
Code
function mobile_tools_html_head_alter(&$head_elements) {
$site = mobile_tools_get_active_device_group();
if (variable_get('mobile_tools_add_header', 1) && $site == 'mobile') {
// Add the viewport settings
$head_elements['viewport'] = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'user-scalable=no, width=device-width, maximum-scale=1.0',
),
);
// Add the iOS web app flag
$head_elements['apple_mobile_web_app_capable'] = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'apple-mobile-web-app-capable',
'content' => 'yes',
),
);
// Add the handheld flag
$head_elements['HandheldFriendly'] = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'HandheldFriendly',
'content' => 'true',
),
);
}
}