git-svn-id: http://xe-core.googlecode.com/svn/trunk@805 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-30 06:01:24 +00:00
parent 84d0a85ebb
commit df75151c85
79 changed files with 1972 additions and 1919 deletions

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.colorpicker { .colorpicker {
width:160px; width:160px;
padding:5px; padding:5px;

View file

@ -1,3 +1,5 @@
@charset "utf-8";
.colorpicker { .colorpicker {
width:160px; width:160px;
padding:5px; padding:5px;

View file

@ -1,3 +1,5 @@
@charset "utf-8";
.editor_window { .editor_window {
width:300px; width:300px;
text-align:center; text-align:center;

View file

@ -1,3 +1,5 @@
@charset "utf-8";
.editor_window { .editor_window {
width:400px; width:400px;
background-color:#F3F3F3; background-color:#F3F3F3;

View file

@ -10,6 +10,5 @@
</script> </script>
<div align="{$gallery_info->gallery_align}"> <div align="{$gallery_info->gallery_align}">
<div id='zone_list_gallery_{$gallery_info->srl}' style="width:{$gallery_info->width}px;background-color:#{$gallery_info->bg_color};border:{$gallery_info->border_thickness}px solid #{$gallery_info->border_color};text-align:left;"> <div id='zone_list_gallery_{$gallery_info->srl}' style="width:{$gallery_info->width}px;background-color:#{$gallery_info->bg_color};border:{$gallery_info->border_thickness}px solid #{$gallery_info->border_color};text-align:left;"></div>
</div>
</div> </div>

View file

@ -1,3 +1,5 @@
@charset "utf-8";
.editor_window { .editor_window {
width:550px; width:550px;
text-align:center; text-align:center;

View file

@ -3,7 +3,9 @@
<!--%import("../lang")--> <!--%import("../lang")-->
<form action="./" method="get" onSubmit="return false" id="fo"> <form action="./" method="get" onSubmit="return false" id="fo">
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" /> <input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
<div class="editor_window"> <div class="editor_window">
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&amp;act=viewComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div> <div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&amp;act=viewComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.slide_gallery_loading_text { .slide_gallery_loading_text {
color:#555555; color:#555555;
font-size:8pt; font-size:8pt;

View file

@ -3,6 +3,7 @@
<!--%import("../lang")--> <!--%import("../lang")-->
<script type='text/javascript'> <script type='text/javascript'>
// 이미지갤러리에 보여줄 이미지 등록 // 이미지갤러리에 보여줄 이미지 등록
//
<!--@foreach($gallery_info->image_list as $image)--> <!--@foreach($gallery_info->image_list as $image)-->
slide_gallery_add_image({$gallery_info->srl},'{$image}'); slide_gallery_add_image({$gallery_info->srl},'{$image}');
<!--@end--> <!--@end-->

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.editor_window { .editor_window {
width:500px; width:500px;
text-align:center; text-align:center;

View file

@ -30,6 +30,7 @@
{$lang->image_align_normal} {$lang->image_align_normal}
</label> </label>
</div> </div>
<div class="image_align"> <div class="image_align">
<input type="radio" name="align" value="left" id="align_left" /> <input type="radio" name="align" value="left" id="align_left" />
<label for="align_left"> <label for="align_left">
@ -37,6 +38,7 @@
{$lang->image_align_left} {$lang->image_align_left}
</label> </label>
</div> </div>
<div class="image_align"> <div class="image_align">
<input type="radio" name="align" value="middle" id="align_middle" /> <input type="radio" name="align" value="middle" id="align_middle" />
<label for="align_middle"> <label for="align_middle">
@ -44,6 +46,7 @@
{$lang->image_align_middle} {$lang->image_align_middle}
</label> </label>
</div> </div>
<div class="image_align"> <div class="image_align">
<input type="radio" name="align" value="right" id="align_right" /> <input type="radio" name="align" value="right" id="align_right" />
<label for="align_right"> <label for="align_right">

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.editor_window { .editor_window {
width:400px; width:400px;
clear:both; clear:both;

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.editor_window { .editor_window {
width:700px; width:700px;
clear:both; clear:both;

View file

@ -6,6 +6,7 @@
<input type="hidden" id="map_x" name="x" value="" /> <input type="hidden" id="map_x" name="x" value="" />
<input type="hidden" id="map_y" name="x" value="" /> <input type="hidden" id="map_y" name="x" value="" />
<input type="hidden" id="marker" name="marker_1" value="" /> <input type="hidden" id="marker" name="marker_1" value="" />
<div class="editor_window"> <div class="editor_window">
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&amp;act=viewComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div> <div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&amp;act=viewComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.editor_window { .editor_window {
width:555px; width:555px;
text-align:center; text-align:center;

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.editor_window { .editor_window {
width:530px; width:530px;
text-align:center; text-align:center;

View file

@ -30,6 +30,7 @@
<input type="radio" name="width_unit" id="width_unit_pixel" /><label for="width_unit_pixel">px</label> <input type="radio" name="width_unit" id="width_unit_pixel" /><label for="width_unit_pixel">px</label>
</div> </div>
</div> </div>
<div class="item_area"> <div class="item_area">
<div class="header">{$lang->table_cellspacing} :</div> <div class="header">{$lang->table_cellspacing} :</div>
<div class="body"><input type="text" class="table_input" id="cellspacing" value="0" />px</div> <div class="body"><input type="text" class="table_input" id="cellspacing" value="0" />px</div>
@ -70,6 +71,7 @@
printColor("border", "{$tpl_path}/images/blank.gif"); printColor("border", "{$tpl_path}/images/blank.gif");
</script> </script>
</div> </div>
<div class="editor_color_input"> <div class="editor_color_input">
<table border="0" cellspacing="0"> <table border="0" cellspacing="0">
<tr> <tr>

View file

@ -1,3 +1,4 @@
@charset "utf-8";
.editor_window { .editor_window {
width:400px; width:400px;
clear:both; clear:both;

View file

@ -37,11 +37,10 @@
</span> </span>
</div> </div>
</div>
<div class="editor_button_area"> <div class="editor_button_area">
<input type="button" class="editor_button" value="{$lang->cmd_insert}" onclick="setText()" /> <input type="button" class="editor_button" value="{$lang->cmd_insert}" onclick="setText()" />
<input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close()" /> <input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close()" />
</div> </div>
</div>
</form> </form>

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module version="0.1"> <module version="0.1">
<title xml:lang="ko">위지윅 에디터 </title> <title xml:lang="ko">위지윅 에디터 </title>
<title xml:lang="en">editor</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28"> <author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name> <name xml:lang="ko">제로</name>
<name xml:lang="en">zero</name> <description xml:lang="ko">위지윅 에디터를 출력하거나 에디터 컴포넌트들을 관리/중계하는 모듈입니다.</description>
<description xml:lang="ko">위지윅 에디터 출력 및 관리</description>
<description xml:lang="en">editor</description>
</author> </author>
</module> </module>

View file

@ -2,16 +2,18 @@
<module> <module>
<grants /> <grants />
<actions> <actions>
<action name="adminIndex" type="view" standalone="true" admin_index="true" /> <action name="dispEditorPopup" type="view" standalone="true" />
<action name="setupComponent" type="view" standalone="true" /> <action name="dispEditorComponentInfo" type="view" standalone="true" />
<action name="dispPopup" type="view" standalone="true" />
<action name="viewComponentInfo" type="view" standalone="true" />
<action name="procSaveDoc" type="controller" standalone="true" /> <action name="dispEditorAdminIndex" type="view" standalone="true" admin_index="true" />
<action name="procCall" type="controller" standalone="true" /> <action name="dispEditorAdminSetupComponent" type="view" standalone="true" />
<action name="procEnableComponent" type="controller" standalone="true" />
<action name="procDisableComponent" type="controller" standalone="true" /> <action name="procEditorSaveDoc" type="controller" standalone="true" />
<action name="procMoveListOrder" type="controller" standalone="true" /> <action name="procEditorCall" type="controller" standalone="true" />
<action name="procSetupComponent" type="controller" standalone="true" />
<action name="procEditorAdminEnableComponent" type="controller" standalone="true" />
<action name="procEditorAdminDisableComponent" type="controller" standalone="true" />
<action name="procEditorAdminMoveListOrder" type="controller" standalone="true" />
<action name="procEditorAdminSetupComponent" type="controller" standalone="true" />
</actions> </actions>
</module> </module>

View file

@ -11,8 +11,14 @@
* @brief 설치시 추가 작업이 필요할시 구현 * @brief 설치시 추가 작업이 필요할시 구현
**/ **/
function moduleInstall() { function moduleInstall() {
// 에디터 모듈에서 사용할 디렉토리 생성 // action forward에 등록 (관리자 모드에서 사용하기 위함)
FileHandler::makeDir('./files/cache/editor'); $oModuleController = &getController('module');
$oModuleController->insertActionFoward('editor', 'view', 'dispEditorAdminIndex');
$oModuleController->insertActionFoward('editor', 'view', 'dispEditorAdminSetupComponent');
$oModuleController->insertActionFoward('editor', 'controller', 'procEditorAdminEnableComponent');
$oModuleController->insertActionFoward('editor', 'controller', 'procEditorAdminDisableComponent');
$oModuleController->insertActionFoward('editor', 'controller', 'procEditorAdminMoveListOrder');
$oModuleController->insertActionFoward('editor', 'controller', 'procEditorAdminSetupComponent');
// 기본 에디터 컴포넌트를 추가 // 기본 에디터 컴포넌트를 추가
$oEditorController = &getController('editor'); $oEditorController = &getController('editor');
@ -26,6 +32,9 @@
$oEditorController->insertComponent('quotation',true); $oEditorController->insertComponent('quotation',true);
$oEditorController->insertComponent('table_maker',true); $oEditorController->insertComponent('table_maker',true);
// 에디터 모듈에서 사용할 디렉토리 생성
FileHandler::makeDir('./files/cache/editor');
return new Object(); return new Object();
} }

View file

@ -16,7 +16,7 @@
/** /**
* @brief 자동 저장 * @brief 자동 저장
**/ **/
function procSaveDoc() { function procEditorSaveDoc() {
$this->deleteSavedDoc(); $this->deleteSavedDoc();
@ -41,6 +41,120 @@
$this->setMessage('msg_auto_saved'); $this->setMessage('msg_auto_saved');
} }
/**
* @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행
**/
function procEditorCall() {
$component = Context::get('component');
$method = Context::get('method');
if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$oEditorModel = &getModel('editor');
$oComponent = &$oEditorModel->getComponentObject($component);
if(!$oComponent->toBool()) return $oComponent;
if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$output = call_user_method($method, $oComponent);
if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output;
$this->setError($oComponent->getError());
$this->setMessage($oComponent->getMessage());
$vars = $oComponent->getVariables();
if(count($vars)) {
foreach($vars as $key=>$val) $this->add($key, $val);
}
}
/**
* @brief 컴포넌트의 활성화
**/
function procEditorAdminEnableComponent() {
$args->component_name = Context::get('component_name');
$args->enabled = 'Y';
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.updateComponent', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트의 비활성화
**/
function procEditorAdminDisableComponent() {
$args->component_name = Context::get('component_name');
$args->enabled = 'N';
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.updateComponent', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트의 위치 변경
**/
function procEditorAdminMoveListOrder() {
$args->component_name = Context::get('component_name');
$mode = Context::get('mode');
// DB에서 전체 목록 가져옴
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.getComponentList', $args);
$db_list = $output->data;
foreach($db_list as $key => $val) {
if($val->component_name == $args->component_name) break;
}
if($mode=="up") {
if($key == 2) return new Object(-1,'msg_component_is_first_order');
$prev_args->component_name = $db_list[$key-1]->component_name;
$prev_args->list_order = $db_list[$key]->list_order;
$oDB->executeQuery('editor.updateComponent', $prev_args);
$cur_args->component_name = $db_list[$key]->component_name;
$cur_args->list_order = $db_list[$key-1]->list_order;
$oDB->executeQuery('editor.updateComponent', $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;
$oDB->executeQuery('editor.updateComponent', $next_args);
$cur_args->component_name = $db_list[$key]->component_name;
$cur_args->list_order = $db_list[$key+1]->list_order;
$oDB->executeQuery('editor.updateComponent', $cur_args);
}
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트 설정
**/
function procEditorAdminSetupComponent() {
$component_name = Context::get('component_name');
$extra_vars = Context::getRequestVars();
unset($extra_vars->component_name);
unset($extra_vars->module);
unset($extra_vars->act);
$args->component_name = $component_name;
$args->extra_vars = serialize($extra_vars);
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.updateComponent', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_updated');
}
/** /**
* @brief 자동 저장된 글을 삭제 * @brief 자동 저장된 글을 삭제
* 현재 접속한 사용자를 기준 * 현재 접속한 사용자를 기준
@ -79,119 +193,5 @@
$output = $oDB->executeQuery('editor.insertComponent', $args); $output = $oDB->executeQuery('editor.insertComponent', $args);
return $output; return $output;
} }
/**
* @brief 컴포넌트의 활성화
**/
function procEnableComponent() {
$args->component_name = Context::get('component_name');
$args->enabled = 'Y';
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.updateComponent', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트의 비활성화
**/
function procDisableComponent() {
$args->component_name = Context::get('component_name');
$args->enabled = 'N';
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.updateComponent', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트의 위치 변경
**/
function procMoveListOrder() {
$args->component_name = Context::get('component_name');
$mode = Context::get('mode');
// DB에서 전체 목록 가져옴
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.getComponentList', $args);
$db_list = $output->data;
foreach($db_list as $key => $val) {
if($val->component_name == $args->component_name) break;
}
if($mode=="up") {
if($key == 2) return new Object(-1,'msg_component_is_first_order');
$prev_args->component_name = $db_list[$key-1]->component_name;
$prev_args->list_order = $db_list[$key]->list_order;
$oDB->executeQuery('editor.updateComponent', $prev_args);
$cur_args->component_name = $db_list[$key]->component_name;
$cur_args->list_order = $db_list[$key-1]->list_order;
$oDB->executeQuery('editor.updateComponent', $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;
$oDB->executeQuery('editor.updateComponent', $next_args);
$cur_args->component_name = $db_list[$key]->component_name;
$cur_args->list_order = $db_list[$key+1]->list_order;
$oDB->executeQuery('editor.updateComponent', $cur_args);
}
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트 설정
**/
function procSetupComponent() {
$component_name = Context::get('component_name');
$extra_vars = Context::getRequestVars();
unset($extra_vars->component_name);
unset($extra_vars->module);
unset($extra_vars->act);
$args->component_name = $component_name;
$args->extra_vars = serialize($extra_vars);
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('editor.updateComponent', $args);
if(!$output->toBool()) return $output;
$this->setMessage('success_updated');
}
/**
* @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행
**/
function procCall() {
$component = Context::get('component');
$method = Context::get('method');
if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$oEditorModel = &getModel('editor');
$oComponent = &$oEditorModel->getComponentObject($component);
if(!$oComponent->toBool()) return $oComponent;
if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$output = call_user_method($method, $oComponent);
if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output;
$this->setError($oComponent->getError());
$this->setMessage($oComponent->getMessage());
$vars = $oComponent->getVariables();
if(count($vars)) {
foreach($vars as $key=>$val) $this->add($key, $val);
}
}
} }
?> ?>

View file

@ -13,11 +13,59 @@
function init() { function init() {
} }
/**
* @brief 컴포넌트의 팝업 출력을 요청을 받는 action
**/
function dispEditorPopup() {
// css 파일 추가
Context::addCssFile($this->module_path."tpl/css/editor.css");
// 변수 정리
$upload_target_srl = Context::get('upload_target_srl');
$component = Context::get('component');
// component 객체를 받음
$oEditorModel = &getModel('editor');
$oComponent = &$oEditorModel->getComponentObject($component, $upload_target_srl);
if(!$oComponent->toBool()) {
Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('component_not_founded');
} else {
// 컴포넌트의 popup url을 출력하는 method실행후 결과를 받음
$popup_content = $oComponent->getPopupContent();
Context::set('popup_content', $popup_content);
// 레이아웃을 popup_layout으로 설정
$this->setLayoutFile('popup_layout');
// 템플릿 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('popup');
}
}
/**
* @brief 컴퍼넌트 정보 보기
**/
function dispEditorComponentInfo() {
$component_name = Context::get('component_name');
$oEditorModel = &getModel('editor');
$component = $oEditorModel->getComponent($component_name);
Context::set('component', $component);
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('view_component');
$this->setLayoutFile("popup_layout");
}
/** /**
* @brief 관리자 설정 페이지 * @brief 관리자 설정 페이지
* 에디터 컴포넌트의 on/off 설정을 담당 * 에디터 컴포넌트의 on/off 설정을 담당
**/ **/
function adminIndex() { function dispEditorAdminIndex() {
// 컴포넌트의 종류를 구해옴 // 컴포넌트의 종류를 구해옴
$oEditorModel = &getModel('editor'); $oEditorModel = &getModel('editor');
$component_list = $oEditorModel->getComponentList(false); $component_list = $oEditorModel->getComponentList(false);
@ -31,7 +79,7 @@
/** /**
* @brief 컴퍼넌트 setup * @brief 컴퍼넌트 setup
**/ **/
function setupComponent() { function dispEditorAdminSetupComponent() {
$component_name = Context::get('component_name'); $component_name = Context::get('component_name');
$oEditorModel = &getModel('editor'); $oEditorModel = &getModel('editor');
@ -43,22 +91,6 @@
$this->setLayoutFile("popup_layout"); $this->setLayoutFile("popup_layout");
} }
/**
* @brief 컴퍼넌트 정보 보기
**/
function viewComponentInfo() {
$component_name = Context::get('component_name');
$oEditorModel = &getModel('editor');
$component = $oEditorModel->getComponent($component_name);
Context::set('component', $component);
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('view_component');
$this->setLayoutFile("popup_layout");
}
/** /**
* @brief 에디터를 return * @brief 에디터를 return
**/ **/
@ -94,37 +126,5 @@
return $oTemplate->compile($tpl_path, $tpl_file); return $oTemplate->compile($tpl_path, $tpl_file);
} }
/**
* @brief 컴포넌트의 팝업 출력을 요청을 받는 action
**/
function dispPopup() {
// css 파일 추가
Context::addCssFile($this->module_path."tpl/css/editor.css");
// 변수 정리
$upload_target_srl = Context::get('upload_target_srl');
$component = Context::get('component');
// component 객체를 받음
$oEditorModel = &getModel('editor');
$oComponent = &$oEditorModel->getComponentObject($component, $upload_target_srl);
if(!$oComponent->toBool()) {
Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('component_not_founded');
} else {
// 컴포넌트의 popup url을 출력하는 method실행후 결과를 받음
$popup_content = $oComponent->getPopupContent();
Context::set('popup_content', $popup_content);
// 레이아웃을 popup_layout으로 설정
$this->setLayoutFile('popup_layout');
// 템플릿 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('popup');
}
}
} }
?> ?>

View file

@ -11,6 +11,7 @@
<th>{$lang->use}</th> <th>{$lang->use}</th>
<th colspan="2">{$lang->cmd_move}</th> <th colspan="2">{$lang->cmd_move}</th>
</tr> </tr>
<!--@foreach($component_list as $component_name => $xml_info)--> <!--@foreach($component_list as $component_name => $xml_info)-->
<tr> <tr>
<td rowspan="2">{$xml_info->title}<br />({$component_name})</td> <td rowspan="2">{$xml_info->title}<br />({$component_name})</td>
@ -37,4 +38,5 @@
<td colspan="7">{nl2br($xml_info->description)}</td> <td colspan="7">{nl2br($xml_info->description)}</td>
</tr> </tr>
<!--@end--> <!--@end-->
</table> </table>

View file

@ -1,3 +1,5 @@
@charset "utf-8";
div.editor_content { div.editor_content {
margin:3px; margin:3px;
} }

View file

@ -17,8 +17,8 @@
<!-- 에디터 --> <!-- 에디터 -->
<div class="editor_content"> <div class="editor_content">
<div class="editor_area_1"> <div class="editor_area_1">
<!-- 폰트 종류와 크기 --> <!-- 폰트 종류와 크기 -->
<div class="editor_fontbox"> <div class="editor_fontbox">
<select onChange="editorChangeFontName(this,'{$upload_target_srl}')" id="editor_font_{$upload_target_srl}"> <select onChange="editorChangeFontName(this,'{$upload_target_srl}')" id="editor_font_{$upload_target_srl}">
@ -27,6 +27,7 @@
<option style="font-family:{$obj}" value="{$obj}">{$obj}</option> <option style="font-family:{$obj}" value="{$obj}">{$obj}</option>
<!--@end--> <!--@end-->
</select> </select>
<select onChange="editorChangeFontSize(this,'{$upload_target_srl}')" id="editor_fontsize_{$upload_target_srl}"> <select onChange="editorChangeFontSize(this,'{$upload_target_srl}')" id="editor_fontsize_{$upload_target_srl}">
<option value="" selected>{$lang->edit->fontsize}</option> <option value="" selected>{$lang->edit->fontsize}</option>
<option value="1">8pt</option> <option value="1">8pt</option>
@ -37,6 +38,7 @@
<option value="6">24pt</option> <option value="6">24pt</option>
<option value="7">36pt</option> <option value="7">36pt</option>
</select> </select>
<select onChange="editorChangeHeader(this,'{$upload_target_srl}')" id="editor_header_{$upload_target_srl}"> <select onChange="editorChangeHeader(this,'{$upload_target_srl}')" id="editor_header_{$upload_target_srl}">
<option value="">{$lang->edit->header}</option> <option value="">{$lang->edit->header}</option>
<!--@foreach($lang->edit->header_list as $key=>$obj)--> <!--@foreach($lang->edit->header_list as $key=>$obj)-->
@ -100,7 +102,7 @@
<div class="editor_uploader_box"> <div class="editor_uploader_box">
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" /> <input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
<input type="hidden" name="act" value="procUploadFile" /> <input type="hidden" name="act" value="procFileUploadFile" />
<!-- 미리보기 --> <!-- 미리보기 -->
<div class="editor_preview_uploaded" id="preview_uploaded_{$upload_target_srl}"><img src="./images/blank.gif" width="100" height="100" alt="preview" /></div> <div class="editor_preview_uploaded" id="preview_uploaded_{$upload_target_srl}"><img src="./images/blank.gif" width="100" height="100" alt="preview" /></div>

View file

@ -1,4 +1,4 @@
<filter name="setup_component" module="editor" act="procSetupComponent" confirm_msg_code="confirm_submit"> <filter name="setup_component" module="editor" act="procEditorAdminSetupComponent" confirm_msg_code="confirm_submit">
<form /> <form />
<parameter /> <parameter />
<response> <response>

View file

@ -1,15 +1,21 @@
/**
* @author zero (zero@nzeo.com)
* @version 0.1
* @brief 에디터 관리자 페이지용 스크립트
**/
function doEnableComponent(component_name) { function doEnableComponent(component_name) {
var params = new Array(); var params = new Array();
params['component_name'] = component_name; params['component_name'] = component_name;
exec_xml('editor', 'procEnableComponent', params, completeUpdate); exec_xml('editor', 'procEditorAdminEnableComponent', params, completeUpdate);
} }
function doDisableComponent(component_name) { function doDisableComponent(component_name) {
var params = new Array(); var params = new Array();
params['component_name'] = component_name; params['component_name'] = component_name;
exec_xml('editor', 'procDisableComponent', params, completeUpdate); exec_xml('editor', 'procEditorAdminDisableComponent', params, completeUpdate);
} }
function doMoveListOrder(component_name, mode) { function doMoveListOrder(component_name, mode) {
@ -17,7 +23,7 @@ function doMoveListOrder(component_name, mode) {
params['component_name'] = component_name; params['component_name'] = component_name;
params['mode'] = mode; params['mode'] = mode;
exec_xml('editor', 'procMoveListOrder', params, completeUpdate); exec_xml('editor', 'procEditorAdminMoveListOrder', params, completeUpdate);
} }
function completeUpdate(ret_obj) { function completeUpdate(ret_obj) {
@ -26,5 +32,5 @@ function completeUpdate(ret_obj) {
} }
function doSetupComponent(component_name) { function doSetupComponent(component_name) {
winopen("./?module=editor&act=setupComponent&component_name="+component_name, "SetupComponent","width=10,height=10,scrollbars=no,resizable=no,toolbars=no"); winopen("./?module=editor&act=dispEditorAdminSetupComponent&component_name="+component_name, "SetupComponent","width=10,height=10,scrollbars=no,resizable=no,toolbars=no");
} }

View file

@ -368,7 +368,7 @@ function editorEventCheck(evt) {
// 컴포넌트 팝업 열기 // 컴포넌트 팝업 열기
function openComponent(component_name, upload_target_srl, manual_url) { function openComponent(component_name, upload_target_srl, manual_url) {
editorPrevSrl = upload_target_srl; editorPrevSrl = upload_target_srl;
var popup_url = "./?module=editor&act=dispPopup&upload_target_srl="+upload_target_srl+"&component="+component_name; var popup_url = "./?module=editor&act=dispEditorPopup&upload_target_srl="+upload_target_srl+"&component="+component_name;
if(typeof(manual_url)!="undefined" && manual_url) popup_url += "&manual_url="+escape(manual_url); if(typeof(manual_url)!="undefined" && manual_url) popup_url += "&manual_url="+escape(manual_url);
winopen(popup_url, 'editorComponent', 'left=10,top=10,width=10,height=10,toolbars=no,scrollbars=no'); winopen(popup_url, 'editorComponent', 'left=10,top=10,width=10,height=10,toolbars=no,scrollbars=no');
@ -396,7 +396,7 @@ function editorSearchComponent(evt) {
var upload_target_srl = tobj.getAttribute("upload_target_srl"); var upload_target_srl = tobj.getAttribute("upload_target_srl");
var plugin = obj.getAttribute("plugin"); var plugin = obj.getAttribute("plugin");
editorPrevNode = obj; editorPrevNode = obj;
winopen("?module=plugin&act=dispGenerateCodeInPage&selected_plugin="+plugin+"&module_srl="+upload_target_srl,'GenerateCodeInPage','left=10,top10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no'); winopen("?module=plugin&act=dispPluginGenerateCodeInPage&selected_plugin="+plugin+"&module_srl="+upload_target_srl,'GenerateCodeInPage','left=10,top10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');
return; return;
} }

View file

@ -59,7 +59,7 @@ function editor_upload_form_set(upload_target_srl) {
var document_srl = ""; var document_srl = "";
if(fo_obj["document_srl"]) document_srl = fo_obj.document_srl.value; if(fo_obj["document_srl"]) document_srl = fo_obj.document_srl.value;
var url = "./?act=procDeleteFile&upload_target_srl="+upload_target_srl; var url = "./?act=procFileDeleteFile&upload_target_srl="+upload_target_srl;
if(module) url+="&module="+module; if(module) url+="&module="+module;
if(mid) url+="&mid="+mid; if(mid) url+="&mid="+mid;
if(document_srl) url+="&document_srl="+document_srl; if(document_srl) url+="&document_srl="+document_srl;
@ -130,15 +130,19 @@ function editor_preview(sel_obj, upload_target_srl) {
// 플래쉬 동영상의 경우 // 플래쉬 동영상의 경우
if(/\.flv$/i.test(uploaded_filename)) { if(/\.flv$/i.test(uploaded_filename)) {
html = "<EMBED src=\"./common/tpl/images/flvplayer.swf?autoStart=false&file="+uploaded_filename+"\" width=\"110\" height=\"110\" type=\"application/x-shockwave-flash\"></EMBED>"; html = "<EMBED src=\"./common/tpl/images/flvplayer.swf?autoStart=false&file="+uploaded_filename+"\" width=\"110\" height=\"110\" type=\"application/x-shockwave-flash\"></EMBED>";
// 플래쉬 파일의 경우 // 플래쉬 파일의 경우
} else if(/\.swf$/i.test(uploaded_filename)) { } else if(/\.swf$/i.test(uploaded_filename)) {
html = "<EMBED src=\""+uploaded_filename+"\" width=\"110\" height=\"110\" type=\"application/x-shockwave-flash\"></EMBED>"; html = "<EMBED src=\""+uploaded_filename+"\" width=\"110\" height=\"110\" type=\"application/x-shockwave-flash\"></EMBED>";
// wmv, avi, mpg, mpeg등의 동영상 파일의 경우 // wmv, avi, mpg, mpeg등의 동영상 파일의 경우
} else if(/\.(wmv|avi|mpg|mpeg|asx|asf|mp3)$/i.test(uploaded_filename)) { } else if(/\.(wmv|avi|mpg|mpeg|asx|asf|mp3)$/i.test(uploaded_filename)) {
html = "<EMBED src=\""+uploaded_filename+"\" width=\"110\" height=\"110\" autostart=\"true\" Showcontrols=\"0\"></EMBED>"; html = "<EMBED src=\""+uploaded_filename+"\" width=\"110\" height=\"110\" autostart=\"true\" Showcontrols=\"0\"></EMBED>";
// 이미지 파일의 경우 // 이미지 파일의 경우
} else if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) { } else if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) {
html = "<img src=\""+uploaded_filename+"\" border=\"0\" width=\"110\" height=\"110\" />"; html = "<img src=\""+uploaded_filename+"\" border=\"0\" width=\"110\" height=\"110\" />";
} }
xInnerHtml(preview_obj, html); xInnerHtml(preview_obj, html);
} }
@ -155,7 +159,7 @@ function editor_remove_file(upload_target_srl) {
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; } while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value; var mid = fo_obj.mid.value;
var upload_target_srl = fo_obj.upload_target_srl.value; var upload_target_srl = fo_obj.upload_target_srl.value;
var url = "./?mid="+mid+"&act=procDeleteFile&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl; var url = "./?mid="+mid+"&act=procFileDeleteFile&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl;
// iframe에 url을 보내버림 // iframe에 url을 보내버림
var iframe_obj = xGetElementById('tmp_upload_iframe'); var iframe_obj = xGetElementById('tmp_upload_iframe');
@ -177,7 +181,6 @@ function editor_insert_file(upload_target_srl) {
// 바로 링크 가능한 파일의 경우 (이미지, 플래쉬, 동영상 등..) // 바로 링크 가능한 파일의 경우 (이미지, 플래쉬, 동영상 등..)
if(uploaded_filename) { if(uploaded_filename) {
// 이미지 파일의 경우 image_link 컴포넌트 열결 // 이미지 파일의 경우 image_link 컴포넌트 열결
if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) { if(/\.(jpg|jpeg|png|gif)$/i.test(uploaded_filename)) {
openComponent("image_link", upload_target_srl, uploaded_filename); openComponent("image_link", upload_target_srl, uploaded_filename);
@ -193,7 +196,7 @@ function editor_insert_file(upload_target_srl) {
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; } while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
var mid = fo_obj.mid.value; var mid = fo_obj.mid.value;
var upload_target_srl = fo_obj.upload_target_srl.value; var upload_target_srl = fo_obj.upload_target_srl.value;
var url = "./?module=file&amp;act=procDownload&amp;file_srl="+file_srl+"&amp;sid="+sid; var url = "./?module=file&amp;act=procFileDownload&amp;file_srl="+file_srl+"&amp;sid="+sid;
openComponent("url_link", upload_target_srl, url); openComponent("url_link", upload_target_srl, url);
} }
} }

View file

@ -20,6 +20,7 @@
<tr> <tr>
<th colspan="2">{$lang->component_extra_vars}</th> <th colspan="2">{$lang->component_extra_vars}</th>
</tr> </tr>
<!--@foreach($component->extra_vars as $key => $val)--> <!--@foreach($component->extra_vars as $key => $val)-->
<tr> <tr>
<th rowspan="2">{$val->title}</th> <th rowspan="2">{$val->title}</th>
@ -29,6 +30,7 @@
<td>{$val->description}</td> <td>{$val->description}</td>
</tr> </tr>
<!--@end--> <!--@end-->
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input type="submit" value="{$lang->cmd_apply}" class="editor_button" /> <input type="submit" value="{$lang->cmd_apply}" class="editor_button" />

View file

@ -2,6 +2,7 @@
<div class="component_view_window"> <div class="component_view_window">
<input type="hidden" name="component_name" value="{$component_name}" /> <input type="hidden" name="component_name" value="{$component_name}" />
<table border="1" width="100%"> <table border="1" width="100%">
<tr> <tr>
<th>{$lang->component_name}</th> <th>{$lang->component_name}</th>

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module version="0.1"> <module version="0.1">
<title xml:lang="ko">파일</title> <title xml:lang="ko">첨부파일</title>
<title xml:lang="en">file</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28"> <author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name> <name xml:lang="ko">제로</name>
<name xml:lang="en">zero</name> <description xml:lang="ko">첨부 파일 관리 모듈</description>
<description xml:lang="ko">파일 관리 모듈</description>
<description xml:lang="en">file manager</description>
</author> </author>
</module> </module>

View file

@ -2,8 +2,9 @@
<module> <module>
<grants /> <grants />
<actions> <actions>
<action name="dispList" type="view" admin_index="true" standalone="true" /> <action name="dispFileAdminList" type="view" admin_index="true" standalone="true" />
<action name="procDownload" type="model" standalone="true" />
<action name="procDeleteChecked" type="controller" standalone="true" /> <action name="procFileDownload" type="model" standalone="true" />
<action name="procFileAdminDeleteChecked" type="controller" standalone="true" />
</actions> </actions>
</module> </module>

View file

@ -11,6 +11,12 @@
* @brief 설치시 추가 작업이 필요할시 구현 * @brief 설치시 추가 작업이 필요할시 구현
**/ **/
function moduleInstall() { function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionFoward('file', 'view', 'dispFileAdminList');
$oModuleController->insertActionFoward('file', 'controller', 'dispFileDownload');
$oModuleController->insertActionFoward('file', 'controller', 'dispFileAdminDeleteChecked');
// file 모듈에서 사용할 디렉토리 생성 // file 모듈에서 사용할 디렉토리 생성
FileHandler::makeDir('./files/attach/images'); FileHandler::makeDir('./files/attach/images');
FileHandler::makeDir('./files/attach/binaries'); FileHandler::makeDir('./files/attach/binaries');

View file

@ -213,7 +213,7 @@
/** /**
* @brief 관리자 페이지에서 선택된 파일들을 삭제 * @brief 관리자 페이지에서 선택된 파일들을 삭제
**/ **/
function procDeleteChecked() { function procFileAdminDeleteChecked() {
// 선택된 글이 없으면 오류 표시 // 선택된 글이 없으면 오류 표시
$cart = Context::get('cart'); $cart = Context::get('cart');
if(!$cart) return $this->stop('msg_cart_is_null'); if(!$cart) return $this->stop('msg_cart_is_null');

View file

@ -16,7 +16,7 @@
/** /**
* @brief 목록 출력 (관리자용) * @brief 목록 출력 (관리자용)
**/ **/
function dispList() { function dispFileAdminList() {
// 목록을 구하기 위한 옵션 // 목록을 구하기 위한 옵션
$args->page = Context::get('page'); ///< 페이지 $args->page = Context::get('page'); ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수 $args->list_count = 50; ///< 한페이지에 보여줄 글 수