Show
Ignore:
Timestamp:
02/15/12 17:52:24 (15 months ago)
Author:
patdenice
Message:

feature:2577
Add functionnality in core files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r12922 r13172  
    193193else 
    194194{ // Classic template 
    195   $template = new Template(PHPWG_ROOT_PATH.'themes', $user['theme'] ); 
     195  $theme = $user['theme']; 
     196 
     197  if (!isset($_SESSION['is_mobile'])) 
     198  { 
     199    include_once(PHPWG_ROOT_PATH.'include/mdetect.php'); 
     200    $uagent_obj = new uagent_info(); 
     201    if ($_SESSION['is_mobile'] = $uagent_obj->DetectMobileLong()) 
     202    { 
     203      $_SESSION['use_mobile_theme'] = !empty($conf['mobile_theme']); 
     204    } 
     205  } 
     206  if ($_SESSION['is_mobile']) 
     207  { 
     208    if (isset($_REQUEST['mobile'])) 
     209    { 
     210      $_SESSION['use_mobile_theme'] = get_boolean($_REQUEST['mobile']); 
     211    } 
     212    if ($_SESSION['use_mobile_theme']) 
     213    { 
     214      $theme = $conf['mobile_theme']; 
     215    } 
     216  } 
     217  $template = new Template(PHPWG_ROOT_PATH.'themes', $theme ); 
    196218} 
    197219