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

View file

@ -10,6 +10,16 @@
<value xml:lang="tr"><![CDATA[Editor Preview]]></value> <value xml:lang="tr"><![CDATA[Editor Preview]]></value>
<value xml:lang="vi"><![CDATA[Editor Preview]]></value> <value xml:lang="vi"><![CDATA[Editor Preview]]></value>
</item> </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"> <item name="main_editor">
<value xml:lang="ko"><![CDATA[본문 에디터]]></value> <value xml:lang="ko"><![CDATA[본문 에디터]]></value>
<value xml:lang="en"><![CDATA[Main editor]]></value> <value xml:lang="en"><![CDATA[Main editor]]></value>