function updateUserMarkup()
 {
     if (isset($_GET['template']) || isset($_GET['templateStyle'])) {
         return;
     }
     $MobileJoomla_Device =& MobileJoomla::getDevice();
     $markup = $MobileJoomla_Device['markup'];
     $app = JFactory::getApplication();
     $app->setUserState('mobilejoomla.markup', $markup);
     $MobileJoomla_Settings =& MobileJoomla::getConfig();
     $desktop_uri = parse_url($MobileJoomla_Settings['desktop_url']);
     $cookie_domain = $desktop_uri['host'];
     if (substr($cookie_domain, 0, 4) == 'www.') {
         $cookie_domain = substr($cookie_domain, 4);
     }
     $cookie_domain = '.' . $cookie_domain;
     //		$http_host = $_SERVER['HTTP_HOST'];
     //		if(substr($http_host, -strlen($cookie_domain))==$cookie_domain)
     //			$cookie_domain = $http_host;
     if ($markup != $MobileJoomla_Device['default_markup']) {
         setcookie('mjmarkup', $markup ? $markup : 'desktop', time() + 365 * 24 * 60 * 60, '/', $cookie_domain);
     } elseif (isset($_COOKIE['mjmarkup'])) {
         setcookie('mjmarkup', '', time() - 365 * 24 * 60 * 60, '/', $cookie_domain);
     }
 }
Beispiel #2
0
 * ###DESC###
 * ###URL###
 *
 * @version		###VERSION###
 * @license		###LICENSE###
 * @copyright	###COPYRIGHT###
 * @date		###DATE###
 */
defined('_JEXEC') or die('Restricted access');
defined('_MJ') or die('Incorrect usage of Mobile Joomla.');
//load language file (to allow users to rename template)
MobileJoomla::loadLanguageFile('tpl_mobile_iphone');
$MobileJoomla =& MobileJoomla::getInstance();
$base = $this->baseurl . '/templates/' . $this->template;
$home = $this->baseurl . '/';
$MobileJoomla_Device =& MobileJoomla::getDevice();
if ($MobileJoomla_Device['markup'] != $MobileJoomla_Device['default_markup']) {
    $home .= '?device=' . $MobileJoomla_Device['markup'];
}
?>
<!doctype html>
<html<?php 
echo $MobileJoomla->getXmlnsString();
?>
>
<head>
	<meta http-equiv="Content-Type" content="<?php 
echo $MobileJoomla->getContentString();
?>
"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
 static function getCacheKey()
 {
     $MobileJoomla_Device =& MobileJoomla::getDevice();
     $cachekey = array();
     $cachekey[] = $MobileJoomla_Device['markup'];
     $cachekey[] = $MobileJoomla_Device['default_markup'];
     $cachekey[] = $MobileJoomla_Device['screenwidth'];
     $cachekey[] = $MobileJoomla_Device['screenheight'];
     $cachekey[] = isset($MobileJoomla_Device['pixelratio']) ? $MobileJoomla_Device['pixelratio'] : '1';
     $imageformats = $MobileJoomla_Device['imageformats'];
     if (is_array($imageformats)) {
         sort($imageformats);
         $cachekey[] = implode('', $imageformats);
     }
     return implode('_', $cachekey);
 }