mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
issue 46 validator apply to module module.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8536 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7cdc29c313
commit
4763de6248
8 changed files with 68 additions and 30 deletions
|
|
@ -28,8 +28,9 @@
|
|||
<action name="getModuleAdminModuleList" type="model" standalone="true" />
|
||||
<action name="getModuleAdminLangCode" type="model" standalone="true" />
|
||||
|
||||
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" />
|
||||
<action name="procModuleAdminUpdateCategory" type="controller" standalone="true" />
|
||||
<action name="procModuleAdminInsertCategory" type="controller" standalone="true" ruleset="insertCategory" />
|
||||
<action name="procModuleAdminUpdateCategory" type="controller" standalone="true" ruleset="updateCategory" />
|
||||
<action name="procModuleAdminDeleteCategory" type="controller" standalone="true" ruleset="deleteCategory" />
|
||||
<action name="procModuleAdminCopyModule" type="controller" standalone="true" />
|
||||
<action name="procModuleAdminInsertGrant" type="controller" standalone="true" />
|
||||
<action name="procModuleAdminUpdateSkinInfo" type="controller" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -22,27 +22,41 @@
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage("success_registed");
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispModuleAdminCategory');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Update category
|
||||
**/
|
||||
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;
|
||||
}
|
||||
$output = $this->doUpdateModuleCategory();
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage($msg_code);
|
||||
$this->setMessage('success_updated');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispModuleAdminCategory');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Delete category
|
||||
**/
|
||||
function procModuleAdminDeleteCategory() {
|
||||
$output = $this->doDeleteModuleCategory();
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispModuleAdminCategory');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
8
modules/module/ruleset/deleteCategory.xml
Normal file
8
modules/module/ruleset/deleteCategory.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="module_category_srl" required="true" rule="number" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
8
modules/module/ruleset/insertCategory.xml
Normal file
8
modules/module/ruleset/insertCategory.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="title" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
9
modules/module/ruleset/updateCategory.xml
Normal file
9
modules/module/ruleset/updateCategory.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="module_category_srl" required="true" rule="number" />
|
||||
<field name="title" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<!--%import("filter/insert_category.xml")-->
|
||||
<!--%import("filter/update_category.xml")-->
|
||||
|
||||
<!--#include("./header.html")-->
|
||||
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<!-- 카테고리의 위/아래, 삭제와 관련된 form -->
|
||||
<form id="fo_category_info" action="./" method="get">
|
||||
<form id="fo_category_info" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procModuleAdminDeleteCategory" />
|
||||
<input type="hidden" name="module_category_srl" value="" />
|
||||
<input type="hidden" name="mode" value="" />
|
||||
</form>
|
||||
|
||||
<table cellspacing="0" class="rowTable">
|
||||
|
|
@ -28,14 +28,15 @@
|
|||
<td class="wide">{$val->title}</td>
|
||||
<td class="nowrap">{zdate($val->regdate,"Y-m-d H:i:s")}</td>
|
||||
<td><a href="{getUrl('module_category_srl',$val->module_category_srl)}" class="buttonSet buttonSetting"><span>{$lang->cmd_modify}</span></a></td>
|
||||
<td><a href="#" onclick="doUpdateCategory('{$val->module_category_srl}','delete','{$lang->confirm_delete}');return false;" class="buttonSet buttonDelete"><span>{$lang->cmd_delete}</span></a></td>
|
||||
<td><a href="#" onclick="doUpdateCategory('{$val->module_category_srl}','{$lang->confirm_delete}');return false;" class="buttonSet buttonDelete"><span>{$lang->cmd_delete}</span></a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 카테고리 추가 -->
|
||||
<form action="./" method="post" onsubmit="return procFilter(this, insert_category)">
|
||||
<form ruleset="insertCategory" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procModuleAdminInsertCategory" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="module_category_srl" value="" />
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
<!--%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" />
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form ruleset="updateCategory" action="./" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="act" value="procModuleAdminUpdateCategory" />
|
||||
<input type="hidden" name="module_category_srl" value="{$selected_category->module_category_srl}" />
|
||||
<input type="hidden" name="mode" value="update" />
|
||||
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
|
|
|
|||
|
|
@ -5,14 +5,12 @@
|
|||
**/
|
||||
|
||||
/* 카테고리 관련 작업들 */
|
||||
function doUpdateCategory(module_category_srl, mode, message) {
|
||||
function doUpdateCategory(module_category_srl, message) {
|
||||
if(typeof(message)!='undefined'&&!confirm(message)) return;
|
||||
|
||||
var fo_obj = get_by_id('fo_category_info');
|
||||
fo_obj.module_category_srl.value = module_category_srl;
|
||||
fo_obj.mode.value = mode;
|
||||
|
||||
procFilter(fo_obj, update_category);
|
||||
fo_obj.submit();
|
||||
}
|
||||
|
||||
/* 카테고리 정보 수정 후 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue