issue 46 validator apply to menu module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8514 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-06-21 08:38:31 +00:00
parent c8c03a898c
commit 77722f35b9
7 changed files with 54 additions and 12 deletions

View file

@ -10,10 +10,10 @@
<action name="getMenuAdminTplInfo" type="model" standalone="true" />
<action name="procMenuAdminInsert" type="controller" standalone="true" />
<action name="procMenuAdminUpdate" type="controller" standalone="true" />
<action name="procMenuAdminInsert" type="controller" standalone="true" ruleset="insertMenu" />
<action name="procMenuAdminUpdate" type="controller" standalone="true" ruleset="updateMenuTitle" />
<action name="procMenuAdminDelete" type="controller" standalone="true" />
<action name="procMenuAdminInsertItem" type="controller" standalone="true" />
<action name="procMenuAdminInsertItem" type="controller" standalone="true" ruleset="insertMenuItem" />
<action name="procMenuAdminDeleteItem" type="controller" standalone="true" />
<action name="procMenuAdminMakeXmlFile" type="controller" standalone="true" />
<action name="procMenuAdminMoveItem" type="controller" standalone="true" />

View file

@ -29,6 +29,12 @@
$this->add('menu_srl', $args->menu_srl);
$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', 'dispMenuAdminContent');
header('location:'.$returnUrl);
return;
}
}
/**
@ -43,6 +49,11 @@
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', 'dispMenuAdminManagement', 'menu_srl', $args->menu_srl);
header('location:'.$returnUrl);
return;
}
}
/**
@ -145,6 +156,12 @@
$this->add('menu_item_srl', $args->menu_item_srl);
$this->add('menu_title', $menu_title);
$this->add('parent_srl', $args->parent_srl);
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMenuAdminManagement', 'menu_srl', $args->menu_srl);
header('location:'.$returnUrl);
return;
}
}
/**

View 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>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="menu_srl" required="true" rule="number" />
<field name="menu_name" required="true" />
</fields>
</ruleset>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
<customrules>
</customrules>
<fields>
<field name="title" required="true" />
<field name="menu_srl" required="true" rule="number" />
</fields>
</ruleset>

View file

@ -1,8 +1,9 @@
<!--%import("filter/insert_menu.xml")-->
<!--%import("js/menu_admin.js")-->
<!--#include("header.html")-->
<form action="./" method="get" onsubmit="return procFilter(this, insert_menu)">
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<form ruleset="insertMenu" action="./" method="post">
<input type="hidden" name="act" value="procMenuAdminInsert" />
<table cellspacing="0" class="rowTable">
<tr>

View file

@ -1,4 +1,3 @@
<load target="filter/update_menu_title.xml" />
<load target="filter/insert_menu_item.xml" />
<load target="filter/delete_menu_item.xml" />
<load target="filter/move_menu_item.xml" />
@ -16,7 +15,9 @@
<div class="menuManagement">
<!--@if($module == 'admin')-->
<form action="./" method="get" onsubmit="return procFilter(this, update_menu_title)">
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
<form ruleset="updateMenuTitle" action="./" method="post">
<input type="hidden" name="act" value="procMenuAdminUpdate" />
<input type="hidden" name="menu_srl" value="{$menu_info->menu_srl}" />
<h4 class="xeAdmin">{$lang->menu_management}</h4>
<table cellspacing="0" class="rowTable">
@ -57,13 +58,13 @@
<div class="gap1">
<form id="fo_menu" action="./" method="post" onsubmit="return procFilter(this, insert_menu_item)" class="clear" target="tmp_upload_iframe" enctype="multipart/form-data">
<form ruleset="insertMenuItem" id="fo_menu" action="./" method="post" class="clear" enctype="multipart/form-data">
<input type="hidden" name="act" value="procMenuAdminInsertItem" />
<input type="hidden" name="title" value="{$menu_info->title}" />
<input type="hidden" name="menu_srl" value="{$menu_info->menu_srl}" />
<input type="hidden" name="xml_file" value="{$menu_info->xml_file}" />
<input type="hidden" name="php_file" value="{$menu_info->php_file}" />
<input type="hidden" name="module" value="menu" />
<input type="hidden" name="act" value="" />
<input type="hidden" name="target" value="" />
<div id="menu_zone_info"></div>
</form>
@ -75,9 +76,6 @@
</div>
</div>
<iframe id='tmp_upload_iframe' name='tmp_upload_iframe' style='display:none;width:1px;height:1px;position:absolute;top:-10px;left:-10px'></iframe>
<script type="text/javascript">//<![CDATA[
//언어파일 로드용
var lang_cmd_insert = "{htmlspecialchars($lang->cmd_insert)}";