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:
ovclas 2011-07-01 09:09:14 +00:00
parent ab0e63b954
commit 0bf52edba1
4 changed files with 20 additions and 5 deletions

View file

@ -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);
}