dir == 'ltr') {
$left = 'left';
$right = 'right';
}
if ($vars['language']->dir == 'rtl') {
$left = 'right';
$right = 'left';
}
if ($method == '0') {
$styles = array();
$styles[] = '#content-column{float:none;}';
$styles[] = '#sidebar-first,#sidebar-last{float:none;margin:0;width:auto;}';
}
if ($method == '1') {
$styles = array();
$styles[] = '#content-column{float:none;}';
$styles[] = '.two-sidebars .content-inner{margin-'. $left .':0; margin-'. $right .':0;}';
$styles[] = '.sidebar-first .content-inner{margin-'. $left .':0; margin-'. $right .':0;}';
$styles[] = '.sidebar-last .content-inner{margin-'. $right .':0; margin-'. $left .':0;}';
$styles[] = '#sidebar-first{width:'. $sidebar_first_width .'%;margin-'. $left .':0;}';
$styles[] = '#sidebar-last{width:'. $sidebar_last_width .'%;margin-'. $left .':0;}';
}
if ($method == '2') {
$push_right = $sidebar_last_width;
$push_left = $sidebar_first_width;
$pull_right = $sidebar_last_width;
$styles = array();
$styles[] = '.two-sidebars .content-inner{margin-'. $left .':'. $push_left .'%; margin-'. $right .':'. $push_right .'%;}';
$styles[] = '.sidebar-first .content-inner{margin-'. $left .':'. $push_left .'%; margin-'. $right .':0;}';
$styles[] = '.sidebar-last .content-inner{margin-'. $right .':'. $push_right .'%; margin-'. $left .':0;}';
$styles[] = '#sidebar-first{width:'. $sidebar_first_width .'%;margin-'. $left .':-100%;}';
$styles[] = '#sidebar-last{width:'. $sidebar_last_width .'%;margin-'. $left .':-'. $pull_right .'%;}';
}
$vars['at_layout'] = implode('', $styles);
if ((theme_get_setting('at_admin_theme') == 1 && arg(0) !== 'admin') || (theme_get_setting('at_admin_theme') == 0)) {
$vars['layout_settings'] = '';
}
if (theme_get_setting('at_admin_theme') == 1 && arg(2) == 'block') {
$vars['layout_settings'] = '';
}
}
$classes = explode(' ', $vars['classes']);
// Add the admin-menu class manually since JavaScript is not availble in the mobile theme.
if (module_exists('admin_menu')) {
$classes[] = 'admin-menu';
}
// $classes is the varaible that will hold the page classes, and is printed in page tpl files.
$vars['classes'] = implode(' ', $classes); // Concatenate with spaces.
// Add mobile meta tags to $head
$head = array($vars['head']);
$head[] = '' . "\n";
$head[] = '' . "\n";
if (!module_exists('touch_icons')) {
$head[] = '' . "\n";
}
$vars['head'] = implode('', $head);
// Unset adaptivetheme core CSS files, AT Mobile uses its own.
$css = drupal_add_css();
$core_styles = array('base.css', 'layout.css', 'admin-build-block.css');
$path_to_core = drupal_get_path('theme', 'adaptivetheme') .'/css/core/';
foreach ($core_styles as $stylesheet) {
$files = $path_to_core . $stylesheet;
unset($css['all']['theme'][$files]);
}
$vars['styles'] = drupal_get_css($css);
}
/**
* Override or insert variables into the node templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered.
*/
/*
function adaptivetheme_mobile_preprocess_node(&$vars, $hook) {
$vars['sample_variable'] = t('Lorem ipsum.');
}
*/
/**
* Override or insert variables into the comment templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered.
*/
/*
function adaptivetheme_mobile_preprocess_comment(&$vars, $hook) {
$vars['sample_variable'] = t('Lorem ipsum.');
}
*/
/**
* Override or insert variables into the block templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered.
*/
/*
function adaptivetheme_mobile_preprocess_block(&$vars, $hook) {
$vars['sample_variable'] = t('Lorem ipsum.');
}
*/