mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +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
|
|
@ -22,20 +22,18 @@ class pointController extends point
|
|||
$member_srl = $obj->member_srl;
|
||||
if (!$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$config = $this->getConfig();
|
||||
$point = intval($config->signup_point);
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$cur_point = getModel('point')->getPoint($member_srl, true);
|
||||
$this->setPoint($member_srl, $cur_point + $point, 'signup');
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -46,26 +44,24 @@ class pointController extends point
|
|||
$member_srl = $obj->member_srl;
|
||||
if (!$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Points are given only once a day.
|
||||
if (substr($obj->last_login, 0, 8) === date('Ymd'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$config = $this->getConfig();
|
||||
$point = intval($config->login_point);
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$cur_point = getModel('point')->getPoint($member_srl, true);
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -82,8 +78,6 @@ class pointController extends point
|
|||
unset($config->point_group[$group_srl]);
|
||||
getController('module')->insertModuleConfig('point', $config);
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -95,17 +89,17 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
if ($obj->status === getModel('document')->getConfigStatus('temp'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -124,7 +118,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -140,7 +133,7 @@ class pointController extends point
|
|||
$member_srl = abs($oDocument->get('member_srl'));
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Only give points if the document is being updated from TEMP to another status such as PUBLIC.
|
||||
|
|
@ -153,7 +146,7 @@ class pointController extends point
|
|||
$cur_point += $attached_files_point * ($obj->uploaded_count - $oDocument->get('uploaded_count'));
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
}
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -172,7 +165,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -180,7 +172,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerBeforeDeleteDocument($obj)
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -192,17 +184,17 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// The fix to disable giving points for saving the document temporarily
|
||||
if ($module_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
if ($obj->status === getModel('document')->getConfigStatus('temp'))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -217,7 +209,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -229,21 +220,21 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = getModel('document')->getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
if ($config->no_point_date > 0 && ztime($oDocument->get('regdate')) < time() - ($config->no_point_date * 86400))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -262,7 +253,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -270,7 +260,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerUpdateComment($obj)
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -282,21 +272,21 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the comment and the document have the same author.
|
||||
$oDocument = getModel('document')->getDocument($obj->document_srl);
|
||||
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Abort if the document is older than a configured limit.
|
||||
$config = $this->getConfig();
|
||||
if ($config->no_point_date > 0 && ztime($oDocument->get('regdate')) < ztime($obj->regdate) - ($config->no_point_date * 86400))
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -308,7 +298,6 @@ class pointController extends point
|
|||
|
||||
// Increase the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -317,7 +306,7 @@ class pointController extends point
|
|||
*/
|
||||
public function triggerInsertFile($obj)
|
||||
{
|
||||
return new BaseObject();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -330,7 +319,7 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if (!$module_srl || !$member_srl || $obj->isvalid !== 'Y')
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the points of the member
|
||||
|
|
@ -342,7 +331,6 @@ class pointController extends point
|
|||
|
||||
// Update the point.
|
||||
$this->setPoint($member_srl, $cur_point);
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -356,13 +344,13 @@ class pointController extends point
|
|||
|
||||
if ($member_srl && abs($obj->member_srl) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'download_file');
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get current points.
|
||||
|
|
@ -376,7 +364,6 @@ class pointController extends point
|
|||
}
|
||||
|
||||
// Points will be adjusted after downloading (triggerDownloadFile).
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -390,19 +377,17 @@ class pointController extends point
|
|||
|
||||
if (!$member_srl || abs($obj->member_srl) == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'download_file');
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$cur_point = getModel('point')->getPoint($member_srl, true);
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -417,13 +402,13 @@ class pointController extends point
|
|||
$target_member_srl = abs($obj->get('member_srl'));
|
||||
if ($member_srl && $target_member_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
$point = $this->_getModulePointConfig($module_srl, 'read_document');
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// If the current member has already read this document, do not adjust points again.
|
||||
|
|
@ -435,7 +420,7 @@ class pointController extends point
|
|||
$output = executeQuery('document.getDocumentReadedLogInfo', $args);
|
||||
if ($output->data->count)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -465,8 +450,6 @@ class pointController extends point
|
|||
$output = executeQuery('document.insertDocumentReadedLog', $args);
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
}
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -480,11 +463,11 @@ class pointController extends point
|
|||
$member_srl = abs($obj->member_srl);
|
||||
if ($logged_member_srl && $logged_member_srl == $member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
elseif (!$member_srl)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get current points.
|
||||
|
|
@ -503,7 +486,7 @@ class pointController extends point
|
|||
$point = $this->_getModulePointConfig($module_srl, $config_key);
|
||||
if (!$point)
|
||||
{
|
||||
return new BaseObject();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($obj->cancel) && $obj->cancel)
|
||||
|
|
@ -512,8 +495,6 @@ class pointController extends point
|
|||
}
|
||||
|
||||
$this->setPoint($member_srl, $cur_point + $point);
|
||||
|
||||
return new BaseObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue