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:
ovclas 2011-06-24 01:04:22 +00:00
parent 7cdc29c313
commit 4763de6248
8 changed files with 68 additions and 30 deletions

View file

@ -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;
}
}
/**