mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
#18947649 : still modifying
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7518 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f38fe6bee1
commit
99e0e80620
1 changed files with 28 additions and 3 deletions
|
|
@ -1,13 +1,38 @@
|
|||
<?php
|
||||
|
||||
class Mobile {
|
||||
var $ismobile = null;
|
||||
|
||||
function &getInstance() {
|
||||
static $theInstance;
|
||||
if(!isset($theInstance)) $theInstance = new Mobile();
|
||||
return $theInstance;
|
||||
}
|
||||
|
||||
function isFromMobilePhone() {
|
||||
if(Context::get('full_browse') || $_COOKIE["FullBrowse"])
|
||||
$oMobile =& Mobile::getInstance();
|
||||
return $oMobile->_isFromMobilePhone();
|
||||
}
|
||||
|
||||
function _isFromMobilePhone() {
|
||||
if(isset($this->ismobile)) return $this->ismobile;
|
||||
$db_info = Context::getDBInfo();
|
||||
if($db_info->use_mobile_view != "Y" || Context::get('full_browse') || $_COOKIE["FullBrowse"])
|
||||
{
|
||||
return false;
|
||||
$this->ismobile = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ismobile = Context::get('mobile') || preg_match('/(iPod|iPhone|Android|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT']);
|
||||
}
|
||||
|
||||
return Context::get('mobile') || preg_match('/(iPod|iPhone|Android|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT']);
|
||||
return $this->ismobile;
|
||||
}
|
||||
|
||||
function setMobile($ismobile)
|
||||
{
|
||||
$oMobile =& Mobile::getInstance();
|
||||
$oMobile->ismobile = $ismobile;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue