示例#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 Button to output
  **/
 function printBtn()
 {
     if ($this->nextUrl) {
         $url = $this->nextUrl;
         printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
     }
     if ($this->prevUrl) {
         $url = $this->prevUrl;
         printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
     }
     // Select Language
     if (!parent::isLangChange()) {
         $url = getUrl('', 'lcm', '1', 'sel_lang', Context::getLangType(), 'return_uri', Context::get('current_url'));
         printf('<a href="%s">%s</a><br>%s', $url, 'Language : ' . Context::getLang('select_lang'), "\n");
     } else {
         printf('<a href="%s">%s</a><br>%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n");
     }
     if ($this->upperUrl) {
         $url = $this->upperUrl;
         printf('<btn href="%s" name="%s">%s', $url->url, $url->text, "\n");
     }
     if ($this->homeUrl) {
         $url = $this->homeUrl;
         printf('<a btn="%s" href="%s">%s</a><br>%s', $url->text, $url->url, $url->text, "\n");
     }
 }
示例#3
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;
 }
示例#4
0
 function getNo()
 {
     if (Context::get('mobile_skt') == 1) {
         return "vnd.skmn" . parent::getNo();
     } else {
         return parent::getNo();
     }
     return $str;
 }
示例#5
0
 * */
// 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') {
    if ($oMobile->isLangChange()) {
        $oMobile->setLangType();
        $oMobile->displayLangSelect();
    }
示例#6
0
 /**
  * @brief constructor
  **/
 function __construct()
 {
     parent::__construct();
 }
示例#7
0
 /**
  * @brief constructor
  **/
 function wap()
 {
     parent::mobileXE();
 }