aboutsummaryrefslogtreecommitdiffstats
path: root/include/common.inc.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2012-02-15 16:52:24 +0000
committerpatdenice <patdenice@piwigo.org>2012-02-15 16:52:24 +0000
commit46864ea0b6c61c39e126e09a7d55144c1a7e11f3 (patch)
treee19720dfdb4bee31419831f2b4f6be656d44d0e9 /include/common.inc.php
parent97132d9c6f54cf8f3253dec6c5b77b3e0678483b (diff)
feature:2577
Add functionnality in core files. git-svn-id: http://piwigo.org/svn/trunk@13172 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/common.inc.php')
-rw-r--r--include/common.inc.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index 73d2dadb9..158dbf1ef 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -192,7 +192,29 @@ if (defined('IN_ADMIN') and IN_ADMIN )
}
else
{ // Classic template
- $template = new Template(PHPWG_ROOT_PATH.'themes', $user['theme'] );
+ $theme = $user['theme'];
+
+ if (!isset($_SESSION['is_mobile']))
+ {
+ include_once(PHPWG_ROOT_PATH.'include/mdetect.php');
+ $uagent_obj = new uagent_info();
+ if ($_SESSION['is_mobile'] = $uagent_obj->DetectMobileLong())
+ {
+ $_SESSION['use_mobile_theme'] = !empty($conf['mobile_theme']);
+ }
+ }
+ if ($_SESSION['is_mobile'])
+ {
+ if (isset($_REQUEST['mobile']))
+ {
+ $_SESSION['use_mobile_theme'] = get_boolean($_REQUEST['mobile']);
+ }
+ if ($_SESSION['use_mobile_theme'])
+ {
+ $theme = $conf['mobile_theme'];
+ }
+ }
+ $template = new Template(PHPWG_ROOT_PATH.'themes', $theme );
}
if ( !isset($conf['no_photo_yet']) )