mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@655 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bc732c3f34
commit
4d976f2bdc
11 changed files with 193 additions and 55 deletions
|
|
@ -44,7 +44,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="cell_attribute" style="display:none">
|
<div id="cell_attribute" style="display:none">
|
||||||
|
|
||||||
<div class="item_area">
|
<div class="item_area">
|
||||||
<div class="header">{$lang->cell_width} :</div>
|
<div class="header">{$lang->cell_width} :</div>
|
||||||
<div class="body"><input type="text" class="table_input" id="cell_width" value="0" />px</div>
|
<div class="body"><input type="text" class="table_input" id="cell_width" value="0" />px</div>
|
||||||
|
|
@ -92,6 +91,7 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="editor_button_area">
|
<div class="editor_button_area">
|
||||||
<input type="button" value="{$lang->cmd_insert}" class="editor_button" onclick="insertTable()" />
|
<input type="button" value="{$lang->cmd_insert}" class="editor_button" onclick="insertTable()" />
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,18 @@
|
||||||
// 에디터 모듈에서 사용할 디렉토리 생성
|
// 에디터 모듈에서 사용할 디렉토리 생성
|
||||||
FileHandler::makeDir('./files/cache/editor');
|
FileHandler::makeDir('./files/cache/editor');
|
||||||
|
|
||||||
|
// 기본 에디터 컴포넌트를 추가
|
||||||
|
$oEditorController = &getController('editor');
|
||||||
|
$oEditorController->insertComponent('colorpicker_text',true);
|
||||||
|
$oEditorController->insertComponent('colorpicker_bg',true);
|
||||||
|
$oEditorController->insertComponent('emoticon',true);
|
||||||
|
$oEditorController->insertComponent('url_link',true);
|
||||||
|
$oEditorController->insertComponent('image_link',true);
|
||||||
|
$oEditorController->insertComponent('multimedia_link',true);
|
||||||
|
$oEditorController->insertComponent('image_gallery',true);
|
||||||
|
$oEditorController->insertComponent('quotation',true);
|
||||||
|
$oEditorController->insertComponent('table_maker',true);
|
||||||
|
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,28 @@
|
||||||
function init() {
|
function init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 컴포넌트를 DB에 추가
|
||||||
|
**/
|
||||||
|
function insertComponent($component_name, $enabled = false) {
|
||||||
|
if($enabled) $enabled = 'Y';
|
||||||
|
else $enabled = 'N';
|
||||||
|
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
|
$args->component_name = $component_name;
|
||||||
|
$args->enabled = $enabled;
|
||||||
|
|
||||||
|
// 컴포넌트가 있는지 확인
|
||||||
|
$output = $oDB->executeQuery('editor.isComponentInserted', $args);
|
||||||
|
if($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
|
||||||
|
|
||||||
|
// 입력
|
||||||
|
$args->list_order = $oDB->getNextSequence();
|
||||||
|
$output = $oDB->executeQuery('editor.insertComponent', $args);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행
|
* @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,64 @@
|
||||||
return $oComponent;
|
return $oComponent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief component 목록을 return (DB정보 보함)
|
||||||
|
**/
|
||||||
|
function getComponentList($filter_enabled = true) {
|
||||||
|
if($filter_enabled) $args->enabled = "Y";
|
||||||
|
|
||||||
|
// DB에서 가져옴
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
$output = $oDB->executeQuery('editor.getComponentList', $args);
|
||||||
|
$db_list = $output->data;
|
||||||
|
|
||||||
|
// 파일목록을 구함
|
||||||
|
$downloaded_list = FileHandler::readDir($this->module_path.'components');
|
||||||
|
|
||||||
|
// DB 목록을 loop돌면서 xml정보까지 구함
|
||||||
|
if(!is_array($db_list)) $db_list = array($db_list);
|
||||||
|
foreach($db_list as $component) {
|
||||||
|
if(!$component->component_name) continue;
|
||||||
|
|
||||||
|
$component_name = $component->component_name;
|
||||||
|
|
||||||
|
unset($xml_info);
|
||||||
|
$xml_info = $this->getComponentXmlInfo($component_name);
|
||||||
|
$xml_info->enabled = $component->enabled;
|
||||||
|
|
||||||
|
if($component->extra_vars) {
|
||||||
|
$extra_vars = unserialize($component->extra_vars);
|
||||||
|
foreach($xml_info->extra_vars as $key => $val) {
|
||||||
|
$xml_info->extra_vars->{$key}->value = $extra_vars->{$key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$component_list->{$component_name} = $xml_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
// enabled만 체크하도록 하였으면 그냥 return
|
||||||
|
if($filter_enabled) return $component_list;
|
||||||
|
|
||||||
|
// 다운로드된 목록의 xml_info를 마저 구함
|
||||||
|
foreach($downloaded_list as $component_name) {
|
||||||
|
// 설정된 것이라면 패스
|
||||||
|
if($component_list->{$component_name}) continue;
|
||||||
|
|
||||||
|
// DB에 입력
|
||||||
|
$oEditorController = &getController('editor');
|
||||||
|
$oEditorController->insertComponent($component_name, false);
|
||||||
|
|
||||||
|
// component_list에 추가
|
||||||
|
unset($xml_info);
|
||||||
|
$xml_info = $this->getComponentXmlInfo($component_name);
|
||||||
|
$xml_info->enabled = 'N';
|
||||||
|
|
||||||
|
$component_list->{$component_name} = $xml_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $component_list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief component의 xml정보를 읽음
|
* @brief component의 xml정보를 읽음
|
||||||
**/
|
**/
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,10 @@
|
||||||
**/
|
**/
|
||||||
function adminIndex() {
|
function adminIndex() {
|
||||||
// 컴포넌트의 종류를 구해옴
|
// 컴포넌트의 종류를 구해옴
|
||||||
$component_list = FileHandler::readDir($this->module_path.'components');
|
|
||||||
arsort($component_list);
|
|
||||||
|
|
||||||
$oEditorModel = &getModel('editor');
|
$oEditorModel = &getModel('editor');
|
||||||
foreach($component_list as $component) {
|
$component_list = $oEditorModel->getComponentList(false);
|
||||||
$list[$component] = $xml_doc = $oEditorModel->getComponentXmlInfo($component);
|
|
||||||
}
|
Context::set('component_list', $component_list);
|
||||||
Context::set('component_list', $list);
|
|
||||||
|
|
||||||
$this->setTemplatePath($this->module_path.'tpl');
|
$this->setTemplatePath($this->module_path.'tpl');
|
||||||
$this->setTemplateFile('admin_index');
|
$this->setTemplateFile('admin_index');
|
||||||
|
|
@ -42,8 +38,9 @@
|
||||||
|
|
||||||
// 에디터 컴포넌트를 구함
|
// 에디터 컴포넌트를 구함
|
||||||
if(!Context::get('component_list')) {
|
if(!Context::get('component_list')) {
|
||||||
$component_list = FileHandler::readDir($this->module_path.'components');
|
$oEditorModel = &getModel('editor');
|
||||||
arsort($component_list);
|
$component_list = $oEditorModel->getComponentList();
|
||||||
|
debugPrint($component_list);
|
||||||
Context::set('component_list', $component_list);
|
Context::set('component_list', $component_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,5 @@
|
||||||
$lang->component_description = "설명";
|
$lang->component_description = "설명";
|
||||||
|
|
||||||
$lang->msg_component_is_not_founded = '%s 에디터 컴포넌트를 찾을 수 없습니다';
|
$lang->msg_component_is_not_founded = '%s 에디터 컴포넌트를 찾을 수 없습니다';
|
||||||
|
$lang->msg_component_is_inserted = '선택하신 컴포넌트는 이미 입력되어 있습니다';
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
14
modules/editor/queries/getComponentList.xml
Normal file
14
modules/editor/queries/getComponentList.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<query id="getComponentList" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="editor_components" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="enabled" var="enabled" />
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="list_order" order="asc" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
10
modules/editor/queries/insertComponent.xml
Normal file
10
modules/editor/queries/insertComponent.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<query id="insertComponent" action="insert">
|
||||||
|
<tables>
|
||||||
|
<table name="editor_components" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="component_name" var="component_name" notnull="notnull" />
|
||||||
|
<column name="enabled" var="enabled" default="N" />
|
||||||
|
<column name="list_order" var="list_order" default="sequence()" />
|
||||||
|
</columns>
|
||||||
|
</query>
|
||||||
11
modules/editor/queries/isComponentInserted.xml
Normal file
11
modules/editor/queries/isComponentInserted.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<query id="isComponentInserted" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="editor_components" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="count(*)" alias="count" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="component_name" var="component_name" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
13
modules/editor/queries/updateComponent.xml
Normal file
13
modules/editor/queries/updateComponent.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<query id="updateComponent" action="update">
|
||||||
|
<tables>
|
||||||
|
<table name="editor_components" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="enabled" var="enabled" default="N" />
|
||||||
|
<column name="extra_vars" var="extra_vars" default="N" />
|
||||||
|
<column name="list_order" var="list_order"/>
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="component_name" var="component_name" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
|
|
@ -66,9 +66,9 @@
|
||||||
<div class="editor_area_2">
|
<div class="editor_area_2">
|
||||||
<!-- 컴포넌트 -->
|
<!-- 컴포넌트 -->
|
||||||
<div id="editor_component_{$upload_target_srl}" class="editor_iconbox">
|
<div id="editor_component_{$upload_target_srl}" class="editor_iconbox">
|
||||||
<!--@foreach($component_list as $component)-->
|
<!--@foreach($component_list as $component_name => $component)-->
|
||||||
<!--@if(substr($component,0,11)!="colorpicker")-->
|
<!--@if(substr($component_name,0,11)!="colorpicker")-->
|
||||||
<img src="../components/{$component}/icon.gif" alt="{$component}" class="editor_icon" id="component_{$upload_target_srl}_{$component}" />
|
<img src="../components/{$component_name}/icon.gif" alt="{$component->title}" title="{$component->title}" class="editor_icon" id="component_{$upload_target_srl}_{$component_name}" />
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue