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

This commit is contained in:
zero 2007-03-30 06:54:22 +00:00
parent ad822f2fc0
commit 9b79db480a
42 changed files with 298 additions and 293 deletions

View file

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

View file

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<actions>
<action name="dispContent" type="view" standalone="true" admin_index="true" />
<action name="dispModuleList" type="view" standalone="true" />
<action name="dispCategory" type="view" standalone="true" />
<action name="dispModuleInfo" type="view" standalone="true" />
<action name="dispModuleAdminContent" type="view" standalone="true" admin_index="true" />
<action name="dispModuleAdminList" type="view" standalone="true" />
<action name="dispModuleAdminCategory" type="view" standalone="true" />
<action name="dispModuleAdminInfo" type="view" standalone="true" />
<action name="procInsertCategory" type="controller" standalone="true" />
<action name="procUpdateCategory" type="controller" standalone="true" />
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" />
<action name="procModuleAdminUpdateCategory" type="controller" standalone="true" />
</actions>
</module>

View file

@ -11,6 +11,15 @@
* @brief 설치시 추가 작업이 필요할시 구현
**/
function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionFoward('module', 'view', 'dispModuleAdminContent');
$oModuleController->insertActionFoward('module', 'view', 'dispModuleAdminList');
$oModuleController->insertActionFoward('module', 'view', 'dispModuleAdminCategory');
$oModuleController->insertActionFoward('module', 'view', 'dispModuleAdminInfo');
$oModuleController->insertActionFoward('module', 'controller', 'procModuleAdminInsertCategory');
$oModuleController->insertActionFoward('module', 'controller', 'procModuleAdminUpdateCategory');
// module 모듈에서 사용할 디렉토리 생성
FileHandler::makeDir('./files/cache/module_info');

View file

