1. 가상 사이트 생성시 메뉴가 가상 사이트에 적합하게 연결되지 않는 문제 수정.

2. 관리자 페이지에서 언어파일 로드 오류로 인한 에러 메세지 출력되는 문제 수정
3. AJAX 호출시 같은 호출이 여러번 중복 호출되지 않도록 수정


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6055 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2009-04-09 01:19:48 +00:00
parent 5fa0812df1
commit 4074c38674
4 changed files with 56 additions and 45 deletions

View file

@ -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;

View file

@ -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 && !/^<response>/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 += "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
+ "<methodCall>\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;
}

View file

@ -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, ''));
}

View file

@ -19,7 +19,7 @@
<th scope="row"><div>{$lang->cafe_title}</div></th>
<td>
{$homepage_info->title}
<a href="{getSiteUrl($homepage_info->domain,'', 'module','homepage','act','dispHomepageManage')}" onclick="window.open(this.href); return false;" class="button"><span>{$lang->cmd_management}</span></a>
<a href="{getSiteUrl($homepage_info->domain,'', 'act','dispHomepageManage')}" onclick="window.open(this.href); return false;" class="button"><span>{$lang->cmd_management}</span></a>
</td>
</tr>
<tr>