From e8acdb31bcaa60dce6be4b59535e5cdf528942d1 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Wed, 12 Sep 2012 21:35:51 -0600 Subject: [PATCH] add mobile toggle to frost mobile --- boot.php | 33 +++++++++++++++++++++---- mod/toggle_mobile.php | 17 +++++++++++++ view/theme/frost-mobile/default.php | 8 +++++- view/theme/frost-mobile/login-style.css | 6 +++++ view/theme/frost-mobile/style.css | 4 +-- 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 mod/toggle_mobile.php diff --git a/boot.php b/boot.php index c0a7a0e298..7581934509 100644 --- a/boot.php +++ b/boot.php @@ -1511,14 +1511,20 @@ if(! function_exists('current_theme')) { $is_mobile = $mobile_detect->isMobile() || $mobile_detect->isTablet(); if($is_mobile) { - $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 === '---') { - // user has selected to have the mobile theme be the same as the normal one + if(isset($_SESSION['show-mobile']) && !$_SESSION['show-mobile']) { $system_theme = ''; $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 === '---') { + // user has selected to have the mobile theme be the same as the normal one + $system_theme = ''; + $theme_name = ''; + } + } } if(!$is_mobile || ($system_theme === '' && $theme_name === '')) { $system_theme = ((isset($a->config['system']['theme'])) ? $a->config['system']['theme'] : ''); @@ -1760,3 +1766,20 @@ function build_querystring($params, $name=null) { } return $ret; } + +/** +* Returns the complete URL of the current page, e.g.: http(s)://something.com/network +* +* Taken from http://webcheatsheet.com/php/get_current_page_url.php +*/ +function curPageURL() { + $pageURL = 'http'; + if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} + $pageURL .= "://"; + if ($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") { + $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; + } else { + $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; + } + return $pageURL; +} diff --git a/mod/toggle_mobile.php b/mod/toggle_mobile.php new file mode 100644 index 0000000000..00991e44ca --- /dev/null +++ b/mod/toggle_mobile.php @@ -0,0 +1,17 @@ +get_baseurl(); + + goaway($address); +} + diff --git a/view/theme/frost-mobile/default.php b/view/theme/frost-mobile/default.php index d076c10f07..c2a20255f6 100644 --- a/view/theme/frost-mobile/default.php +++ b/view/theme/frost-mobile/default.php @@ -21,6 +21,9 @@
+
@@ -33,7 +36,10 @@
module === 'contacts') && x($page,'aside')) echo $page['aside']; ?> - + diff --git a/view/theme/frost-mobile/login-style.css b/view/theme/frost-mobile/login-style.css index 5c07aba772..37661cfbc7 100644 --- a/view/theme/frost-mobile/login-style.css +++ b/view/theme/frost-mobile/login-style.css @@ -152,3 +152,9 @@ div.section-wrapper { #login-submit-wrapper { text-align: center; } + +footer { + text-align: center; + padding-top: 3em; + padding-bottom: 1em; +} diff --git a/view/theme/frost-mobile/style.css b/view/theme/frost-mobile/style.css index ef08bcb3f1..c58a32df66 100644 --- a/view/theme/frost-mobile/style.css +++ b/view/theme/frost-mobile/style.css @@ -393,8 +393,8 @@ section { /* footer */ footer { - display: none; - + text-align: center; + padding-bottom: 1em; } .birthday-today, .event-today {