Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }