aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-02 17:03:54 -0700
committerfriendica <info@friendica.com>2013-09-02 17:03:54 -0700
commit6ad6aa307fa8cf6dc8635edf8650532aaf068870 (patch)
treefb38512ac35a88541769232910a382c5ec3249e9 /boot.php
parentdfa2efcecf976783c4fa06f4301a851eca8e97c6 (diff)
parent02fe2d488155b0907c950eb3118c523940c6827f (diff)
downloadvolse-hubzilla-6ad6aa307fa8cf6dc8635edf8650532aaf068870.tar.gz
volse-hubzilla-6ad6aa307fa8cf6dc8635edf8650532aaf068870.tar.bz2
volse-hubzilla-6ad6aa307fa8cf6dc8635edf8650532aaf068870.zip
Merge pull request #108 from cvogeley/master
More mobile theme fixes
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php28
1 files changed, 17 insertions, 11 deletions
diff --git a/boot.php b/boot.php
index e1c2503ff..3c340da90 100755
--- a/boot.php
+++ b/boot.php
@@ -2025,25 +2025,28 @@ function current_theme(){
$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(isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) {
- $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
- $theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
+ $system_theme = $standard_system_theme;
+ $theme_name = $standard_theme_name;
}
else {
$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);
- if($theme_name === '---') {
+ if($theme_name === '' || $theme_name === '---' ) {
// user has selected to have the mobile theme be the same as the normal one
- $system_theme = '';
- $theme_name = '';
+ $system_theme = $standard_system_theme;
+ $theme_name = $standard_theme_name;
}
}
}
else {
- $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : '');
- $theme_name = ((isset($_SESSION) && x($_SESSION,'theme')) ? $_SESSION['theme'] : $system_theme);
+ $system_theme = $standard_system_theme;
+ $theme_name = $standard_theme_name;
if($page_theme)
$theme_name = $page_theme;
@@ -2464,10 +2467,13 @@ function construct_page(&$a) {
else {
$link = $a->get_baseurl() . '/toggle_mobile?f=&off=1&address=' . curPageURL();
}
- $a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
- '$toggle_link' => $link,
- '$toggle_text' => t('toggle mobile')
- ));
+ if ((isset($_SESSION) && $_SESSION['mobile_theme'] !='' && $_SESSION['mobile_theme'] !='---' ) ||
+ (isset($a->config['system']['mobile_theme']) && !isset($_SESSION['mobile_theme']))) {
+ $a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array(
+ '$toggle_link' => $link,
+ '$toggle_text' => t('toggle mobile')
+ ));
+ }
}
$page = $a->page;