mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@379 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
6a494850da
commit
af7dc3565d
15 changed files with 204 additions and 12 deletions
|
|
@ -14,7 +14,6 @@
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{$lang->category_title}</th>
|
<th>{$lang->category_title}</th>
|
||||||
<th>{$lang->document_count}</th>
|
|
||||||
<th>{$lang->last_update}</th>
|
<th>{$lang->last_update}</th>
|
||||||
<th>{$lang->cmd_modify}</th>
|
<th>{$lang->cmd_modify}</th>
|
||||||
<th colspan="2">{$lang->cmd_move}</th>
|
<th colspan="2">{$lang->cmd_move}</th>
|
||||||
|
|
@ -22,13 +21,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
<!--@if(!count($category_list))-->
|
<!--@if(!count($category_list))-->
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7">{$lang->msg_category_is_null}</td>
|
<td colspan="6">{$lang->msg_category_is_null}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
<!--@foreach($category_list as $category_srl => $category_info)-->
|
<!--@foreach($category_list as $category_srl => $category_info)-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$category_info->title}</td>
|
<td>{$category_info->title}</td>
|
||||||
<td>{number_format($category_info->document_count)}</td>
|
|
||||||
<td>{zdate($category_info->last_update,"Y-m-d H:i:s")}</td>
|
<td>{zdate($category_info->last_update,"Y-m-d H:i:s")}</td>
|
||||||
<td><a href="{getUrl('category_srl',$category_info->category_srl)}">{$lang->cmd_modify}</a></td>
|
<td><a href="{getUrl('category_srl',$category_info->category_srl)}">{$lang->cmd_modify}</a></td>
|
||||||
<td><a href="#" onclick="doUpdateCategory('{$category_info->category_srl}','up');return false;">{$lang->cmd_move_up}</a></td>
|
<td><a href="#" onclick="doUpdateCategory('{$category_info->category_srl}','up');return false;">{$lang->cmd_move_up}</a></td>
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,8 @@
|
||||||
<action name="dispContent" type="view" standalone="true" admin_index="true" />
|
<action name="dispContent" type="view" standalone="true" admin_index="true" />
|
||||||
<action name="dispModuleList" type="view" standalone="true" />
|
<action name="dispModuleList" type="view" standalone="true" />
|
||||||
<action name="dispCategory" type="view" standalone="true" />
|
<action name="dispCategory" type="view" standalone="true" />
|
||||||
|
|
||||||
|
<action name="procInsertCategory" type="controller" standalone="true" />
|
||||||
|
<action name="procUpdateCategory" type="controller" standalone="true" />
|
||||||
</actions>
|
</actions>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
$lang->module_list = "모듈 목록";
|
$lang->module_list = "모듈 목록";
|
||||||
$lang->module_config = "모듈 기본 설정";
|
$lang->module_index = "초기화면";
|
||||||
$lang->module_category = "모듈 카테고리";
|
$lang->module_category = "모듈 카테고리";
|
||||||
|
|
||||||
|
$lang->category_title = "카테고리 이름";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -186,11 +186,14 @@
|
||||||
/**
|
/**
|
||||||
* @brief 모듈 카테고리 추가
|
* @brief 모듈 카테고리 추가
|
||||||
**/
|
**/
|
||||||
function procInsertModuleCategory() {
|
function procInsertCategory() {
|
||||||
$oDB = &DB::getInstance();
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
$args->title = Context::get('title');
|
$args->title = Context::get('title');
|
||||||
return $oDB->executeQuery('module.insertModuleCategory', $args);
|
$output = $oDB->executeQuery('module.insertModuleCategory', $args);
|
||||||
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
$this->setMessage("success_registed");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -213,5 +216,27 @@
|
||||||
$args->module_category_srl = Context::get('module_category_srl');
|
$args->module_category_srl = Context::get('module_category_srl');
|
||||||
return $oDB->executeQuery('module.deleteModuleCategory', $args);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -384,11 +384,23 @@
|
||||||
$oDB = &DB::getInstance();
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
// 데이터를 DB에서 가져옴
|
// 데이터를 DB에서 가져옴
|
||||||
$args->document_srl = $document_srl;
|
$output = $oDB->executeQuery('module.getModuleCategories');
|
||||||
$output = $oDB->executeQuery('module.getModuleCategories', $args);
|
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
if($output->data && !is_array($output->data)) return array($output->data);
|
||||||
|
return $output->data;
|
||||||
|
}
|
||||||
|
|
||||||
if(!is_array($output->data)) return array($output->data);
|
/**
|
||||||
|
* @brief 특정 모듈 카테고리의 내용을 구함
|
||||||
|
**/
|
||||||
|
function getModuleCategory($module_category_srl) {
|
||||||
|
// DB 객체 생성
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
|
// 데이터를 DB에서 가져옴
|
||||||
|
$args->module_category_srl = $module_category_srl;
|
||||||
|
$output = $oDB->executeQuery('module.getModuleCategory', $args);
|
||||||
|
if(!$output->toBool()) return $output;
|
||||||
return $output->data;
|
return $output->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,5 +36,33 @@
|
||||||
$this->setTemplateFile('module_list');
|
$this->setTemplateFile('module_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 모듈 카테고리 목록
|
||||||
|
**/
|
||||||
|
function dispCategory() {
|
||||||
|
$module_category_srl = Context::get('module_category_srl');
|
||||||
|
|
||||||
|
// 모듈 목록을 구해서
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
|
||||||
|
// 선택된 카테고리가 있으면 해당 카테고리의 정보 수정 페이지로
|
||||||
|
if($module_category_srl) {
|
||||||
|
$selected_category = $oModuleModel->getModuleCategory($module_category_srl);
|
||||||
|
Context::set('selected_category', $selected_category);
|
||||||
|
|
||||||
|
// 템플릿 파일 지정
|
||||||
|
$this->setTemplateFile('category_update_form');
|
||||||
|
debugPrint($selected_category);
|
||||||
|
|
||||||
|
// 아니면 전체 목록
|
||||||
|
} else {
|
||||||
|
$category_list = $oModuleModel->getModuleCategories();
|
||||||
|
Context::set('category_list', $category_list);
|
||||||
|
|
||||||
|
// 템플릿 파일 지정
|
||||||
|
$this->setTemplateFile('category_list');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<query id="deleteModuleCategory" action="insert">
|
<query id="deleteModuleCategory" action="delete">
|
||||||
<tables>
|
<tables>
|
||||||
<table name="module_categories" />
|
<table name="module_categories" />
|
||||||
</tables>
|
</tables>
|
||||||
|
|
|
||||||
9
modules/module/queries/getModuleCategory.xml
Normal file
9
modules/module/queries/getModuleCategory.xml
Normal file
|
|
@ -0,0 +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>
|
||||||
|
</query>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<query id="updateModuleCategory" action="insert">
|
<query id="updateModuleCategory" action="update">
|
||||||
<tables>
|
<tables>
|
||||||
<table name="module_categories" />
|
<table name="module_categories" />
|
||||||
</tables>
|
</tables>
|
||||||
|
|
|
||||||
48
modules/module/tpl.admin/category_list.html
Normal file
48
modules/module/tpl.admin/category_list.html
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
<!--%import("filter/insert_category.xml")-->
|
||||||
|
<!--%import("filter/update_category.xml")-->
|
||||||
|
|
||||||
|
<!--#include("./header.html")-->
|
||||||
|
|
||||||
|
<!-- 카테고리의 위/아래, 삭제와 관련된 form -->
|
||||||
|
<form id="fo_category_info" action="./" method="get">
|
||||||
|
<input type="hidden" name="module_category_srl" value="" />
|
||||||
|
<input type="hidden" name="mode" value="" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->category_title}</th>
|
||||||
|
<th>{$lang->regdate}</th>
|
||||||
|
<th>{$lang->cmd_modify}</th>
|
||||||
|
<th>{$lang->cmd_delete}</th>
|
||||||
|
</tr>
|
||||||
|
<!--@if(!count($category_list))-->
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">{$lang->msg_category_is_null}</td>
|
||||||
|
</tr>
|
||||||
|
<!--@end-->
|
||||||
|
<!--@foreach($category_list as $key => $val)-->
|
||||||
|
<tr>
|
||||||
|
<td>{$val->title}</td>
|
||||||
|
<td>{zdate($val->regdate,"Y-m-d H:i:s")}</td>
|
||||||
|
<td><a href="{getUrl('module_category_srl',$val->module_category_srl)}">{$lang->cmd_modify}</a></td>
|
||||||
|
<td><a href="#" onclick="doUpdateCategory('{$val->module_category_srl}','delete','{$lang->confirm_delete}');return false;">{$lang->cmd_delete}</a></td>
|
||||||
|
</tr>
|
||||||
|
<!--@end-->
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 카테고리 추가 -->
|
||||||
|
<form action="./" method="post" onsubmit="return procFilter(this, insert_category)">
|
||||||
|
<input type="hidden" name="page" value="{$page}" />
|
||||||
|
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||||
|
<input type="hidden" name="module_category_srl" value="" />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{$lang->category_title} :
|
||||||
|
<input type="text" name="title" />
|
||||||
|
<input type="submit" value="{$lang->cmd_registration}" accesskey="s" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
19
modules/module/tpl.admin/category_update_form.html
Normal file
19
modules/module/tpl.admin/category_update_form.html
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<!--%import("filter/update_category.xml")-->
|
||||||
|
|
||||||
|
<!--#include("./header.html")-->
|
||||||
|
|
||||||
|
<!-- 카테고리 수정 -->
|
||||||
|
<!--@if($selected_category)-->
|
||||||
|
<form action="./" method="post" onsubmit="return procFilter(this, update_category)" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" name="module_category_srl" value="{$selected_category->module_category_srl}" />
|
||||||
|
<input type="hidden" name="mode" value="update" />
|
||||||
|
|
||||||
|
<div style="margin-bottom:30px">
|
||||||
|
{$lang->category_title} :
|
||||||
|
<input type="text" name="title" value="{$selected_category->title}" />
|
||||||
|
<input type="submit" value="{$lang->cmd_modify}" />
|
||||||
|
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('category_srl','')}'" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<!--@end-->
|
||||||
10
modules/module/tpl.admin/filter/insert_category.xml
Normal file
10
modules/module/tpl.admin/filter/insert_category.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<filter name="insert_category" module="module" act="procInsertCategory" confirm_msg_code="confirm_submit">
|
||||||
|
<form>
|
||||||
|
<node target="title" required="true" />
|
||||||
|
</form>
|
||||||
|
<response callback_func="completeUpdateCategory">
|
||||||
|
<tag name="error" />
|
||||||
|
<tag name="message" />
|
||||||
|
<tag name="page" />
|
||||||
|
</response>
|
||||||
|
</filter>
|
||||||
10
modules/module/tpl.admin/filter/update_category.xml
Normal file
10
modules/module/tpl.admin/filter/update_category.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<filter name="update_category" module="module" act="procUpdateCategory">
|
||||||
|
<form>
|
||||||
|
<node target="module_category_srl" required="true" />
|
||||||
|
<node target="mode" required="true" />
|
||||||
|
</form>
|
||||||
|
<response callback_func="completeUpdateCategory">
|
||||||
|
<tag name="error" />
|
||||||
|
<tag name="message" />
|
||||||
|
</response>
|
||||||
|
</filter>
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
|
<!--%import("js/admin.js")-->
|
||||||
|
|
||||||
<!--@if($mo=="module")-->
|
<!--@if($mo=="module")-->
|
||||||
|
|
||||||
<div style="margin-bottom:20px;">
|
<div style="margin-bottom:20px;">
|
||||||
<span <!--@if($act=='dispConfig')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispConfig')}">{$lang->module_config}</a>]</span>
|
<span <!--@if($act=='dispContent')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispContent')}">{$lang->module_index}</a>]</span>
|
||||||
<span <!--@if($act=='dispCategory')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispCategory')}">{$lang->module_category}</a>]</span>
|
<span <!--@if($act=='dispCategory')-->style="font-weight:bold"<!--@end-->>[<a href="{getUrl('act','dispCategory')}">{$lang->module_category}</a>]</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
26
modules/module/tpl.admin/js/admin.js
Normal file
26
modules/module/tpl.admin/js/admin.js
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
/**
|
||||||
|
* @file : modules/module/js/admin.js
|
||||||
|
* @author : zero <zero@nzeo.com>
|
||||||
|
* @desc : module 모듈의 관리자용 javascript
|
||||||
|
**/
|
||||||
|
|
||||||
|
/* 카테고리 관련 작업들 */
|
||||||
|
function doUpdateCategory(module_category_srl, mode, message) {
|
||||||
|
if(typeof(message)!='undefined'&&!confirm(message)) return;
|
||||||
|
|
||||||
|
var fo_obj = xGetElementById('fo_category_info');
|
||||||
|
fo_obj.module_category_srl.value = module_category_srl;
|
||||||
|
fo_obj.mode.value = mode;
|
||||||
|
|
||||||
|
procFilter(fo_obj, update_category);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 카테고리 정보 수정 후 */
|
||||||
|
function completeUpdateCategory(ret_obj) {
|
||||||
|
var error = ret_obj['error'];
|
||||||
|
var message = ret_obj['message'];
|
||||||
|
alert(message);
|
||||||
|
|
||||||
|
var url = "./?module=admin&mo=module&act=dispCategory";
|
||||||
|
location.href = url;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue