Ejemplo n.º 1
0
	function isMobile()
	{
		if( class_exists( 'Wizin_User' ) ) {
			// WizMobile (gusagi)
			$user =& Wizin_User::getSingleton();
			return $user->bIsMobile ;
		} else if( defined( 'HYP_K_TAI_RENDER' ) && HYP_K_TAI_RENDER && HYP_K_TAI_RENDER != 2 ) {
			// hyp_common ktai-renderer (nao-pon)
			return true ;
		} else {
			return false ;
		}
	}
Ejemplo n.º 2
0
 public function isMobile()
 {
     if (class_exists('Wizin_User')) {
         $wizinUser =& Wizin_User::getSingleton();
         if ($wizinUser->bIsMobile) {
             return true;
         }
     }
     return false;
 }
 function getActionUrl($actionName = '', $paramArray = array(), $ext = 'html', $ommitBase = false, $escape = true)
 {
     if ($ommitBase) {
         $str = '';
         if ($this->getAttribute('StaticUrlMode') && $this->getAttribute('ModRewriteOff')) {
             $str .= 'page/';
         }
     } else {
         $str = $this->getUrlBase(true) . '/';
     }
     $suffix = '.' . $ext;
     $canUseStaticUrl = true;
     if (class_exists('Wizin_User')) {
         $user =& Wizin_User::getSingleton();
         if ($user->bIsMobile) {
             $canUseStaticUrl = false;
         }
     }
     if ($this->getAttribute('StaticUrlMode') && $canUseStaticUrl) {
         $delim = '';
         if (!empty($actionName)) {
             $className = $actionName . 'Action';
         } else {
             $className = $this->getAttribute('ModueleMainAction');
         }
         NBFrame::using($className, $this);
         if (class_exists($className) && is_callable(array($className, 'getParamString'), false)) {
             $result = call_user_func_array(array($className, 'getParamString'), array(&$this, $paramArray));
             if ($result !== false) {
                 $str .= $result;
                 return $str;
             }
         }
         if (!empty($actionName) && $actionName != $this->getAttribute('ModueleMainAction')) {
             if (preg_match('/^(NBFrame\\.)?(admin\\.)?([A-Za-z0-9\\._]+)/', $actionName, $matches)) {
                 if ($matches[1]) {
                     $str .= 'NBFrame/';
                 }
                 if ($matches[2]) {
                     $str .= 'admin/';
                 }
             }
             $str .= $matches[3] . 'Action/';
         }
         if (!empty($paramArray)) {
             foreach ($paramArray as $key => $value) {
                 if ($key == 'action') {
                     continue;
                 }
                 if (trim($value) != '') {
                     if (substr($key, 0, 2) == '__') {
                         $suffix = $delim . $key . '__' . rawurlencode(trim($value));
                     } else {
                         $str .= $delim . $key . '__' . rawurlencode(trim($value));
                         $delim = '/';
                     }
                 }
             }
             $str .= $suffix;
         }
     } else {
         $delim = '?';
         if (!empty($actionName) && $actionName != $this->getAttribute('ModueleMainAction')) {
             $str .= $delim . 'action=' . $actionName;
             $delim = $escape ? '&' : '&';
         }
         if (!empty($paramArray)) {
             foreach ($paramArray as $key => $value) {
                 if ($key == 'action') {
                     continue;
                 }
                 if (substr($key, 0, 2) == '__') {
                     $key = substr($key, 2);
                 }
                 if (trim($value) != '') {
                     $str .= $delim . $key . '=' . rawurlencode(trim($value));
                     $delim = $escape ? '&' : '&';
                 }
             }
         }
     }
     return $str;
 }
 function getInputEncoding()
 {
     if (class_exists('Wizin_User')) {
         // WizMobile (gusagi)
         $user =& Wizin_User::getSingleton();
         return $user->bIsMobile ? $user->sEncoding : null;
     } else {
         if (defined('HYP_K_TAI_RENDER') && HYP_K_TAI_RENDER) {
             // hyp_common ktai-renderer (nao-pon)
             return HYP_POST_ENCODING;
             // judging by input (old code)
             // return mb_detect_encoding( urldecode( file_get_contents( 'php://input' ) ) , array( 'SJIS-Win' , 'SJIS' , 'EUCJP-Win' , 'EUC-JP' , 'UTF-8' ) ) ;
         } else {
             return null;
         }
     }
 }
Ejemplo n.º 5
0
 function send_location($page = '', $hash = '', $url = '', $title = '', $buf_clear = true)
 {
     if ($buf_clear) {
         $this->clear_output_buffer();
     }
     if ($page !== '') {
         $url = $this->get_page_uri($page, true);
         if (!$title) {
             $title = str_replace('$1', htmlspecialchars($page), $this->root->_title_updated);
         }
     }
     if (!$url) {
         $url = $this->cont['HOME_URL'];
     }
     if ($this->root->viewmode === 'popup') {
         $url .= (strpos($url, '?') === FALSE ? '?' : '&') . 'popup=1';
     }
     if ($hash) {
         $url .= ($hash[0] !== '#' ? '#' : '') . $hash;
     }
     // For WizMobile
     $user = null;
     if (strpos($url, '?') !== FALSE) {
         if (class_exists('XC_CLASS_EXISTS') && XC_CLASS_EXISTS('Wizin_User') || class_exists('Wizin_User')) {
             $user =& Wizin_User::getSingleton();
             if ($user->bIsMobile) {
                 $url = str_replace('&', '&', $url);
                 list($_url, $_query) = explode('?', $url);
                 list($_query, $_hash) = array_pad(explode('#', $_query), 2, '');
                 $url = $_url . '?';
                 $toenc = $user->sEncoding;
                 $fromenc = $this->cont['SOURCE_ENCODING'];
                 foreach (explode('&', $_query) as $_q) {
                     list($_key, $_dat) = array_pad(explode('=', $_q), 2, '');
                     if ($_dat) {
                         $url .= $_key . '=' . rawurlencode(mb_convert_encoding(rawurldecode($_dat), $toenc, $fromenc)) . '&';
                     } else {
                         $url .= $_key . '&';
                     }
                 }
                 $url = rtrim($url, '&');
                 if ($_hash) {
                     $url .= '#' . $_hash;
                 }
             }
         }
     }
     if (headers_sent()) {
         $this->redirect_header($url, 0, $title);
     } else {
         if ($user || defined('HYP_K_TAI_RENDER') && HYP_K_TAI_RENDER) {
             if (is_object($user)) {
                 if (!$user->bCookie) {
                     $url = $this->href_give_session_id($url);
                 }
             } else {
                 $kr =& HypKTaiRender::getSingleton();
                 if (!$kr->vars['ua']['allowCookie']) {
                     $url = $this->href_give_session_id($url);
                 }
             }
         }
         header('Location: ' . $url);
     }
     exit;
 }