css 및 js 호출순서 조정기능 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5785 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2009-03-06 05:33:56 +00:00
parent 4f380d9c48
commit 61851f1dfe
2149 changed files with 109090 additions and 18689 deletions

View file

@ -17,11 +17,18 @@
* @brief 컴포넌트의 활성화
**/
function procEditorAdminEnableComponent() {
$site_module_info = Context::get('site_module_info');
$args->component_name = Context::get('component_name');
$args->enabled = 'Y';
$output = executeQuery('editor.updateComponent', $args);
$args->site_srl = (int)$site_module_info->site_srl;
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
else $output = executeQuery('editor.updateSiteComponent', $args);
if(!$output->toBool()) return $output;
$oEditorController = &getController('editor');
$oEditorController->removeCache($args->site_srl);
$this->setMessage('success_updated');
}
@ -29,11 +36,18 @@
* @brief 컴포넌트의 비활성화
**/
function procEditorAdminDisableComponent() {
$site_module_info = Context::get('site_module_info');
$args->component_name = Context::get('component_name');
$args->enabled = 'N';
$output = executeQuery('editor.updateComponent', $args);
$args->site_srl = (int)$site_module_info->site_srl;
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
else $output = executeQuery('editor.updateSiteComponent', $args);
if(!$output->toBool()) return $output;
$oEditorController = &getController('editor');
$oEditorController->removeCache($args->site_srl);
$this->setMessage('success_updated');
}
@ -41,11 +55,15 @@
* @brief 컴포넌트의 위치 변경
**/
function procEditorAdminMoveListOrder() {
$site_module_info = Context::get('site_module_info');
$args->site_srl = (int)$site_module_info->site_srl;
$args->component_name = Context::get('component_name');
$mode = Context::get('mode');
// DB에서 전체 목록 가져옴
$output = executeQuery('editor.getComponentList', $args);
if(!$args->site_srl) $output = executeQuery('editor.getComponentList', $args);
else $output = executeQuery('editor.getSiteComponentList', $args);
$db_list = $output->data;
foreach($db_list as $key => $val) {
if($val->component_name == $args->component_name) break;
@ -56,23 +74,36 @@
$prev_args->component_name = $db_list[$key-1]->component_name;
$prev_args->list_order = $db_list[$key]->list_order;
executeQuery('editor.updateComponent', $prev_args);
$prev_args->site_srl = $args->site_srl;
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $prev_args);
else $output = executeQuery('editor.updateSiteComponent', $prev_args);
$cur_args->component_name = $db_list[$key]->component_name;
$cur_args->list_order = $db_list[$key-1]->list_order;
executeQuery('editor.updateComponent', $cur_args);
if($prev_args->list_order == $cur_args->list_order) $cur_args->list_order--;
$cur_args->site_srl = $args->site_srl;
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args);
else $output = executeQuery('editor.updateSiteComponent', $cur_args);
} else {
if($key == count($db_list)-1) return new Object(-1,'msg_component_is_last_order');
$next_args->component_name = $db_list[$key+1]->component_name;
$next_args->list_order = $db_list[$key]->list_order;
executeQuery('editor.updateComponent', $next_args);
$next_args->site_srl = $args->site_srl;
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $next_args);
else $output = executeQuery('editor.updateSiteComponent', $next_args);
$cur_args->component_name = $db_list[$key]->component_name;
$cur_args->list_order = $db_list[$key+1]->list_order;
executeQuery('editor.updateComponent', $cur_args);
$cur_args->site_srl = $args->site_srl;
if($next_args->list_order == $cur_args->list_order) $cur_args->list_order++;
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args);
else $output = executeQuery('editor.updateSiteComponent', $cur_args);
}
$oEditorController = &getController('editor');
$oEditorController->removeCache($args->site_srl);
$this->setMessage('success_updated');
}
@ -80,6 +111,8 @@
* @brief 컴포넌트 설정
**/
function procEditorAdminSetupComponent() {
$site_module_info = Context::get('site_module_info');
$component_name = Context::get('component_name');
$extra_vars = Context::getRequestVars();
unset($extra_vars->component_name);
@ -92,30 +125,41 @@
$args->component_name = $component_name;
$args->extra_vars = serialize($extra_vars);
$args->site_srl = (int)$site_module_info->site_srl;
$output = executeQuery('editor.updateComponent', $args);
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
else $output = executeQuery('editor.updateSiteComponent', $args);
if(!$output->toBool()) return $output;
$oEditorController = &getController('editor');
$oEditorController->removeCache($args->site_srl);
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트를 DB에 추가
**/
function insertComponent($component_name, $enabled = false) {
function insertComponent($component_name, $enabled = false, $site_srl = 0) {
if($enabled) $enabled = 'Y';
else $enabled = 'N';
$args->component_name = $component_name;
$args->enabled = $enabled;
$args->site_srl = $site_srl;
// 컴포넌트가 있는지 확인
$output = executeQuery('editor.isComponentInserted', $args);
if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
else $output = executeQuery('editor.isSiteComponentInserted', $args);
if($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
// 입력
$args->list_order = getNextSequence();
$output = executeQuery('editor.insertComponent', $args);
if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
else $output = executeQuery('editor.insertSiteComponent', $args);
$oEditorController = &getController('editor');
$oEditorController->removeCache($site_srl);
return $output;
}
}