From 805b61328629813aad77c2e0f935e31cb381e500 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Wed, 14 Dec 2011 15:59:54 +0000 Subject: added the first view files of the mobile version --- h-source/Application/Include/version.php | 33 ++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'h-source/Application/Include') diff --git a/h-source/Application/Include/version.php b/h-source/Application/Include/version.php index 49afa96..d0e3928 100644 --- a/h-source/Application/Include/version.php +++ b/h-source/Application/Include/version.php @@ -24,11 +24,40 @@ if (!defined('EG')) die('Direct access not allowed!'); class Version { - public static function is() + public static $mobileAllowed = array( + 'home,index', + ); + + //get the subfolder of the Views folder where to look for the view files + public static function getViewSubfolder() + { + $type = self::get(); + + if ($type === 'mobile') + { + return 'Mobile'; + } + return 'Desktop'; + } + + //get the type of version: desktop or mobile + public static function get() { - return false; + if (isset($_COOKIE['version'])) + { + if (strcmp($_COOKIE['version'],'mobile') === 0) + { + return 'mobile'; + } + else if (strcmp($_COOKIE['version'],'desktop') === 0) + { + return 'desktop'; + } + } + return 'desktop'; } + //set the version public static function set() { if (isset($_GET['version'])) -- cgit v1.2.3