/** * * @return boolean */ public function isMobile() { return $this->browser->isTablet() && $this->browser->isMobile(); }
<?php /** * @package JomSocial * @subpackage Core * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved! * @license GNU/GPL, see LICENSE.php */ defined('_JEXEC') or die('Restricted access'); jimport('joomla.application.component.view'); CFactory::load('helpers', 'template'); require_once COMMUNITY_COM_PATH . DS . 'libraries' . DS . 'browser.php'; $browser = CBrowser::getInstanceStatic(); $screen = 'desktop'; if ($browser->isMobile()) { // Determine whether to display // desktop or mobile screen. $mySess = JFactory::getSession(); // If a screen was given from the URL, // it means we are switching screens, // so we'll save preferred screen to session data. $screen = JRequest::getVar('screen', null, 'GET'); if (!empty($screen)) { $mySess->set('screen', $screen); } // Get preferred screen from session data $screen = $mySess->get('screen'); // If preferred screen was not found in session data, // get it from user preferences. if (empty($screen)) { $my = CFactory::getUser();
<?php /** * @package JomSocial * @subpackage Core * @copyright (C) 2008 by Slashes & Dots Sdn Bhd - All rights reserved! * @license GNU/GPL, see LICENSE.php */ defined('_JEXEC') or die('Restricted access'); jimport('joomla.application.component.view'); CFactory::load('helpers', 'template'); require_once COMMUNITY_COM_PATH . DS . 'libraries' . DS . 'browser.php'; $browser = CBrowser::getInstance(); $screen = 'desktop'; if ($browser->_mobile) { // Determine whether to display // desktop or mobile screen. $mySess = JFactory::getSession(); // If a screen was given from the URL, // it means we are switching screens, // so we'll save preferred screen to session data. $screen = JRequest::getVar('screen', null, 'GET'); if (!empty($screen)) { $mySess->set('screen', $screen); } // Get preferred screen from session data $screen = $mySess->get('screen'); // If preferred screen was not found in session data, // get it from user preferences. if (empty($screen)) { $my = CFactory::getUser();