mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
Remove unnecessary use of BaseObject
- 트리거 등 반환값이 필요하지 않은 곳에서 new BaseObject()를 반환하는 것 삭제 - 모듈 설치, 업데이트 후 무의미한 new BaseObject()를 반환하는 것 삭제 - 사용자에게 에러 메시지를 돌려주는 용도로 new BaseObject(-1, '에러메시지')를 사용하는 경우는 대부분 $this->setError()로 변경함. 언어 변환과 sprintf() 처리까지 한 번에 이루어지므로 이쪽이 더 편리함.
This commit is contained in:
parent
03d74a984f
commit
84e5542d77
103 changed files with 692 additions and 862 deletions
|
|
@ -108,7 +108,7 @@ class moduleAdminController extends module
|
|||
{
|
||||
$mid = trim($args->{"mid_".$i});
|
||||
if(!$mid) continue;
|
||||
if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new BaseObject(-1, 'msg_limit_mid');
|
||||
if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return $this->setError('msg_limit_mid');
|
||||
$browser_title = $args->{"browser_title_".$i};
|
||||
if(!$mid) continue;
|
||||
if($mid && !$browser_title) $browser_title = $mid;
|
||||
|
|
@ -282,7 +282,7 @@ class moduleAdminController extends module
|
|||
// Get information of the module
|
||||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
if(!$module_info) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_info) return $this->setError('msg_invalid_request');
|
||||
// Register Admin ID
|
||||
$oModuleController->deleteAdminId($module_srl);
|
||||
$admin_member = Context::get('admin_member');
|
||||
|
|
@ -509,10 +509,10 @@ class moduleAdminController extends module
|
|||
{
|
||||
$vars = Context::getRequestVars();
|
||||
|
||||
if(!$vars->module_srls) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$vars->module_srls) return $this->setError('msg_invalid_request');
|
||||
|
||||
$module_srls = explode(',',$vars->module_srls);
|
||||
if(count($module_srls) < 1) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(count($module_srls) < 1) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController= getController('module');
|
||||
|
|
@ -564,10 +564,10 @@ class moduleAdminController extends module
|
|||
function procModuleAdminModuleGrantSetup()
|
||||
{
|
||||
$module_srls = Context::get('module_srls');
|
||||
if(!$module_srls) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srls) return $this->setError('msg_invalid_request');
|
||||
|
||||
$modules = explode(',',$module_srls);
|
||||
if(count($modules) < 1) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(count($modules) < 1) return $this->setError('msg_invalid_request');
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
@ -676,7 +676,7 @@ class moduleAdminController extends module
|
|||
// if args->name is empty, random generate for user define language
|
||||
if(empty($args->name)) $args->name = 'userLang'.date('YmdHis').''.sprintf('%03d', mt_rand(0, 100));
|
||||
|
||||
if(!$args->name) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$args->name) return $this->setError('msg_invalid_request');
|
||||
// Check whether a language code exists
|
||||
$output = executeQueryArray('module.getLang', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -723,7 +723,7 @@ class moduleAdminController extends module
|
|||
$args->name = str_replace(' ','_',Context::get('name'));
|
||||
$args->lang_name = str_replace(' ','_',Context::get('lang_name'));
|
||||
if(!empty($args->lang_name)) $args->name = $args->lang_name;
|
||||
if(!$args->name) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$args->name) return $this->setError('msg_invalid_request');
|
||||
|
||||
$output = executeQuery('module.deleteLang', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
@ -737,7 +737,7 @@ class moduleAdminController extends module
|
|||
|
||||
function procModuleAdminGetList()
|
||||
{
|
||||
if(!Context::get('is_logged')) return new BaseObject(-1, 'msg_not_permitted');
|
||||
if(!Context::get('is_logged')) return $this->setError('msg_not_permitted');
|
||||
|
||||
$oModuleController = getController('module');
|
||||
$oModuleModel = getModel('module');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue