Exemple #1
0
 /**
  * Constructor
  *
  * @param $file string the file name you want to load
  */
 public function __construct($file = null)
 {
     // $file can also be a view object. If it is an object, assign to internal object
     if (is_object($file)) {
         $this->_internalView = $file;
     } else {
         $this->file = $file;
     }
     @ini_set('short_open_tag', 'On');
     // Extract template parameters for template providers.
     if (!isset($this->params) && empty($this->params)) {
         $this->params = $this->getTemplateParams();
     }
     $this->browser = CBrowser::getInstance();
 }
Exemple #2
0
<?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();