@ -13,6 +13,40 @@
function init() {
}
/**
* @brief 모듈 카테고리 추가
**/
function procModuleAdminInsertCategory() {
$oDB = &DB::getInstance();
$args->title = Context::get('title');
$output = $oDB->executeQuery('module.insertModuleCategory', $args);
if(!$output->toBool()) return $output;
$this->setMessage("success_registed");
}
/**
* @brief 카테고리의 내용 수정
**/
function procModuleAdminUpdateCategory() {
$mode = Context::get('mode');
switch($mode) {
case 'delete' :
$output = $this->doDeleteModuleCategory();
$msg_code = 'success_deleted';
break;
case 'update' :
$output = $this->doUpdateModuleCategory();
$msg_code = 'success_updated';
break;
}
if(!$output->toBool()) return $output;
$this->setMessage($msg_code);
}
/**
* @brief 기본 모듈 생성
**/
@ -199,23 +233,10 @@
return $output;
}
/**
* @brief 모듈 카테고리 추가
**/
function procInsertCategory() {
$oDB = &DB::getInstance();
$args->title = Context::get('title');
$output = $oDB->executeQuery('module.insertModuleCategory', $args);
if(!$output->toBool()) return $output;
$this->setMessage("success_registed");
}
/**
* @brief 모듈 카테고리의 제목 변경
**/
function procUpdateModuleCategory() {
function doUpdateModuleCategory() {
$oDB = &DB::getInstance();
$args->title = Context::get('title');
@ -226,33 +247,11 @@
/**
* @brief 모듈 카테고리 삭제
**/
function procDeleteModuleCategory() {
function doDeleteModuleCategory() {
$oDB = &DB::getInstance();
$args->module_category_srl = Context::get('module_category_srl');
return $oDB->executeQuery('module.deleteModuleCategory', $args);
}
/**
* @brief 카테고리의 내용 수정
**/
function procUpdateCategory() {
$mode = Context::get('mode');
switch($mode) {
case 'delete' :
$output = $this->procDeleteModuleCategory();
$msg_code = 'success_deleted';
break;
case 'update' :
$output = $this->procUpdateModuleCategory();
$msg_code = 'success_updated';
break;
}
if(!$output->toBool()) return $output;
$this->setMessage($msg_code);
}
}
?>

View file

@ -18,14 +18,14 @@
/**
* @brief 모듈 관리자 페이지
**/
function dispContent() {
function dispModuleAdminContent() {
$this->dispModuleList();
}
/**
* @brief 모듈 목록 출력
**/
function dispModuleList() {
function dispModuleAdminList() {
// 모듈 목록을 구해서
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModuleList();
@ -38,7 +38,7 @@
/**
* @brief 모듈의 상세 정보(conf/info.xml) 팝업 출력
**/
function dispModuleInfo() {
function dispModuleAdminInfo() {
// 모듈 목록을 구해서
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module'));
@ -54,7 +54,7 @@
/**
* @brief 모듈 카테고리 목록
**/
function dispCategory() {
function dispModuleAdminCategory() {
$module_category_srl = Context::get('module_category_srl');
// 모듈 목록을 구해서

View file

@ -1,8 +1,8 @@
<query id="clearDefaultModule" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="is_default" var="is_default" default="N" />
</columns>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="is_default" var="is_default" default="N" />
</columns>
</query>

View file

@ -1,8 +1,8 @@
<query id="deleteModule" action="delete">
<tables>
<table name="modules" />
</tables>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
</conditions>
<tables>
<table name="modules" />
</tables>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -1,8 +1,8 @@
<query id="deleteModuleCategory" action="delete">
<tables>
<table name="module_categories" />
</tables>
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
<tables>
<table name="module_categories" />
</tables>
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,8 +1,8 @@
<query id="deleteModuleConfig" action="delete">
<tables>
<table name="module_config" />
</tables>
<conditions>
<condition operation="equal" column="module" var="module" notnull="notnull" />
</conditions>
<tables>
<table name="module_config" />
</tables>
<conditions>
<condition operation="equal" column="module" var="module" notnull="notnull" />
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="getDefaultMidInfo" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="is_default" default="Y" />
</conditions>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="is_default" default="Y" />
</conditions>
</query>

View file

@ -1,12 +1,12 @@
<query id="getMidInfo" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" />
<condition operation="equal" column="module_srl" var="module_srl" pipe="and" />
</conditions>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" />
<condition operation="equal" column="module_srl" var="module_srl" pipe="and" />
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="getMidList" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<navigation>
<index var="sort_index" default="mid" order="asc" />
</navigation>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<navigation>
<index var="sort_index" default="mid" order="asc" />
</navigation>
</query>

View file

@ -1,6 +1,6 @@
<query id="getModuleCategories" action="select">
<tables>
<table name="module_categories" />
</tables>
<columns />
<tables>
<table name="module_categories" />
</tables>
<columns />
</query>

View file

@ -1,9 +1,9 @@
<query id="selectModuleCategory" action="select">
<tables>
<table name="module_categories" />
</tables>
<columns />
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
<tables>
<table name="module_categories" />
</tables>
<columns />
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="getModuleConfig" action="select">
<tables>
<table name="module_config" />
</tables>
<columns>
<column name="config" />
</columns>
<conditions>
<condition operation="equal" column="module" var="module" />
</conditions>
<tables>
<table name="module_config" />
</tables>
<columns>
<column name="config" />
</columns>
<conditions>
<condition operation="equal" column="module" var="module" />
</conditions>
</query>

View file

@ -1,26 +1,26 @@
<query id="getModuleInfoByDocument" action="select">
<tables>
<table name="modules" />
<table name="documents" />
</tables>
<columns>
<column name="modules.module_srl" alias="module_srl" />
<column name="modules.mid" alias="mid" />
<column name="modules.browser_title" alias="browser_title" />
<column name="modules.description" alias="description" />
<column name="modules.module" alias="module" />
<column name="modules.is_default" alias="is_default" />
<column name="modules.menu_srl" alias="menu_srl" />
<column name="modules.extra_vars" alias="extra_vars" />
<column name="modules.layout_srl" alias="layout_srl" />
<column name="modules.grants" alias="grants" />
<column name="modules.admin_id" alias="admin_id" />
<column name="modules.header_text" alias="header_text" />
<column name="modules.footer_text" alias="footer_text" />
<column name="modules.regdate" alias="regdate" />
</columns>
<conditions>
<condition operation="equal" column="documents.document_srl" var="document_srl" notnull="notnull" />
<condition operation="equal" column="modules.module_srl" var="documents.module_srl" pipe="and" />
</conditions>
<tables>
<table name="modules" />
<table name="documents" />
</tables>
<columns>
<column name="modules.module_srl" alias="module_srl" />
<column name="modules.mid" alias="mid" />
<column name="modules.browser_title" alias="browser_title" />
<column name="modules.description" alias="description" />
<column name="modules.module" alias="module" />
<column name="modules.is_default" alias="is_default" />
<column name="modules.menu_srl" alias="menu_srl" />
<column name="modules.extra_vars" alias="extra_vars" />
<column name="modules.layout_srl" alias="layout_srl" />
<column name="modules.grants" alias="grants" />
<column name="modules.admin_id" alias="admin_id" />
<column name="modules.header_text" alias="header_text" />
<column name="modules.footer_text" alias="footer_text" />
<column name="modules.regdate" alias="regdate" />
</columns>
<conditions>
<condition operation="equal" column="documents.document_srl" var="document_srl" notnull="notnull" />
<condition operation="equal" column="modules.module_srl" var="documents.module_srl" pipe="and" />
</conditions>
</query>

View file

@ -1,8 +1,8 @@
<query id="getModuleInfoByModuleSrl" action="select">
<tables>
<table name="modules" />
</tables>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" notnull="notnull" />
</conditions>
<tables>
<table name="modules" />
</tables>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" notnull="notnull" />
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="getModuleSrlByMid" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="module_srl" />
</columns>
<conditions>
<condition operation="in" column="mid" var="mid" notnull="notnull" />
</conditions>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="module_srl" />
</columns>
<conditions>
<condition operation="in" column="mid" var="mid" notnull="notnull" />
</conditions>
</query>

View file

@ -1,10 +1,10 @@
<query id="insertActionFoward" action="insert">
<tables>
<table name="action_foward" />
</tables>
<columns>
<column name="module" default="module" notnull="notnull" />
<column name="type" default="type" notnull="notnull" />
<column name="action" default="action" notnull="notnull" />
</columns>
<tables>
<table name="action_foward" />
</tables>
<columns>
<column name="module" default="module" notnull="notnull" />
<column name="type" default="type" notnull="notnull" />
<column name="action" default="action" notnull="notnull" />
</columns>
</query>

View file

@ -1,24 +1,24 @@
<query id="insertModule" action="insert">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="module_srl" default="module_srl" notnull="notnull" />
<column name="module_category_srl" default="module_category_srl" />
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40" />
<column name="skin" var="skin" minlength="1" maxlength="250" />
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
<column name="description" var="description" />
<column name="content" var="content" />
<column name="module" var="module" notnull="notnull" maxlength="80"/>
<column name="is_default" var="is_default" default="N" notnull="notnull" />
<column name="menu_srl" var="menu_srl" filter="number" />
<column name="extra_vars" var="extra_vars" />
<column name="skin_vars" var="skin_vars" />
<column name="layout_srl" var="layout_srl" default="0" />
<column name="admin_id" var="admin_id" maxlength="80" />
<column name="header_text" var="header_text" />
<column name="footer_text" var="footer_text" />
<column name="regdate" default="curdate()" />
</columns>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="module_srl" default="module_srl" notnull="notnull" />
<column name="module_category_srl" default="module_category_srl" />
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40" />
<column name="skin" var="skin" minlength="1" maxlength="250" />
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
<column name="description" var="description" />
<column name="content" var="content" />
<column name="module" var="module" notnull="notnull" maxlength="80"/>
<column name="is_default" var="is_default" default="N" notnull="notnull" />
<column name="menu_srl" var="menu_srl" filter="number" />
<column name="extra_vars" var="extra_vars" />
<column name="skin_vars" var="skin_vars" />
<column name="layout_srl" var="layout_srl" default="0" />
<column name="admin_id" var="admin_id" maxlength="80" />
<column name="header_text" var="header_text" />
<column name="footer_text" var="footer_text" />
<column name="regdate" default="curdate()" />
</columns>
</query>

View file

@ -1,10 +1,10 @@
<query id="insertModuleCategory" action="insert">
<tables>
<table name="module_categories" />
</tables>
<columns>
<column name="module_category_srl" default="sequence()" />
<column name="title" var="title" notnull="notnull"/>
<column name="regdate" default="curdate()" />
</columns>
<tables>
<table name="module_categories" />
</tables>
<columns>
<column name="module_category_srl" default="sequence()" />
<column name="title" var="title" notnull="notnull"/>
<column name="regdate" default="curdate()" />
</columns>
</query>

View file

@ -1,10 +1,10 @@
<query id="insertModuleConfig" action="insert">
<tables>
<table name="module_config" />
</tables>
<columns>
<column name="module" default="module" notnull="notnull" />
<column name="config" var="config" />
<column name="regdate" default="curdate()" />
</columns>
<tables>
<table name="module_config" />
</tables>
<columns>
<column name="module" default="module" notnull="notnull" />
<column name="config" var="config" />
<column name="regdate" default="curdate()" />
</columns>
</query>

View file

@ -1,24 +1,24 @@
<query id="updateModule" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40"/>
<column name="module_category_srl" var="module_category_srl" />
<column name="skin" var="skin" minlength="1" maxlength="250" />
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
<column name="description" var="description" />
<column name="content" var="content" />
<column name="module" var="module" notnull="notnull" maxlength="80"/>
<column name="is_default" var="is_default" default="N" notnull="notnull" />
<column name="menu_srl" var="menu_srl" filter="number" />
<column name="extra_vars" var="extra_vars" />
<column name="layout_srl" var="layout_srl" default="0" />
<column name="admin_id" var="admin_id" maxlength="80" />
<column name="header_text" var="header_text" />
<column name="footer_text" var="footer_text" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="mid" var="mid" notnull="notnull" minlength="1" maxlength="40"/>
<column name="module_category_srl" var="module_category_srl" />
<column name="skin" var="skin" minlength="1" maxlength="250" />
<column name="browser_title" var="browser_title" notnull="notnull" minlength="1" maxlength="250" />
<column name="description" var="description" />
<column name="content" var="content" />
<column name="module" var="module" notnull="notnull" maxlength="80"/>
<column name="is_default" var="is_default" default="N" notnull="notnull" />
<column name="menu_srl" var="menu_srl" filter="number" />
<column name="extra_vars" var="extra_vars" />
<column name="layout_srl" var="layout_srl" default="0" />
<column name="admin_id" var="admin_id" maxlength="80" />
<column name="header_text" var="header_text" />
<column name="footer_text" var="footer_text" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="updateModuleCategory" action="update">
<tables>
<table name="module_categories" />
</tables>
<columns>
<column name="title" var="title" notnull="notnull"/>
</columns>
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
<tables>
<table name="module_categories" />
</tables>
<columns>
<column name="title" var="title" notnull="notnull"/>
</columns>
<conditions>
<condition operation="equal" column="module_category_srl" var="module_category_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="updateModuleGrant" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="grants" var="grants" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="grants" var="grants" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="updateModuleLayout" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="layout_srl" var="layout_srl" default="0" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" notnull="notnull"/>
</conditions>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="layout_srl" var="layout_srl" default="0" />
</columns>
<conditions>
<condition operation="equal" column="mid" var="mid" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,11 +1,11 @@
<query id="updateModuleSkinVars" action="update">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="skin_vars" var="skin_vars" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
<tables>
<table name="modules" />
</tables>
<columns>
<column name="skin_vars" var="skin_vars" />
</columns>
<conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull"/>
</conditions>
</query>

View file

@ -1,5 +1,5 @@
<table name="action_foward">
<column name="module" type="varchar" size="80" notnull="notnull" unique="idx_foward" />
<column name="type" type="varchar" size="15" notnull="notnull" unique="idx_foward"/>
<column name="action" type="varchar" size="255" notnull="notnull" unique="idx_foward"/>
<column name="module" type="varchar" size="80" notnull="notnull" unique="idx_foward" />
<column name="type" type="varchar" size="15" notnull="notnull" unique="idx_foward"/>
<column name="action" type="varchar" size="255" notnull="notnull" unique="idx_foward"/>
</table>

View file

@ -1,5 +1,5 @@
<table name="module_categories">
<column name="module_category_srl" type="number" size="11" default="0" notnull="notnull" primary_key="primary_key" />
<column name="title" type="varchar" size="250" />
<column name="regdate" type="date" index="idx_regdate" />
<column name="module_category_srl" type="number" size="11" default="0" notnull="notnull" primary_key="primary_key" />
<column name="title" type="varchar" size="250" />
<column name="regdate" type="date" index="idx_regdate" />
</table>

View file

@ -1,5 +1,5 @@
<table name="module_config">
<column name="module" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
<column name="config" type="text" />
<column name="regdate" type="date" />
<column name="module" type="varchar" size="250" notnull="notnull" primary_key="primary_key" />
<column name="config" type="text" />
<column name="regdate" type="date" />
</table>

View file

@ -1,20 +1,20 @@
<table name="modules">
<column name="module_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module" type="varchar" size="80" notnull="notnull" index="idx_module" />
<column name="module_category_srl" type="number" size="11" notnull="notnull" default="0" index="idx_module_category" />
<column name="layout_srl" type="number" size="11" notnull="notnull" default="0" />
<column name="mid" type="varchar" size="40" notnull="notnull" unique="unique_mid"/>
<column name="skin" type="varchar" size="250" />
<column name="browser_title" type="varchar" size="250" notnull="notnull"/>
<column name="description" type="text" size="250" />
<column name="is_default" type="char" size="1" notnull="notnull" default="N" />
<column name="menu_srl" type="number" size="11" default="0"/>
<column name="extra_vars" type="text" />
<column name="skin_vars" type="text" />
<column name="content" type="bigtext"/>
<column name="grants" type="text" />
<column name="admin_id" type="text" />
<column name="header_text" type="text" />
<column name="footer_text" type="text" />
<column name="regdate" type="date" />
<column name="module_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module" type="varchar" size="80" notnull="notnull" index="idx_module" />
<column name="module_category_srl" type="number" size="11" notnull="notnull" default="0" index="idx_module_category" />
<column name="layout_srl" type="number" size="11" notnull="notnull" default="0" />
<column name="mid" type="varchar" size="40" notnull="notnull" unique="unique_mid"/>
<column name="skin" type="varchar" size="250" />
<column name="browser_title" type="varchar" size="250" notnull="notnull"/>
<column name="description" type="text" size="250" />
<column name="is_default" type="char" size="1" notnull="notnull" default="N" />
<column name="menu_srl" type="number" size="11" default="0"/>
<column name="extra_vars" type="text" />
<column name="skin_vars" type="text" />
<column name="content" type="bigtext"/>
<column name="grants" type="text" />
<column name="admin_id" type="text" />
<column name="header_text" type="text" />
<column name="footer_text" type="text" />
<column name="regdate" type="date" />
</table>