mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 15:19:57 +09:00
smartphone 애드온의 접근 권한 오류 출력 및 스마트폰 네비게이션 개선
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6406 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cdeb3f36cc
commit
e57019217f
3 changed files with 65 additions and 49 deletions
|
|
@ -74,44 +74,43 @@
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
function procSmartPhone() {
|
function procSmartPhone($msg = null) {
|
||||||
if(preg_match('/(iPopd|iPhone)/',$_SERVER['HTTP_USER_AGENT'])) {
|
if(preg_match('/(iPopd|iPhone)/',$_SERVER['HTTP_USER_AGENT'])) {
|
||||||
Context::addHtmlHeader('<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>');
|
Context::addHtmlHeader('<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>');
|
||||||
} else if(preg_match('/PPC/',$_SERVER['HTTP_USER_AGENT'])) {
|
} else if(preg_match('/PPC/',$_SERVER['HTTP_USER_AGENT'])) {
|
||||||
Context::addHtmlHeader('<meta name="viewport" content="width=240; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>');
|
Context::addHtmlHeader('<meta name="viewport" content="width=240; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_a($this->output, 'Object') || is_subclass_of($this->output, 'Object')) {
|
if(is_a($this->output, 'Object') || is_subclass_of($this->output, 'Object') || $msg) {
|
||||||
$this->setContent($this->output->getMessage());
|
if($msg) $this->setContent(Context::getLang($msg));
|
||||||
|
else $this->setContent($this->output->getMessage());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($_GET['mid'] || $_GET['document_srl']) {
|
if($this->haveSmartphoneModule($this->module_info->module)) {
|
||||||
if($this->haveSmartphoneModule($this->module_info->module)) {
|
$oSmartPhoneModule =& getModule($this->module_info->module, 'smartphone');
|
||||||
$oSmartPhoneModule =& getModule($this->module_info->module, 'smartphone');
|
$vars = get_object_vars($this->oModule);
|
||||||
$vars = get_object_vars($this->oModule);
|
if(count($vars)) foreach($vars as $key => $val) $oSmartPhoneModule->{$key} = $val;
|
||||||
if(count($vars)) foreach($vars as $key => $val) $oSmartPhoneModule->{$key} = $val;
|
$oSmartPhoneModule->procSmartPhone($this);
|
||||||
$oSmartPhoneModule->procSmartPhone($this);
|
} else {
|
||||||
} else {
|
switch(Context::getLangType()) {
|
||||||
switch(Context::getLangType()) {
|
case 'ko' :
|
||||||
case 'ko' :
|
$msg = '스마트폰을 지원하지 않는 모듈입니다';
|
||||||
$msg = '스마트폰을 지원하지 않는 모듈입니다';
|
break;
|
||||||
break;
|
case 'jp' :
|
||||||
case 'jp' :
|
$msg = 'このモジュールをサポートしていません。';
|
||||||
$msg = 'このモジュールをサポートしていません。';
|
break;
|
||||||
break;
|
case 'zh-TW' :
|
||||||
case 'zh-TW' :
|
$msg = '該模塊不支持。';
|
||||||
$msg = '該模塊不支持。';
|
break;
|
||||||
break;
|
case 'zh-CN' :
|
||||||
case 'zh-CN' :
|
$msg = '该模块不支持。';
|
||||||
$msg = '该模块不支持。';
|
break;
|
||||||
break;
|
default :
|
||||||
default :
|
$msg = 'This module is not supported.';
|
||||||
$msg = 'This module is not supported.';
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->setContent($msg);
|
|
||||||
}
|
}
|
||||||
|
$this->setContent($msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,31 @@
|
||||||
<?PHP
|
<?PHP
|
||||||
if(!defined("__ZBXE__")) exit();
|
if(!defined("__ZBXE__")) exit();
|
||||||
|
|
||||||
if(Context::get('module')=='admin' || $called_position != 'after_module_proc' ) return;
|
if(Context::get('module')=='admin') return;
|
||||||
|
|
||||||
require_once(_XE_PATH_.'addons/smartphone/classes/smartphone.class.php');
|
require_once(_XE_PATH_.'addons/smartphone/classes/smartphone.class.php');
|
||||||
if(!smartphoneXE::isFromSmartPhone()) return;
|
if(!smartphoneXE::isFromSmartPhone()) return;
|
||||||
|
|
||||||
$oSmartphoneXE = new smartphoneXE($this, $this->module_info, $output);
|
if($called_position == 'after_module_proc' ) {
|
||||||
$oSmartphoneXE->procSmartPhone();
|
$oSmartphoneXE = new smartphoneXE($this, $this->module_info, $output);
|
||||||
|
$oSmartphoneXE->procSmartPhone();
|
||||||
|
Context::set('layout', 'none');
|
||||||
|
Context::set('smart_content', $oSmartphoneXE->content);
|
||||||
|
Context::set('parent_url', $oSmartphoneXE->parent_url);
|
||||||
|
Context::set('prev_url', $oSmartphoneXE->prev_url);
|
||||||
|
Context::set('next_url', $oSmartphoneXE->next_url);
|
||||||
|
$this->setTemplatePath('addons/smartphone/tpl');
|
||||||
|
$this->setTemplateFile('layout');
|
||||||
|
|
||||||
Context::set('layout', 'none');
|
} elseif($called_position == 'before_module_proc' && !$this->grant->access) {
|
||||||
Context::set('smart_content', $oSmartphoneXE->content);
|
$oSmartphoneXE = new smartphoneXE($this, $this->module_info, $output);
|
||||||
Context::set('parent_url', $oSmartphoneXE->parent_url);
|
$oSmartphoneXE->procSmartPhone('msg_not_permitted_act');
|
||||||
Context::set('prev_url', $oSmartphoneXE->prev_url);
|
Context::set('layout', 'none');
|
||||||
Context::set('next_url', $oSmartphoneXE->next_url);
|
Context::set('smart_content', $oSmartphoneXE->content);
|
||||||
$this->setTemplatePath('addons/smartphone/tpl');
|
Context::set('parent_url', $oSmartphoneXE->parent_url);
|
||||||
$this->setTemplateFile('layout');
|
Context::set('prev_url', $oSmartphoneXE->prev_url);
|
||||||
|
Context::set('next_url', $oSmartphoneXE->next_url);
|
||||||
|
$this->setTemplatePath('addons/smartphone/tpl');
|
||||||
|
$this->setTemplateFile('layout');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
var xeSmartMenu = null;
|
var xeSmartMenu = null;
|
||||||
|
var xeSmartUpperMenu = null;
|
||||||
function showXEMenu() {
|
function showXEMenu() {
|
||||||
if(!xeSmartMenu) {
|
if(!xeSmartMenu) {
|
||||||
|
|
||||||
|
|
@ -40,9 +41,12 @@ function showXEMenu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(xeSmartMenu.css('display')=='none' && typeof(xeMenus)!='undefined') {
|
if(xeSmartMenu.css('display')=='none' && typeof(xeMenus)!='undefined') {
|
||||||
|
xeSmartUpperMenu = null;
|
||||||
var menu = findSmartNode(xeMenus);
|
var menu = findSmartNode(xeMenus);
|
||||||
if(!menu) menu = xeMenus;
|
if(!menu) menu = xeMenus;
|
||||||
var html = '<ul>';
|
var html = '<ul>';
|
||||||
|
if(location.href.getQuery('mid')) html += '<li><a href="'+current_url.setQuery('mid','')+'">< go Home ></a></li>';
|
||||||
|
if(xeSmartUpperMenu) html += '<li><a href="'+current_url.setQuery('mid',xeSmartUpperMenu.url)+'">< go Upper ></a></li>';
|
||||||
for(var text in menu) {
|
for(var text in menu) {
|
||||||
if(!text) continue;
|
if(!text) continue;
|
||||||
var url = menu[text].url;
|
var url = menu[text].url;
|
||||||
|
|
@ -77,20 +81,21 @@ function showXEMenu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function findSmartNode(nodes) {
|
function findSmartNode(nodes) {
|
||||||
if(typeof(current_mid)=='undefined') return;
|
var mid = current_url.getQuery('mid');
|
||||||
var mid = current_mid;
|
if(typeof(mid)=='undefined'||!mid) return nodes;
|
||||||
if(location.href.indexOf(mid)<0&&location.href.indexOf('document_srl')<0) mid = null;
|
|
||||||
for(var text in nodes) {
|
for(var text in nodes) {
|
||||||
if(!text) continue;
|
if(!text) continue;
|
||||||
|
if(nodes[text].childs) {
|
||||||
|
var n = findSmartNode(nodes[text].childs);
|
||||||
|
if(n) {
|
||||||
|
xeSmartUpperMenu = nodes[text];
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(nodes[text].url == mid) {
|
if(nodes[text].url == mid) {
|
||||||
if(nodes[text].childs) return nodes[text].childs;
|
if(nodes[text].childs) return nodes[text].childs;
|
||||||
}
|
return nodes;
|
||||||
if(nodes[text].childs && nodes[text].childs.length) {
|
|
||||||
var n = findSmartNode(nodes[text].childs);
|
|
||||||
if(n) return n;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!location.href.getQuery('mid')&&!location.href.getQuery('document_srl')) jQuery(document).ready(showXEMenu);
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue