diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index d5a3b0fbf..bf343451b 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -67,15 +67,51 @@ $this->context->lang = &$GLOBALS['lang']; $this->context->_COOKIE = $_COOKIE; - // 사용자의 쿠키 설정된 언어 타입 추출 - if($_COOKIE['lang_type']) $this->lang_type = $_COOKIE['lang_type']; + // Request Method 설정 + $this->_setRequestMethod(); + + // Request Argument 설정 + $this->_setXmlRpcArgument(); + $this->_setJSONRequestArgument(); + $this->_setRequestArgument(); + $this->_setUploadedArgument(); // 기본적인 DB정보 세팅 $this->_loadDBInfo(); + // 설치가 되어 있다면 가상 사이트 정보를 구함 + if(Context::isInstalled()) { + // site_module_info를 구함 + $oModuleModel = &getModel('module'); + $site_module_info = $oModuleModel->getDefaultMid(); + Context::set('site_module_info', $site_module_info); + + if($site_module_info->site_srl && isSiteID($site_module_info->vid)) Context::set('vid', $site_module_info->vid); + } + // 언어 파일 불러오기 $lang_supported = $this->loadLangSelected(); + // 사용자의 쿠키 설정된 언어 타입 추출 + if($_COOKIE['lang_type']) $this->lang_type = $_COOKIE['lang_type']; + + // 사용자 설정 언어 타입이 없으면 기본 언어타입으로 지정 + if(!$this->lang_type) { + // 가상 사이트라면 가상사이트의 언어타입으로 지정 + if($site_module_info && $site_module_info->default_language) $this->lang_type = $site_module_info->default_language; + else $this->lang_type = $this->db_info->lang_type; + } + + // 관리자 설정 언어값에 등록된 것이 아니라면 기본 언어로 변경 + if(!in_array($this->lang_type, array_keys($lang_supported))) $this->lang_type = $this->db_info->lang_type; + if(!$this->lang_type) $this->lang_type = "en"; + + Context::set('lang_supported', $lang_supported); + $this->setLangType($this->lang_type); + + // module의 언어파일 강제 로드 (언어 type에 맞춰서) + $this->loadLang(_XE_PATH_.'modules/module/lang'); + // 세션 핸들러 지정 $oSessionModel = &getModel('session'); $oSessionController = &getController('session'); @@ -89,39 +125,6 @@ ); session_start(); - // Request Method 설정 - $this->_setRequestMethod(); - - // Request Argument 설정 - $this->_setXmlRpcArgument(); - $this->_setJSONRequestArgument(); - $this->_setRequestArgument(); - $this->_setUploadedArgument(); - - // 설치가 되어 있다면 가상 사이트 정보를 구함 - if(Context::isInstalled()) { - // site_module_info를 구함 - $oModuleModel = &getModel('module'); - $site_module_info = $oModuleModel->getDefaultMid(); - Context::set('site_module_info', $site_module_info); - - if($site_module_info->site_srl && isSiteID($site_module_info->vid)) Context::set('vid', $site_module_info->vid); - } - - // 사용자 설정 언어 타입이 없으면 기본 언어타입으로 지정 - if(!$this->lang_type) { - // 가상 사이트라면 가상사이트의 언어타입으로 지정 - if($site_module_info && $site_module_info->default_language) $this->db_info->lang_type = $site_module_info->default_language; - - // 언어 타입 지정 - $this->lang_type = $this->db_info->lang_type; - } - // 지정된 언어가 지원 언어에 속하지 않거나 없으면 영문으로 지정 - if(!in_array($this->lang_type, array_keys($lang_supported))) $this->lang_type = $this->db_info->lang_type; - if(!$this->lang_type) $this->lang_type = "en"; - - Context::set('lang_supported', $lang_supported); - $this->setLangType($this->lang_type); // 인증 관련 정보를 Context와 세션에 설정 if(Context::isInstalled()) { @@ -462,6 +465,7 @@ **/ function _loadLang($path) { global $lang; + if(!$this->lang_type) return; if(substr($path,-1)!='/') $path .= '/'; $filename = sprintf('%s%s.lang.php', $path, $this->lang_type); if(!file_exists($filename)) $filename = sprintf('%s%s.lang.php', $path, 'ko'); @@ -469,7 +473,7 @@ if(!is_array($this->loaded_lang_files)) $this->loaded_lang_files = array(); if(in_array($filename, $this->loaded_lang_files)) return; $this->loaded_lang_files[] = $filename; - include($filename); + if(file_exists($filename)) @include($filename); } /** @@ -764,6 +768,9 @@ **/ function _getUrl($num_args=0, $args_list=array(), $domain = null) { static $site_module_info = null; + if($domain) $is_site = true; + else $is_site = false; + if(is_null($site_module_info)) { $site_module_info = Context::get('site_module_info'); } @@ -822,7 +829,7 @@ $var_count = count($get_vars); if(!$var_count) { - return $path; + if(!$is_site) return $path; if($vid) { if($this->allow_rewrite) $path .= $vid; else $path .= '?vid='.$vid; diff --git a/common/js/xml_handler.js b/common/js/xml_handler.js index a10d00b98..9cc77cd99 100644 --- a/common/js/xml_handler.js +++ b/common/js/xml_handler.js @@ -6,6 +6,7 @@ // xml handler을 이용하는 user function var show_waiting_message = true; +var _isXmlRequested = false; function exec_xml(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) { var oXml = new xml_handler(); oXml.reset(); @@ -28,6 +29,8 @@ function exec_xml(module, act, params, callback_func, response_tags, callback_fu // 결과 처리 후 callback_func에 넘겨줌 function xml_response_filter(oXml, callback_func, response_tags, callback_func_arg, fo_obj) { var text = oXml.getResponseText(); + if(oXml.objXmlHttp.readyState!=4) return; + _isXmlRequested = false; if(text && !/^/i.test(text)) { var waiting_obj = xGetElementById("waitingforserverresponse"); if(waiting_obj) waiting_obj.style.visibility = "hidden"; @@ -93,6 +96,8 @@ function zGetXmlHttp() { } function xml_handlerRequest(callBackFunc, xmlObj, callBackFunc2, response_tags, callback_func_arg, fo_obj) { + if(_isXmlRequested) return; + _isXmlRequested = true; var rd = ""; rd += "\n" + "\n" @@ -124,13 +129,12 @@ function xml_handlerRequest(callBackFunc, xmlObj, callBackFunc2, response_tags, } this.objXmlHttp.onreadystatechange = function () {callBackFunc(xmlObj, callBackFunc2, response_tags, callback_func_arg, fo_obj)}; - // 모든 xml데이터는 POST방식으로 전송. try-cacht문으로 오류 발생시 대처 + // 모든 xml데이터는 POST방식으로 전송. try-catch문으로 오류 발생시 대처 try { - this.objXmlHttp.open("POST", this.xml_path, true); - } catch(e) { alert(e); + _isXmlRequested = false; return; } diff --git a/modules/homepage/homepage.admin.controller.php b/modules/homepage/homepage.admin.controller.php index 955b6a9e7..17a41ff59 100644 --- a/modules/homepage/homepage.admin.controller.php +++ b/modules/homepage/homepage.admin.controller.php @@ -111,10 +111,6 @@ $layout_module_args->module_srls = implode(',',$modules); $output = executeQuery('layout.updateModuleLayout', $layout_module_args); - // 메뉴 XML 파일 생성 - $oMenuAdminController = &getAdminController('menu'); - $oMenuAdminController->makeXmlFile($info->menu_srl, $info->site_srl); - // 홈페이지 등록 $args->site_srl = $info->site_srl; $args->title = $info->title; @@ -180,6 +176,10 @@ $oEditorController->insertComponent('poll_maker',true, $info->site_srl); $oEditorController->insertComponent('image_gallery',true, $info->site_srl); + // 메뉴 XML 파일 생성 + $oMenuAdminController = &getAdminController('menu'); + $oMenuAdminController->makeXmlFile($info->menu_srl, $info->site_srl); + $this->add('site_srl', $info->site_srl); $this->add('url', getSiteUrl($info->domain, '')); } diff --git a/modules/homepage/tpl/setup.html b/modules/homepage/tpl/setup.html index 440a4fe83..cccf12b39 100644 --- a/modules/homepage/tpl/setup.html +++ b/modules/homepage/tpl/setup.html @@ -19,7 +19,7 @@
{$lang->cafe_title}
{$homepage_info->title} - {$lang->cmd_management} + {$lang->cmd_management}