mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
issue 46 apply validator to trash module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8561 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
ab0e63b954
commit
0bf52edba1
4 changed files with 20 additions and 5 deletions
|
|
@ -3,13 +3,12 @@
|
|||
<grants />
|
||||
<permissions>
|
||||
<permission action="dispTrashAdminList" target="manager" />
|
||||
<permission action="procTrashAdminEmptyTrash" target="manager" />
|
||||
<permission action="procTrashAdminRestore" target="manager" />
|
||||
</permissions>
|
||||
<actions>
|
||||
<action name="dispTrashAdminList" type="view" standalone="true" admin_index="true" />
|
||||
|
||||
<action name="procTrashAdminEmptyTrash" type="controller" standalone="true" />
|
||||
<action name="procTrashAdminEmptyTrash" type="controller" standalone="true" ruleset="emptyTrash" />
|
||||
<action name="procTrashAdminRestore" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
8
modules/trash/ruleset/emptyTrash.xml
Normal file
8
modules/trash/ruleset/emptyTrash.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="trash_srls" required="true" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -1,10 +1,11 @@
|
|||
<script>
|
||||
var confirm_restore_msg = '{$lang->confirm_restore}';
|
||||
</script>
|
||||
<!--%import("filter/emptyTrash.xml")-->
|
||||
<!--#include("header.html")-->
|
||||
|
||||
<form id="fo_list" action="./" method="get" onsubmit="return procFilter(this, emptyTrash)">
|
||||
<p class="xe_validator_error">{$XE_VALIDATOR_ERROR}</p>
|
||||
<form ruleset="emptyTrash" id="fo_list" action="./" method="post">
|
||||
<input type="hidden" name="act" value="procTrashAdminEmptyTrash" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_all" value="false" />
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,9 @@ class trashAdminController extends trash
|
|||
{
|
||||
global $lang;
|
||||
$isAll = Context::get('is_all');
|
||||
$trashSrls = explode('|@|', Context::get('trash_srls'));
|
||||
$tmpTrashSrls = Context::get('trash_srls');
|
||||
if(is_array($tmpTrashSrls)) $trashSrls = $tmpTrashSrls;
|
||||
else $trashSrls = explode('|@|', $tmpTrashSrls);
|
||||
|
||||
$oTrashModel = &getModel('trash');
|
||||
if($isAll == 'true')
|
||||
|
|
@ -73,6 +75,11 @@ class trashAdminController extends trash
|
|||
if(!$this->_emptyTrash($trashSrls))
|
||||
return new Object(-1, $lang->fail_empty);
|
||||
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrashAdminList');
|
||||
header('location:'.$returnUrl);
|
||||
return;
|
||||
}
|
||||
return new Object(0, $lang->success_empty);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue