Пример #1
0
 /**
  * @brief getInstance
  */
 function &getInstance()
 {
     static $instance = null;
     if (!$instance) {
         $browserType = mobileXE::getBrowserType();
         if (!$browserType) {
             return;
         }
         $class_file = sprintf('%saddons/mobile/classes/%s.class.php', _XE_PATH_, $browserType);
         require_once $class_file;
         // Download mobile language settings (cookies, not willing to come up when you click create cache file ...- is initialized ..)
         $this->lang = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/' . md5(trim($_SERVER['HTTP_USER_AGENT']) . trim($_SERVER['HTTP_PHONE_NUMBER']) . trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])) . '.php');
         if ($this->lang) {
             $lang_supported = Context::get('lang_supported');
             $this->lang = str_replace(array('<?php /**', '**/ ?>'), array('', ''), $this->lang);
             if (isset($lang_supported[$this->lang])) {
                 Context::setLangType($this->lang);
             }
         }
         Context::loadLang(_XE_PATH_ . 'addons/mobile/lang');
         $instance = new wap();
         $mobilePage = (int) Context::get('mpage');
         if (!$mobilePage) {
             $mobilePage = 1;
         }
         $instance->setMobilePage($mobilePage);
     }
     return $instance;
 }
Пример #2
0
 /**
  * @brief getInstance
  **/
 function &getInstance()
 {
     static $instance = null;
     if (!$instance) {
         $browserType = mobileXE::getBrowserType();
         if (!$browserType) {
             return;
         }
         $class_file = sprintf('%saddons/mobile/classes/%s.class.php', _XE_PATH_, $browserType);
         require_once $class_file;
         // 모바일 언어설정 로드(쿠키가 안되어 생각해낸 방법...-캐시파일 재생성을 클릭하면 초기화된다..)
         $this->lang = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/' . md5(trim($_SERVER['HTTP_USER_AGENT']) . trim($_SERVER['HTTP_PHONE_NUMBER']) . trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])) . '.php');
         if ($this->lang) {
             $lang_supported = Context::get('lang_supported');
             $this->lang = str_replace(array('<?php /**', '**/ ?>'), array('', ''), $this->lang);
             if (isset($lang_supported[$this->lang])) {
                 Context::setLangType($this->lang);
             }
         }
         Context::loadLang(_XE_PATH_ . 'addons/mobile/lang');
         $instance = new wap();
         $mobilePage = (int) Context::get('mpage');
         if (!$mobilePage) {
             $mobilePage = 1;
         }
         $instance->setMobilePage($mobilePage);
     }
     return $instance;
 }
Пример #3
0
 * before_module_proc > call when changing general settings for mobile
 *
 * after_module_proc > display mobile content
 * Condition
 * */
// Ignore admin page
if (Context::get('module') == 'admin') {
    return;
}
// Manage when to call it
if ($called_position != 'before_module_proc' && $called_position != 'after_module_proc') {
    return;
}
// Ignore if not mobile browser
require_once _XE_PATH_ . 'addons/mobile/classes/mobile.class.php';
if (!mobileXE::getBrowserType()) {
    return;
}
// Generate mobile instance
$oMobile =& mobileXE::getInstance();
if (!$oMobile) {
    return;
}
// Specify charset on the add-on settings
$oMobile->setCharSet($addon_info->charset);
// Set module information
$oMobile->setModuleInfo($this->module_info);
// Register the current module object
$oMobile->setModuleInstance($this);
// Extract content and display/exit if navigate mode is or if WAP class exists
if ($called_position == 'before_module_proc') {