本文整理汇总了PHP中Mobile::setMobile方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile::setMobile方法的具体用法?PHP Mobile::setMobile怎么用?PHP Mobile::setMobile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile::setMobile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkGetMobile
public static function checkGetMobile()
{
if (isset($_GET['tomobile'])) {
if ($_GET['tomobile'] == 1) {
Mobile::setMobile(1);
}
if ($_GET['tomobile'] == 0) {
Mobile::setMobile(0);
}
}
}
示例2: __construct
public function __construct($mainClass, $DbSetting, $WebSetting, $timezone, $js, $css, $nameSpaceForApps)
{
parent::__construct($mainClass);
//start session if needed
//if(!$this->is_session_started())
// init whats needed //kalau ga perlu bisa dihilangkan tergantung kebutuhan
//set globals
global $activeLang;
//set the active lang dynamically
$this->activeLang = $activeLang;
$this->setGlobalVariables($WebSetting);
//Initialize DB
// DbChooser::setDBSelected();
//DB setting di access di overwrite spy bisa ada choosernya...
//$skolahDB = DbChooser::getDBSelected();
//$DbSetting = $this->arrDBSetting[$skolahDB];
global $DbSetting;
$this->setDB($DbSetting);
//overwrite global variable to set photopath for different schools
global $photo_path;
global $photo_url;
define('_PHOTOPATH', $photo_path);
define('_PHOTOURL', $photo_url);
//Init Template
$this->setTemplate($WebSetting);
//Init Web Parameter
$this->setParams();
//Init Timezone
$this->setTimezone($timezone);
//Init Mobile Check in untuk menentukan default
$this->setHardwareType();
if ($this->getHardwareType() == "mobile") {
Mobile::setMobile(1);
}
//cek to mobile get
Mobile::checkGetMobile();
//$nameSpaceForApps
$this->setNameSpacesForApps($nameSpaceForApps);
//add css and js
$this->template->addFilesToHead($js);
$this->template->addFilesToHead($css);
//run it
//$this->run();
}
示例3: procRealModule
/**
* Get content of real module
*
* @param string $module module name
* @param string $mid module id
* @param string $skin skin name
* @param string $skinType PC(P) or mobile(M)
* @return string content of real module
*/
private function procRealModule($module, $mid, $skin, $skinType)
{
// if form site design and preview module, find target module
if ($module && !$mid) {
$args = new stdClass();
$args->module = $module;
$output = executeQuery('layout.getOneModuleInstanceByModuleName', $args);
if (!$output->toBool()) {
throw new Exception($output->getMessage());
}
// if there is no module instance, error...
if (!$output->data) {
throw new Exception(Context::getLang('msg_unabled_preview'));
}
$mid = current($output->data)->mid;
} elseif (!$module && !$mid) {
$oModuleModel = getModel('module');
$columnList = array('modules.mid', 'sites.index_module_srl');
$startModuleInfo = $oModuleModel->getSiteInfo(0, $columnList);
$mid = $startModuleInfo->mid;
}
$oModuleHandler = new ModuleHandler('', '', $mid, '', '');
// Adhoc...
$oModuleHandler->act = '';
$oModuleHandler->init();
// Adhoc...
$oModuleHandler->module_info->use_mobile = 'Y';
$oModuleHandler->module_info->is_skin_fix = 'Y';
$oModuleHandler->module_info->is_mskin_fix = 'Y';
if ($skinType == 'M') {
Mobile::setMobile(TRUE);
$oModuleHandler->module_info->mskin = $skin;
} else {
Mobile::setMobile(FALSE);
$oModuleHandler->module_info->skin = $skin;
}
// Proc module
$oModule = $oModuleHandler->procModule();
if (!$oModule->toBool()) {
throw new Exception(Context::getLang('not_support_layout_preview'));
}
// get module html
require_once _XE_PATH_ . "classes/display/HTMLDisplayHandler.php";
$handler = new HTMLDisplayHandler();
return $handler->toDoc($oModule);
}
示例4: procModule
/**
* get a module instance and execute an action
* @return ModuleObject executed module instance
**/
function procModule()
{
$oModuleModel =& getModel('module');
// If error occurred while preparation, return a message instance
if ($this->error) {
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
$oMessageObject =& ModuleHandler::getModuleInstance('message', $type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if ($this->httpStatusCode) {
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
}
return $oMessageObject;
}
// Get action information with conf/module.xml
$xml_info = $oModuleModel->getModuleActionXml($this->module);
// If not installed yet, modify act
if ($this->module == "install") {
if (!$this->act || !$xml_info->action->{$this->act}) {
$this->act = $xml_info->default_index_act;
}
}
// if act exists, find type of the action, if not use default index act
if (!$this->act) {
$this->act = $xml_info->default_index_act;
}
// still no act means error
if (!$this->act) {
$this->error = 'msg_module_is_not_exists';
$this->httpStatusCode = '404';
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
$oMessageObject =& ModuleHandler::getModuleInstance('message', $type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if ($this->httpStatusCode) {
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
}
return $oMessageObject;
}
// get type, kind
$type = $xml_info->action->{$this->act}->type;
$ruleset = $xml_info->action->{$this->act}->ruleset;
$kind = strpos(strtolower($this->act), 'admin') !== false ? 'admin' : '';
if (!$kind && $this->module == 'admin') {
$kind = 'admin';
}
if ($this->module_info->use_mobile != "Y") {
Mobile::setMobile(false);
}
// admin menu check
if (Context::isInstalled()) {
$oMenuAdminModel =& getAdminModel('menu');
$output = $oMenuAdminModel->getMenuByTitle('__XE_ADMIN__');
if (!$output->menu_srl) {
$oAdminClass =& getClass('admin');
$oAdminClass->createXeAdminMenu();
} else {
if (!is_readable($output->php_file)) {
$oMenuAdminController =& getAdminController('menu');
$oMenuAdminController->makeXmlFile($output->menu_srl);
}
}
}
// Admin ip
$logged_info = Context::get('logged_info');
if ($kind == 'admin' && $_SESSION['denied_admin'] == 'Y') {
$this->error = "msg_not_permitted_act";
$oMessageObject =& ModuleHandler::getModuleInstance('message', $type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
return $oMessageObject;
}
// if(type == view, and case for using mobilephone)
if ($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) {
$orig_type = "view";
$type = "mobile";
// create a module instance
$oModule =& $this->getModuleInstance($this->module, $type, $kind);
if (!is_object($oModule) || !method_exists($oModule, $this->act)) {
$type = $orig_type;
Mobile::setMobile(false);
$oModule =& $this->getModuleInstance($this->module, $type, $kind);
}
} else {
// create a module instance
$oModule =& $this->getModuleInstance($this->module, $type, $kind);
}
if (!is_object($oModule)) {
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
$oMessageObject =& ModuleHandler::getModuleInstance('message', $type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
//.........这里部分代码省略.........
示例5: getCookie
public static function getCookie()
{
$cookieLID = isset($_COOKIE['leapID']) ? $_COOKIE['leapID'] : 0;
if ($cookieLID > 0) {
$token = base64_decode($_COOKIE['leapTk']);
$encypass = base64_decode($_COOKIE['leapPass']);
$exp = explode("8bCL9xx78A", $encypass);
$username = $_COOKIE['leapName'];
$password = $exp[0];
$rememberme = 1;
//mobile
$isMobile = Mobile::getCookie();
Mobile::setMobile($isMobile);
//lang
$lang = Lang::getCookie();
Lang::setLang($lang);
//dbchooser
$dbchooser = DbChooser::getCookie();
DbChooser::setDBChooser($dbchooser);
$row = array("admin_email" => $username, "admin_password" => $password, "rememberme" => $rememberme);
return $row;
}
return array();
}
示例6: procModule
/**
* get a module instance and execute an action
* @return ModuleObject executed module instance
* */
function procModule()
{
$oModuleModel = getModel('module');
$display_mode = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
// If error occurred while preparation, return a message instance
if ($this->error) {
$this->_setInputErrorToContext();
$oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if ($this->httpStatusCode) {
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
}
return $oMessageObject;
}
// Get action information with conf/module.xml
$xml_info = $oModuleModel->getModuleActionXml($this->module);
// If not installed yet, modify act
if ($this->module == "install") {
if (!$this->act || !$xml_info->action->{$this->act}) {
$this->act = $xml_info->default_index_act;
}
}
// if act exists, find type of the action, if not use default index act
if (!$this->act) {
$this->act = $xml_info->default_index_act;
}
// still no act means error
if (!$this->act) {
$this->error = 'msg_module_is_not_exists';
$this->httpStatusCode = '404';
$this->_setInputErrorToContext();
$oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if ($this->httpStatusCode) {
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
}
return $oMessageObject;
}
// get type, kind
$type = $xml_info->action->{$this->act}->type;
$ruleset = $xml_info->action->{$this->act}->ruleset;
$kind = stripos($this->act, 'admin') !== FALSE ? 'admin' : '';
if (!$kind && $this->module == 'admin') {
$kind = 'admin';
}
// check REQUEST_METHOD in controller
if ($type == 'controller') {
$allowedMethod = $xml_info->action->{$this->act}->method;
if (!$allowedMethod) {
$allowedMethodList[0] = 'POST';
} else {
$allowedMethodList = explode('|', strtoupper($allowedMethod));
}
if (!in_array(strtoupper($_SERVER['REQUEST_METHOD']), $allowedMethodList)) {
$this->error = "msg_invalid_request";
$oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
return $oMessageObject;
}
}
if ($this->module_info->use_mobile != "Y") {
Mobile::setMobile(FALSE);
}
$logged_info = Context::get('logged_info');
// check CSRF for POST actions
if (Context::getRequestMethod() === 'POST' && Context::isInstalled() && $this->act !== 'procFileUpload' && !checkCSRF()) {
$this->error = 'msg_invalid_request';
$oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
return $oMessageObject;
}
// Admin ip
if ($kind == 'admin' && $_SESSION['denied_admin'] == 'Y') {
$this->_setInputErrorToContext();
$this->error = "msg_not_permitted_act";
$oMessageObject = ModuleHandler::getModuleInstance('message', $display_mode);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
return $oMessageObject;
}
// if(type == view, and case for using mobilephone)
if ($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) {
$orig_type = "view";
$type = "mobile";
// create a module instance
$oModule = $this->getModuleInstance($this->module, $type, $kind);
if (!is_object($oModule) || !method_exists($oModule, $this->act)) {
//.........这里部分代码省略.........
示例7: strpos
if (!$this->act) {
$this->act = $xml_info->default_index_act;
}
// still no act means error
if (!$this->act) {
$this->error = 'msg_module_is_not_exists';
return;
}
// get type, kind
$type = $xml_info->action->{$this->act}->type;
$kind = strpos(strtolower($this->act), 'admin') !== false ? 'admin' : '';
if (!$kind && $this->module == 'admin') {
$kind = 'admin';
}
if ($this->module_info->use_mobile != "Y") {
Mobile::setMobile(false);
}
// if(type == view, and case for using mobilephone)
if ($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) {
$orig_type = "view";
$type = "mobile";
}
//
// ad-hoc 끝!(ModuleHandler procModule())
//
// 텍스타일뷰일 때만 실행...
if (!($this->module == 'textyle' && ($type == 'view' || $type == 'mobile'))) {
return;
}
// 예약 발행해야할 문서를 구한다.
$now = date('YmdHis');