Merge pull request #108 from cvogeley/master

More mobile theme fixes
This commit is contained in:
friendica 2013-09-02 17:03:54 -07:00
commit 6ad6aa307f
2 changed files with 18 additions and 11 deletions

View File

@ -2025,25 +2025,28 @@ function current_theme(){
$is_mobile = $a->is_mobile || $a->is_tablet; $is_mobile = $a->is_mobile || $a->is_tablet;
$standard_system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
$standard_theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $standard_system_theme);
if($is_mobile) { if($is_mobile) {
if(isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) { if(isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) {
$system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : ''); $system_theme = $standard_system_theme;
$theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme); $theme_name = $standard_theme_name;
} }
else { else {
$system_theme = ((isset($a->config['system']['mobile_theme'])) ? $a->config['system']['mobile_theme'] : ''); $system_theme = ((isset($a->config['system']['mobile_theme'])) ? $a->config['system']['mobile_theme'] : '');
$theme_name = ((isset($_SESSION) && x($_SESSION,'mobile_theme')) ? $_SESSION['mobile_theme'] : $system_theme); $theme_name = ((isset($_SESSION) && x($_SESSION,'mobile_theme')) ? $_SESSION['mobile_theme'] : $system_theme);
if($theme_name === '---') { if($theme_name === '' || $theme_name === '---' ) {
// user has selected to have the mobile theme be the same as the normal one // user has selected to have the mobile theme be the same as the normal one
$system_theme = ''; $system_theme = $standard_system_theme;
$theme_name = ''; $theme_name = $standard_theme_name;
} }
} }
} }
else { else {
$system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : ''); $system_theme = $standard_system_theme;
$theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme); $theme_name = $standard_theme_name;
if($page_theme) if($page_theme)
$theme_name = $page_theme; $theme_name = $page_theme;
@ -2464,10 +2467,13 @@ function construct_page(&$a) {
else { else {
$link = $a->get_baseurl() . '/toggle_mobile?f=&off=1&address=' . curPageURL(); $link = $a->get_baseurl() . '/toggle_mobile?f=&off=1&address=' . curPageURL();
} }
$a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array( if ((isset($_SESSION) && $_SESSION['mobile_theme'] !='' && $_SESSION['mobile_theme'] !='---' ) ||
'$toggle_link' => $link, (isset($a->config['system']['mobile_theme']) && !isset($_SESSION['mobile_theme']))) {
'$toggle_text' => t('toggle mobile') $a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
)); '$toggle_link' => $link,
'$toggle_text' => t('toggle mobile')
));
}
} }
$page = $a->page; $page = $a->page;

View File

@ -15,6 +15,7 @@ function nuke_session() {
unset($_SESSION['cid']); unset($_SESSION['cid']);
unset($_SESSION['theme']); unset($_SESSION['theme']);
unset($_SESSION['mobile_theme']); unset($_SESSION['mobile_theme']);
unset($_SESSION['show_mobile']);
unset($_SESSION['page_flags']); unset($_SESSION['page_flags']);
unset($_SESSION['submanage']); unset($_SESSION['submanage']);
unset($_SESSION['my_url']); unset($_SESSION['my_url']);