modification editor module (modification algorism for cafeXE and adding module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9708 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
chschy 2011-10-21 08:23:27 +00:00
parent 29d5cc38ed
commit 5e43a9f656
2 changed files with 43 additions and 22 deletions

View file

@ -16,63 +16,74 @@
/**
* @brief 컴포넌트 사용설정, 목록 순서 변경
**/
function procEditorAdminCheckUseListOrder(){
function procEditorAdminCheckUseListOrder(){
$site_module_info = Context::get('site_module_info');
$enables = Context::get('enables');
$component_names = Context::get('component_names');
$unables = array_diff($component_names, $enables);
$componentList = array();
$output = $this->editorCheckUse($enables,$unables);
foreach($enables as $component_name) {
$componentList[$component_name] = 'Y';
}
foreach($unables as $component_name) {
$componentList[$component_name] = 'N';
}
$output = $this->editorCheckUse($componentList,$site_module_info->site_srl);
if(!$output->toBool()) return new Object();
$output = $this->editorListOrder($component_names);
$output = $this->editorListOrder($component_names,$site_module_info->site_srl);
if(!$output->toBool()) return new Object();
$oEditorController = &getController('editor');
$oEditorController->removeCache($args->site_srl);
$oEditorController->removeCache($site_module_info->site_srl);
$this->setRedirectUrl(Context::get('error_return_url'));
}
/**
* @brief check use component
**/
function editorCheckUse($enables,$unables){
if(is_array($enables)){
$args->enabled = 'Y';
foreach($enables as $component_name){
$args->component_name = $component_name;
function editorCheckUse($componentList, $site_srl = 0){
$args->site_srl = $site_srl;
foreach($componentList as $componentName => $value){
$args->component_name = $componentName;
$args->enabled = $value;
if($site_srl == 0) {
$output = executeQuery('editor.updateComponent', $args);
} else {
$output = executeQuery('editor.updateSiteComponent', $args);
}
}
if(!$output->toBool()) return new Object();
if(is_array($unables)){
$args->enabled = 'N';
foreach($unables as $component_name){
$args->component_name = $component_name;
$output = executeQuery('editor.updateComponent', $args);
}
}
if(!$output->toBool()) return new Object();
unset($args->enabled);
unset($componentList);
return $output;
}
/**
* @brief list order componet
**/
function editorListOrder($component_names){
function editorListOrder($component_names, $site_srl = 0){
$args->site_srl = $site_srl;
$list_order_num = '30';
if(is_array($component_names)) {
foreach($component_names as $name){
$args->list_order = $list_order_num;
$args->component_name = $name;
$output = executeQuery('editor.updateComponent', $args);
$args->component_name = $name;
if($site_srl == 0) {
$output = executeQuery('editor.updateComponent', $args);
} else {
$output = executeQuery('editor.updateSiteComponent', $args);
}
if(!$output->toBool()) return new Object();
$list_order_num++;
}
}
unset($component_names);
return $output;
}

View file

@ -10,6 +10,16 @@
<value xml:lang="tr"><![CDATA[Editor Preview]]></value>
<value xml:lang="vi"><![CDATA[Editor Preview]]></value>
</item>
<item name="editor_component">
<value xml:lang="ko"><![CDATA[에디터 컴포넌트]]></value>
<value xml:lang="en"><![CDATA[Editor Component]]></value>
<value xml:lang="jp"><![CDATA[エディターコンポーネント]]></value>
<value xml:lang="zh-CN"><![CDATA[Editor Component]]></value>
<value xml:lang="zh-TW"><![CDATA[Editor Component]]></value>
<value xml:lang="ru"><![CDATA[Editor Component]]></value>
<value xml:lang="tr"><![CDATA[Editor Component]]></value>
<value xml:lang="vi"><![CDATA[Editor Component]]></value>
</item>
<item name="main_editor">
<value xml:lang="ko"><![CDATA[본문 에디터]]></value>
<value xml:lang="en"><![CDATA[Main editor]]></value>