Changeset 13172 for trunk/include


Ignore:
Timestamp:
Feb 15, 2012, 5:52:24 PM (12 years ago)
Author:
patdenice
Message:

feature:2577
Add functionnality in core files.

Location:
trunk/include
Files:
1 added
1 edited

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
Note: See TracChangeset for help on using the changeset viewer.