adds comments for phpDoc

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10735 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-05-24 07:02:11 +00:00
parent e3f346d44b
commit 262928157c

View file

@ -1,19 +1,43 @@
<?php <?php
/**
* Mobile class
*
* @author NHN (developers@xpressengine.com)
*/
class Mobile { class Mobile {
/**
* Whether mobile or not mobile mode
* @var bool
*/
var $ismobile = null; var $ismobile = null;
/**
* Get instance of Mobile class(for singleton)
*
* @return Mobile
*/
function &getInstance() { function &getInstance() {
static $theInstance; static $theInstance;
if(!isset($theInstance)) $theInstance = new Mobile(); if(!isset($theInstance)) $theInstance = new Mobile();
return $theInstance; return $theInstance;
} }
/**
* Get current mobile mode
*
* @return bool If mobile mode returns true or false
*/
function isFromMobilePhone() { function isFromMobilePhone() {
$oMobile =& Mobile::getInstance(); $oMobile =& Mobile::getInstance();
return $oMobile->_isFromMobilePhone(); return $oMobile->_isFromMobilePhone();
} }
/**
* Get current mobile mode
*
* @return bool
*/
function _isFromMobilePhone() { function _isFromMobilePhone() {
if($this->ismobile !== null) return $this->ismobile; if($this->ismobile !== null) return $this->ismobile;
@ -94,6 +118,11 @@ class Mobile {
return $this->ismobile; return $this->ismobile;
} }
/**
* Detect mobile device by user agent
*
* @return bool Returns true on mobile device or false.
*/
function isMobileCheckByAgent() function isMobileCheckByAgent()
{ {
static $UACheck; static $UACheck;
@ -123,10 +152,11 @@ class Mobile {
return FALSE; return FALSE;
} }
/* /**
* @ brief check if user-agent is a tablet PC as iPad or Andoid tablet. * Check if user-agent is a tablet PC as iPad or Andoid tablet.
* @ return TRUE for tablet, and FALSE for else. *
*/ * @return bool TRUE for tablet, and FALSE for else.
*/
function isMobilePadCheckByAgent() function isMobilePadCheckByAgent()
{ {
static $UACheck; static $UACheck;
@ -167,6 +197,12 @@ class Mobile {
return FALSE; return FALSE;
} }
/**
* Set mobile mode
*
* @param bool $ismobile
* @return void
*/
function setMobile($ismobile) function setMobile($ismobile)
{ {
$oMobile =& Mobile::getInstance(); $oMobile =& Mobile::getInstance();