mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +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
|
|
@ -131,7 +131,7 @@ class pageAdminController extends page
|
|||
{
|
||||
$module_srl = Context::get('module_srl');
|
||||
$content = Context::get('content');
|
||||
if(!$module_srl) return new BaseObject(-1,'msg_invalid_request');
|
||||
if(!$module_srl) return $this->setError('msg_invalid_request');
|
||||
$mcontent = Context::get('mcontent');
|
||||
$type = Context::get('type');
|
||||
// Guhaeom won information page
|
||||
|
|
@ -301,7 +301,7 @@ class pageAdminController extends page
|
|||
|
||||
if(!$grant->manager)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
return $this->setError('msg_not_permitted');
|
||||
}
|
||||
|
||||
$obj = Context::getRequestVars();
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ class pageAdminView extends page
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BaseObject(-1, sprintf('%s method is not exists', $method));
|
||||
return $this->setError(sprintf('%s method is not exists', $method));
|
||||
}
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ class page extends ModuleObject
|
|||
{
|
||||
// page generated from the cache directory to use
|
||||
FileHandler::makeDir('./files/cache/page');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -76,7 +74,6 @@ class page extends ModuleObject
|
|||
$skin_args->is_skin_fix = "Y";
|
||||
$ouput = executeQuery('page.updateSkinFix', $skin_args);
|
||||
}
|
||||
return new BaseObject(0,'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class pageMobile extends pageView
|
|||
$page_type_name = strtolower($this->module_info->page_type);
|
||||
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
||||
if (method_exists($this, $method)) $page_content = $this->{$method}();
|
||||
else return new BaseObject(-1, sprintf('%s method is not exists', $method));
|
||||
else return $this->setError('%s method is not exists', $method);
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
Context::set('page_content', $page_content);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class pageView extends page
|
|||
$page_type_name = strtolower($this->module_info->page_type);
|
||||
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
||||
if(method_exists($this, $method)) $page_content = $this->{$method}();
|
||||
else return new BaseObject(-1, sprintf('%s method is not exists', $method));
|
||||
else return $this->setError('%s method is not exists', $method);
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
Context::set('page_content', $page_content);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue