function om_system_preprocess_page in OM Tools 6
Same name and namespace in other branches
- 6.2 tools/system/system.inc \om_system_preprocess_page()
Override or insert om variables into the templates.
File
- tools/
system/ system.inc, line 74 - System Utility
Code
function om_system_preprocess_page(&$vars) {
if (variable_get('om_tools_system_switch', 0)) {
$maxsizes = '1600, 1440, 1280, 1120, 960, 800, 640, 480';
$theme_path = path_to_theme();
$theme_path_default = variable_get('om_tools_mediaqueries_path', $theme_path);
$styles = explode(',', variable_get('om_tools_mediaqueries_maxsizes', $maxsizes));
foreach ($styles as $key => $style) {
if (is_numeric($style)) {
// This is put to $head instead of $styles to avoide collision with OM $styles aggregation
$vars['head'] .= '<link rel="stylesheet" type="text/css" href="' . base_path() . $theme_path_default . '/style' . trim($style) . '.css" media="only screen and (max-width: ' . $style . 'px)" />';
}
}
}
//dsm($vars);
}