')
- .attr("className","smartPhoneList")
- .css('display','none')
- .css('backgroundColor','#fff');
-
- jQuery(document.body).append(xeSmartMenu);
-
- xeSmartMenu.slideIn = function(step) {
- var w = this.width() + Math.pow(step,2)*30;
-
- if(w>jQuery(document).width()) {
- this.css({left:0,right:0,display:'block'});
- this.width('');
- jQuery('.smartPhoneContentArea').css("display","none");
- } else {
- this.width(w);
- var o = parseInt(jQuery(document).width/w,10)/5;
- if(o>1) o = 1;
- setTimeout(function() { xeSmartMenu.slideIn(step+1); }, 50);
- }
- }
-
- xeSmartMenu.slideOut = function(step) {
- var l = parseInt(this.css('left'),10) + Math.pow(step,2)*30;
-
- if(l>jQuery('.smartPhoneContent').width()) {
- this.css({display:'none','left':''});
- jQuery('.smartPhoneContentArea').css("display","block");
- } else {
- var o = parseInt(jQuery(document).width/l,10)/5;
- if(o<0) o = 0;
- this.css('left',l+'px');
- setTimeout(function() { xeSmartMenu.slideOut(step+1); }, 50);
- }
- }
- }
-
- if(xeSmartMenu.css('display')=='none' && typeof(xeMenus)!='undefined') {
- xeSmartUpperMenu = null;
- var menu = findSmartNode(xeMenus);
- if(!menu) menu = xeMenus;
- var html = '
';
- if(location.href.getQuery('mid')) html += '- < go Home >
';
- if(xeSmartUpperMenu) html += '- < go Upper >
';
- for(var text in menu) {
- if(!text) continue;
- var url = menu[text].url;
- var href = '';
- if(/^[a-z0-9_]+$/i.test(url)) {
- href = request_uri.setQuery('mid',url);
- if(href.indexOf('?')>-1) href += '&smartphone=true';
- else href += '?smartphone=true';
- }
- else href = url;
- if(typeof(xeVid)!='undefined') {
- if(href.indexOf('?')>-1) href += '&vid='+xeVid;
- else href += '?vid='+xeVid;
- }
- html += '- '+text+'
';
- }
- html += '
';
-
- jQuery(xeSmartMenu).html(html);
- jQuery(xeSmartMenu).css({
- width:'1px',
- right:'0',
- top:'43px',
- display:'block',
- position:'absolute',
- padding:0
- });
- xeSmartMenu.slideIn(0);
- } else if(location.href.getQuery('mid')||location.href.getQuery('document_srl')) {
- xeSmartMenu.slideOut(0);
- }
-}
-
-function findSmartNode(nodes) {
- var mid = current_url.getQuery('mid');
- if(typeof(mid)=='undefined'||!mid) return nodes;
- for(var text in nodes) {
- 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].childs) return nodes[text].childs;
- return nodes;
- }
- }
- return null;
-}
diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php
index 238002908..5f0e4679f 100644
--- a/classes/context/Context.class.php
+++ b/classes/context/Context.class.php
@@ -158,22 +158,6 @@
if(file_exists(_XE_PATH_.'.htaccess')&&$this->db_info->use_rewrite == 'Y') $this->allow_rewrite = true;
else $this->allow_rewrite = false;
- // add common JS/CSS files
- $this->addJsFile("./common/js/jquery.js", true, '', -100000);
- $this->addJsFile("./common/js/x.js");
- $this->addJsFile("./common/js/common.js");
- $this->addJsFile("./common/js/js_app.js");
- $this->addJsFile("./common/js/xml_handler.js");
- $this->addJsFile("./common/js/xml_js_filter.js");
- $this->addCSSFile("./common/css/default.css");
- $this->addCSSFile("./common/css/button.css");
-
- // for admin page, add admin css
- if(Context::get('module')=='admin' || strpos(Context::get('act'),'Admin')>0){
- $this->addCssFile("./modules/admin/tpl/css/font.css", true, 'all', '',10000);
- $this->addCssFile("./modules/admin/tpl/css/pagination.css", true, 'all', '', 100001);
- $this->addCssFile("./modules/admin/tpl/css/admin.css", true, 'all', '', 100002);
- }
// set locations for javascript use
if($_SERVER['REQUEST_METHOD'] == 'GET') {
@@ -1179,7 +1163,7 @@
/**
* @brief js file을 추가
**/
- function _addJsFile($file, $optimized, $targetie,$index) {
+ function _addJsFile($file, $optimized = true, $targetie = '',$index=null) {
if(strpos($file,'://')===false && $file{0}!='/' && $file{0}!='.') $file = './'.$file;
$file = preg_replace('@/\./|(? 0) {
+ if ($now_matchs == 1) {
+ $tmpval = explode ("(", $prefix);
+ $tmpval[1] = sprintf ('"%s"', $tmpval[1]);
+ $prefix = implode ("(", $tmpval);
+ $tmpval = explode (")", $name);
+ $tmpval[0] = sprintf ('"%s"', $tmpval[0]);
+ $name = implode (")", $tmpval);
+ }
}
- else $prefix = sprintf('"%s"',$prefix);
- if ($flag_of_function === true) {
- $tmpval = explode (")", $name);
- $tmpval[0] = sprintf ('"%s"', $tmpval[0]);
- $name = implode (")", $tmpval);
- $flag_of_function = false;
+ else {
+ $prefix = sprintf('"%s"',$prefix);
+ $name = ($name == '*') ? $name : sprintf('"%s"',$name);
}
- else $name = ($name == '*') ? $name : sprintf('"%s"',$name);
-
+ $xtmp = null;
+ $now_matchs = null;
$column_list[] = sprintf($click_count,sprintf('%s.%s', $prefix, $name)) . ($alias ? sprintf(' as %s',$alias) : '');
-
+ } elseif (($now_matchs = preg_match_all ("/\(/", $name, $xtmp)) > 0) {
+ if ($now_matchs == 1 && preg_match ("/[a-zA-Z0-9]*\(\*\)/", $name) < 1) {
+ $open_pos = strpos ($name, "(");
+ $close_pos = strpos ($name, ")");
+ if (preg_match ("/,/", $name)) {
+ $tmp_func_name = sprintf ('%s', substr ($name, 0, $open_pos));
+ $tmp_params = sprintf ('%s', substr ($name, $open_pos + 1, $close_pos - $open_pos - 1));
+ $tmpval = null;
+ $tmpval = explode (',', $tmp_params);
+ foreach ($tmpval as $tmp_param) {
+ $tmp_param_list[] = (!is_numeric ($tmp_param)) ? sprintf ('"%s"', $tmp_param) : $tmp_param;
+ }
+ $tmpval = implode (',', $tmp_param_list);
+ $name = sprintf ('%s(%s)', $tmp_func_name, $tmpval);
+ } else {
+ $name = sprintf ('%s("%s")',
+ substr ($name, 0, $open_pos),
+ substr ($name, $open_pos + 1, $close_pos - $open_pos - 1));
+ }
+ }
+ $column_list[] = sprintf ($click_count,$name) . ($alias ? sprintf (' as %s', $alias) : '');
} else {
$column_list[] = sprintf($click_count,$name) . ($alias ? sprintf(' as %s',$alias) : '');
}
diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php
index d085ecc09..c6116eb93 100644
--- a/classes/display/DisplayHandler.class.php
+++ b/classes/display/DisplayHandler.class.php
@@ -13,6 +13,7 @@
var $content_size = 0; ///< 출력하는 컨텐츠의 사이즈
var $gz_enabled = false; ///< gzip 압축하여 컨텐츠 호출할 것인지에 대한 flag변수
+ var $handler = null;
/**
* @brief print either html or xml content given oModule object
@@ -31,68 +32,25 @@
) $this->gz_enabled = true;
// request method에 따른 컨텐츠 결과물 추출
- if(Context::get('xeVirtualRequestMethod')=='xml') $output = $this->_toVirtualXmlDoc($oModule);
- else if(Context::getRequestMethod() == 'XMLRPC') {
- if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) $this->gz_enabled = false;
- $output = $this->_toXmlDoc($oModule);
+ if(Context::get('xeVirtualRequestMethod')=='xml') {
+ require_once("./classes/display/VirtualXMLDisplayHandler.php");
+ $handler = new VirtualXMLDisplayHandler();
+ }
+ else if(Context::getRequestMethod() == 'XMLRPC') {
+ require_once("./classes/display/XMLDisplayHandler.php");
+ $handler = new XMLDisplayHandler();
+ if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) $this->gz_enabled = false;
+ }
+ else if(Context::getRequestMethod() == 'JSON') {
+ require_once("./classes/display/JSONDisplayHandler.php");
+ $handler = new JSONDisplayHandler();
+ }
+ else {
+ require_once("./classes/display/HTMLDisplayHandler.php");
+ $handler = new HTMLDisplayHandler();
}
- else if(Context::getRequestMethod() == 'JSON') $output = $this->_toJSON($oModule);
- else $output = $this->_toHTMLDoc($oModule);
- // HTML 출력 요청일 경우 레이아웃 컴파일과 더블어 완성된 코드를 제공
- if(Context::getResponseMethod()=="HTML") {
-
- // 관리자 모드일 경우 #xeAdmin id를 가지는 div 추가
- if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')>0) $output = '
'.$output.'
';
-
- // 내용을 content라는 변수로 설정 (layout에서 {$output}에서 대체됨)
- Context::set('content', $output);
-
- // 레이아웃을 컴파일
- $oTemplate = &TemplateHandler::getInstance();
-
- // layout이라는 변수가 none으로 설정되면 기본 레이아웃으로 변경
- if(Context::get('layout') != 'none') {
- if(__DEBUG__==3) $start = getMicroTime();
-
- $layout_path = $oModule->getLayoutPath();
-
- $layout_file = $oModule->getLayoutFile();
- $edited_layout_file = $oModule->getEditedLayoutFile();
-
- // 현재 요청된 레이아웃 정보를 구함
- $oLayoutModel = &getModel('layout');
- $current_module_info = Context::get('current_module_info');
- $layout_srl = $current_module_info->layout_srl;
-
- // 레이아웃과 연결되어 있으면 레이아웃 컴파일
- if($layout_srl > 0){
- $layout_info = Context::get('layout_info');
-
- // faceoff 레이아웃일 경우 별도 처리
- if($layout_info && $layout_info->type == 'faceoff') {
- $oLayoutModel->doActivateFaceOff($layout_info);
- Context::set('layout_info', $layout_info);
- }
-
- // 관리자 레이아웃 수정화면에서 변경된 CSS가 있는지 조사
- $edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
-
- if(file_exists($edited_layout_css)) Context::addCSSFile($edited_layout_css,true,'all','',100);
- }
- if(!$layout_path) $layout_path = "./common/tpl";
- if(!$layout_file) $layout_file = "default_layout";
- $output = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
-
- if(__DEBUG__==3) $GLOBALS['__layout_compile_elapsed__'] = getMicroTime()-$start;
-
-
- if(preg_match('/MSIE/i',$_SERVER['HTTP_USER_AGENT']) && (Context::get("_use_ssl")=='optional'||Context::get("_use_ssl")=="always")) {
- Context::addHtmlFooter('
');
- }
- }
-
- }
+ $output = $handler->toDoc($oModule);
// 출력하기 전에 trigger 호출 (before)
ModuleHandler::triggerCall('display', 'before', $output);
@@ -100,58 +58,16 @@
// 애드온 실행
$called_position = 'before_display_content';
$oAddonController = &getController('addon');
- $addon_file = $oAddonController->getCacheFilePath();
+ $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?"mobile":"pc");
@include($addon_file);
- // HTML 출력일 경우 최종적으로 common layout을 씌워서 출력
- if(Context::getResponseMethod()=="HTML") {
- if(__DEBUG__==3) $start = getMicroTime();
-
- // body 내의 를 header로 이동
- $output = preg_replace_callback('!를 header로 이동
+ $output = preg_replace_callback('!