mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 22:33:10 +09:00
Remove trailing whitespace
This commit is contained in:
parent
c881e73c1d
commit
c5267b42fd
26 changed files with 873 additions and 873 deletions
|
|
@ -215,7 +215,7 @@ class CommentAdminController extends Comment
|
|||
|
||||
$deleted_count = 0;
|
||||
$module_infos = [];
|
||||
|
||||
|
||||
// Delete the comment posting
|
||||
for($i = 0; $i < $comment_count; $i++)
|
||||
{
|
||||
|
|
@ -230,13 +230,13 @@ class CommentAdminController extends Comment
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$module_srl = $comment->get('module_srl');
|
||||
if (!isset($module_infos[$module_srl]))
|
||||
{
|
||||
$module_infos[$module_srl] = ModuleModel::getModuleInfoByModuleSrl($module_srl)->comment_delete_message ?? '';
|
||||
}
|
||||
|
||||
|
||||
if($module_infos[$module_srl] === 'yes')
|
||||
{
|
||||
$output = $oCommentController->updateCommentByDelete($comment, true);
|
||||
|
|
@ -257,7 +257,7 @@ class CommentAdminController extends Comment
|
|||
{
|
||||
$output = $oCommentController->deleteComment($comment_srl, true, toBool($isTrash));
|
||||
}
|
||||
|
||||
|
||||
if(!$output->toBool() && $output->error !== -2)
|
||||
{
|
||||
$oDB->rollback();
|
||||
|
|
@ -276,7 +276,7 @@ class CommentAdminController extends Comment
|
|||
|
||||
$deleted_count++;
|
||||
}
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$msgCode = '';
|
||||
|
|
@ -357,7 +357,7 @@ class CommentAdminController extends Comment
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$obj = new stdClass;
|
||||
$obj->comment_srl = $oComment->get('comment_srl');
|
||||
$obj->module_srl = $oComment->get('module_srl');
|
||||
|
|
@ -482,7 +482,7 @@ class CommentAdminController extends Comment
|
|||
{
|
||||
$originObject = (object) $originObject;
|
||||
}
|
||||
|
||||
|
||||
$oCommentController = getController('comment');
|
||||
$oCommentModel = getModel('comment');
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class CommentAdminView extends Comment
|
|||
}
|
||||
*/
|
||||
|
||||
// get a list by using comment->getCommentList.
|
||||
// get a list by using comment->getCommentList.
|
||||
$oCommentModel = getModel('comment');
|
||||
$secretNameList = $oCommentModel->getSecretNameList();
|
||||
$output = $oCommentModel->getTotalCommentList($args);
|
||||
|
|
@ -89,7 +89,7 @@ class CommentAdminView extends Comment
|
|||
}
|
||||
}
|
||||
Context::set('module_list', $module_list);
|
||||
|
||||
|
||||
// Get anonymous nicknames
|
||||
$anonymous_member_srls = array();
|
||||
foreach($output->data as $val)
|
||||
|
|
@ -114,11 +114,11 @@ class CommentAdminView extends Comment
|
|||
}
|
||||
}
|
||||
Context::set('member_nick_name', $member_nick_neme);
|
||||
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('search_target', 'search_keyword');
|
||||
|
||||
// set the template
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
$this->setTemplateFile('comment_list');
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ class CommentAdminView extends Comment
|
|||
$args->list_count = 30; // /< the number of comment postings to appear on a single page
|
||||
$args->page_count = 10; // /< the number of pages to appear on the page navigation
|
||||
$args->order_type = 'desc'; // /< sorted value
|
||||
|
||||
|
||||
// select sort method
|
||||
$sort_index = Context::get('sort_index');
|
||||
if (!in_array($sort_index, array('declared_latest', 'declared_count', 'regdate')))
|
||||
|
|
@ -143,7 +143,7 @@ class CommentAdminView extends Comment
|
|||
$sort_index = 'declared_latest';
|
||||
}
|
||||
Context::set('sort_index', $sort_index);
|
||||
|
||||
|
||||
// get latest declared list
|
||||
if ($sort_index === 'declared_latest')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Comment extends ModuleObject
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
|
|
@ -85,7 +85,7 @@ class Comment extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
|
|
@ -95,7 +95,7 @@ class Comment extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ class Comment extends ModuleObject
|
|||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!ModuleModel::getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
{
|
||||
|
|
@ -128,7 +128,7 @@ class Comment extends ModuleObject
|
|||
$oDB->addIndex("comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE);
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
|
||||
|
|
@ -144,13 +144,13 @@ class Comment extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('comments', 'idx_parent_srl', array('parent_srl'));
|
||||
}
|
||||
|
||||
|
||||
// 2017.12.21 Add an index for nick_name
|
||||
if(!$oDB->isIndexExists('comments', 'idx_nick_name'))
|
||||
{
|
||||
$oDB->addIndex('comments', 'idx_nick_name', array('nick_name'));
|
||||
}
|
||||
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
|
|
@ -168,7 +168,7 @@ class Comment extends ModuleObject
|
|||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class CommentController extends Comment
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('failed_voted_canceled');
|
||||
}
|
||||
|
||||
|
||||
$point = 1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ class CommentController extends Comment
|
|||
{
|
||||
throw new Rhymix\Framework\Exception('failed_blamed_canceled');
|
||||
}
|
||||
|
||||
|
||||
$point = -1;
|
||||
$output = $this->updateVotedCountCancel($comment_srl, $oComment, $point);
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, $point > 0 ? 'failed_voted_canceled' : 'failed_blamed_canceled');
|
||||
}
|
||||
|
||||
|
||||
// Check if the current user has voted previously.
|
||||
$args = new stdClass;
|
||||
$args->comment_srl = $comment_srl;
|
||||
|
|
@ -243,10 +243,10 @@ class CommentController extends Comment
|
|||
|
||||
//session reset
|
||||
unset($_SESSION['voted_comment'][$comment_srl]);
|
||||
|
||||
|
||||
// Call a trigger (after)
|
||||
ModuleHandler::triggerCall('comment.updateVotedCountCancel', 'after', $trigger_obj);
|
||||
|
||||
|
||||
$oDB->commit();
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -276,7 +276,7 @@ class CommentController extends Comment
|
|||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
// if an user select message from options, message would be the option.
|
||||
$message_option = strval(Context::get('message_option'));
|
||||
$improper_comment_reasons = lang('improper_comment_reasons');
|
||||
|
|
@ -460,7 +460,7 @@ class CommentController extends Comment
|
|||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
|
||||
// Sanitize variables
|
||||
$obj->comment_srl = intval($obj->comment_srl);
|
||||
$obj->module_srl = intval($obj->module_srl);
|
||||
|
|
@ -468,7 +468,7 @@ class CommentController extends Comment
|
|||
$obj->parent_srl = intval($obj->parent_srl);
|
||||
|
||||
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -537,7 +537,7 @@ class CommentController extends Comment
|
|||
{
|
||||
$obj->comment_srl = getNextSequence();
|
||||
}
|
||||
elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
|
||||
elseif(!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl))
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
|
@ -553,13 +553,13 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
|
||||
{
|
||||
$obj->content = getModel('editor')->converter($obj, 'comment');
|
||||
}
|
||||
|
||||
|
||||
if(!$obj->regdate)
|
||||
{
|
||||
$obj->regdate = date("YmdHis");
|
||||
|
|
@ -659,7 +659,7 @@ class CommentController extends Comment
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// create the controller object of the document
|
||||
$oDocumentController = getController('document');
|
||||
|
||||
|
|
@ -684,7 +684,7 @@ class CommentController extends Comment
|
|||
{
|
||||
$obj->updated_file_count = 0;
|
||||
}
|
||||
|
||||
|
||||
// call a trigger(after)
|
||||
ModuleHandler::triggerCall('comment.insertComment', 'after', $obj);
|
||||
|
||||
|
|
@ -722,8 +722,8 @@ class CommentController extends Comment
|
|||
|
||||
/**
|
||||
* Send email to module's admins after a new comment was interted successfully
|
||||
* if Comments Approval System is used
|
||||
* @param object $obj
|
||||
* if Comments Approval System is used
|
||||
* @param object $obj
|
||||
* @return void
|
||||
*/
|
||||
function sendEmailToAdminAfterInsertComment($obj)
|
||||
|
|
@ -836,7 +836,7 @@ class CommentController extends Comment
|
|||
|
||||
// Remove manual member info to prevent forgery. This variable can be set by triggers only.
|
||||
unset($obj->manual_member_info);
|
||||
|
||||
|
||||
// Sanitize variables
|
||||
$obj->comment_srl = intval($obj->comment_srl);
|
||||
$obj->module_srl = intval($obj->module_srl);
|
||||
|
|
@ -844,7 +844,7 @@ class CommentController extends Comment
|
|||
$obj->parent_srl = intval($obj->parent_srl);
|
||||
|
||||
$obj->uploaded_count = FileModel::getFilesCount($obj->comment_srl);
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -874,7 +874,7 @@ class CommentController extends Comment
|
|||
$obj->password = MemberModel::hashPassword($obj->password);
|
||||
}
|
||||
|
||||
if($obj->homepage)
|
||||
if($obj->homepage)
|
||||
{
|
||||
$obj->homepage = escape($obj->homepage);
|
||||
if(!preg_match('/^[a-z]+:\/\//i',$obj->homepage))
|
||||
|
|
@ -919,13 +919,13 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_empty_content');
|
||||
}
|
||||
|
||||
|
||||
// if use editor of nohtml, Remove HTML tags from the contents.
|
||||
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
|
||||
{
|
||||
$obj->content = getModel('editor')->converter($obj, 'comment');
|
||||
}
|
||||
|
||||
|
||||
// remove iframe and script if not a top administrator on the session
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
|
|
@ -983,7 +983,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
|
||||
|
||||
// check if comment exists and permission is granted
|
||||
$comment = CommentModel::getComment($obj->comment_srl);
|
||||
if(!$comment->isExists())
|
||||
|
|
@ -994,7 +994,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
|
||||
// call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment);
|
||||
if(!$output->toBool())
|
||||
|
|
@ -1017,7 +1017,7 @@ class CommentController extends Comment
|
|||
// Begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
|
||||
// Update
|
||||
$obj->member_srl = 0;
|
||||
unset($obj->last_update);
|
||||
|
|
@ -1109,7 +1109,7 @@ class CommentController extends Comment
|
|||
{
|
||||
// check if comment already exists
|
||||
$comment = CommentModel::getComment($comment_srl);
|
||||
|
||||
|
||||
if(!$comment->isExists())
|
||||
{
|
||||
return new BaseObject(-2, 'msg_not_founded');
|
||||
|
|
@ -1231,8 +1231,8 @@ class CommentController extends Comment
|
|||
{
|
||||
$this->_deleteDeclaredComments($args);
|
||||
$this->_deleteVotedComments($args);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->upload_target_srl = $comment_srl;
|
||||
|
|
@ -1268,10 +1268,10 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
$module_info = ModuleModel::getModuleInfo($oComment->get('module_srl'));
|
||||
|
||||
|
||||
if ($module_info->protect_admin_content_delete !== 'N' && $logged_info->is_admin !== 'Y')
|
||||
{
|
||||
$member_info = MemberModel::getMemberInfo($oComment->get('member_srl'));
|
||||
|
|
@ -1608,15 +1608,15 @@ class CommentController extends Comment
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$declared_count = ($output->data->declared_count) ? $output->data->declared_count : 0;
|
||||
$declare_message = trim(htmlspecialchars($declare_message));
|
||||
|
||||
|
||||
$trigger_obj = new stdClass();
|
||||
$trigger_obj->comment_srl = $comment_srl;
|
||||
$trigger_obj->declared_count = $declared_count;
|
||||
$trigger_obj->declare_message = $declare_message;
|
||||
|
||||
|
||||
// Call a trigger (before)
|
||||
$trigger_output = ModuleHandler::triggerCall('comment.declaredComment', 'before', $trigger_obj);
|
||||
if(!$trigger_output->toBool())
|
||||
|
|
@ -1636,7 +1636,7 @@ class CommentController extends Comment
|
|||
|
||||
// Get currently logged in user.
|
||||
$member_srl = intval($this->user->member_srl);
|
||||
|
||||
|
||||
// if the comment author is a member
|
||||
if($oComment->get('member_srl'))
|
||||
{
|
||||
|
|
@ -1665,12 +1665,12 @@ class CommentController extends Comment
|
|||
$_SESSION['declared_comment'][$comment_srl] = FALSE;
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
|
||||
// Fill in remaining information for logging.
|
||||
$args->member_srl = $member_srl;
|
||||
$args->ipaddress = \RX_CLIENT_IP;
|
||||
$args->declare_message = $declare_message;
|
||||
|
||||
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
|
@ -1757,7 +1757,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'failed_declared_cancel');
|
||||
}
|
||||
|
||||
|
||||
// Get the original document
|
||||
$oComment = CommentModel::getComment($comment_srl);
|
||||
|
||||
|
|
@ -1796,7 +1796,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
if ($declared_count > 1)
|
||||
{
|
||||
$output = executeQuery('comment.updateDeclaredCommentCancel', $args);
|
||||
|
|
@ -1810,14 +1810,14 @@ class CommentController extends Comment
|
|||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$output = executeQuery('comment.deleteDeclaredCommentLog', $args);
|
||||
if (!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
$message_targets = array();
|
||||
$module_srl = $oComment->get('module_srl');
|
||||
$comment_config = ModuleModel::getModulePartConfig('comment', $module_srl);
|
||||
|
|
@ -1897,19 +1897,19 @@ class CommentController extends Comment
|
|||
foreach ($target_module_srl as $srl)
|
||||
{
|
||||
if (!$srl) continue;
|
||||
|
||||
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($srl);
|
||||
if (!$module_info->module_srl)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\InvalidRequest;
|
||||
}
|
||||
|
||||
|
||||
$module_grant = ModuleModel::getGrant($module_info, $logged_info);
|
||||
if (!$module_grant->manager)
|
||||
{
|
||||
throw new Rhymix\Framework\Exceptions\NotPermitted;
|
||||
}
|
||||
|
||||
|
||||
$module_srl[] = $srl;
|
||||
}
|
||||
|
||||
|
|
@ -2019,19 +2019,19 @@ class CommentController extends Comment
|
|||
|
||||
$this->add('comment_list', $commentList);
|
||||
}
|
||||
|
||||
|
||||
function triggerMoveDocument($obj)
|
||||
{
|
||||
executeQuery('comment.updateCommentModule', $obj);
|
||||
executeQuery('comment.updateCommentListModule', $obj);
|
||||
}
|
||||
|
||||
|
||||
function triggerAddCopyDocument(&$obj)
|
||||
{
|
||||
$args = new stdClass;
|
||||
$args->document_srls = $obj->source->document_srl;
|
||||
$comment_list = executeQueryArray('comment.getCommentsByDocumentSrls', $args)->data;
|
||||
|
||||
|
||||
$copied_comments = array();
|
||||
foreach($comment_list as $comment)
|
||||
{
|
||||
|
|
@ -2040,24 +2040,24 @@ class CommentController extends Comment
|
|||
$copy->module_srl = $obj->copied->module_srl;
|
||||
$copy->document_srl = $obj->copied->document_srl;
|
||||
$copy->parent_srl = $comment->parent_srl ? $copied_comments[$comment->parent_srl] : 0;
|
||||
|
||||
|
||||
// call a trigger (add)
|
||||
$args = new stdClass;
|
||||
$args->source = $comment;
|
||||
$args->copied = $copy;
|
||||
ModuleHandler::triggerCall('comment.copyCommentByDocument', 'add', $args);
|
||||
|
||||
|
||||
// insert a copied comment
|
||||
$this->insertComment($copy, true);
|
||||
|
||||
|
||||
$copied_comments[$comment->comment_srl] = $copy->comment_srl;
|
||||
}
|
||||
|
||||
|
||||
// update
|
||||
$obj->copied->last_updater = $copy->nick_name;
|
||||
$obj->copied->comment_count = count($copied_comments);
|
||||
}
|
||||
|
||||
|
||||
function triggerCopyModule(&$obj)
|
||||
{
|
||||
$commentConfig = ModuleModel::getModulePartConfig('comment', $obj->originModuleSrl);
|
||||
|
|
|
|||
|
|
@ -93,24 +93,24 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return (bool) ($this->comment_srl);
|
||||
}
|
||||
|
||||
|
||||
function isGranted()
|
||||
{
|
||||
if(!$this->isExists())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (isset($_SESSION['granted_comment'][$this->comment_srl]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->grant_cache !== null)
|
||||
{
|
||||
return $this->grant_cache;
|
||||
}
|
||||
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if (!$logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -124,30 +124,30 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
$grant = ModuleModel::getGrant(ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl')), $logged_info);
|
||||
if ($grant->manager)
|
||||
{
|
||||
return $this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
return $this->grant_cache = false;
|
||||
}
|
||||
|
||||
|
||||
function setGrant()
|
||||
{
|
||||
$this->grant_cache = true;
|
||||
}
|
||||
|
||||
|
||||
function setGrantForSession()
|
||||
{
|
||||
$_SESSION['granted_comment'][$this->comment_srl] = true;
|
||||
$this->setGrant();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the status code.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus()
|
||||
|
|
@ -170,7 +170,7 @@ class CommentItem extends BaseObject
|
|||
|
||||
/**
|
||||
* Return the status in human-readable text.
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getStatusText()
|
||||
|
|
@ -193,7 +193,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($strict)
|
||||
{
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl'));
|
||||
|
|
@ -207,34 +207,34 @@ class CommentItem extends BaseObject
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isset($_SESSION['accessible'][$this->comment_srl]) && $_SESSION['accessible'][$this->comment_srl] === $this->get('last_update'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->get('status') == RX_STATUS_PUBLIC && $this->get('is_secret') !== 'Y')
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if ($this->isGranted())
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
$oDocument = DocumentModel::getDocument($this->get('document_srl'));
|
||||
if ($oDocument->isGranted())
|
||||
{
|
||||
$this->setAccessible();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function setAccessible()
|
||||
{
|
||||
if(Context::getSessionStatus())
|
||||
|
|
@ -242,27 +242,27 @@ class CommentItem extends BaseObject
|
|||
$_SESSION['accessible'][$this->comment_srl] = $this->get('last_update');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isEditable()
|
||||
{
|
||||
return !$this->get('member_srl') || $this->isGranted();
|
||||
}
|
||||
|
||||
|
||||
function isSecret()
|
||||
{
|
||||
return $this->get('status') == RX_STATUS_SECRET || $this->get('is_secret') == 'Y';
|
||||
}
|
||||
|
||||
|
||||
function isDeleted()
|
||||
{
|
||||
return $this->get('status') == RX_STATUS_DELETED || $this->get('status') == RX_STATUS_DELETED_BY_ADMIN;
|
||||
}
|
||||
|
||||
|
||||
function isDeletedByAdmin()
|
||||
{
|
||||
return $this->get('status') == RX_STATUS_DELETED_BY_ADMIN;
|
||||
}
|
||||
|
||||
|
||||
function useNotify()
|
||||
{
|
||||
return $this->get('notify_message') == 'Y';
|
||||
|
|
@ -280,7 +280,7 @@ class CommentItem extends BaseObject
|
|||
return;
|
||||
}
|
||||
|
||||
// pass if the author is not logged-in user
|
||||
// pass if the author is not logged-in user
|
||||
if(!$this->get('member_srl'))
|
||||
{
|
||||
return;
|
||||
|
|
@ -293,7 +293,7 @@ class CommentItem extends BaseObject
|
|||
return;
|
||||
}
|
||||
|
||||
// get where the comment belongs to
|
||||
// get where the comment belongs to
|
||||
$oDocument = DocumentModel::getDocument($this->get('document_srl'));
|
||||
|
||||
// Variables
|
||||
|
|
@ -422,7 +422,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $_SESSION['declared_comment'][$this->comment_srl];
|
||||
}
|
||||
|
||||
|
||||
$args = new stdClass();
|
||||
if ($logged_info->member_srl)
|
||||
{
|
||||
|
|
@ -439,7 +439,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $_SESSION['declared_comment'][$this->comment_srl] = $declared_count;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +461,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
$content = $this->get('content');
|
||||
}
|
||||
|
||||
|
||||
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
|
||||
if($strlen)
|
||||
{
|
||||
|
|
@ -492,7 +492,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
$content = $this->get('content');
|
||||
}
|
||||
|
||||
|
||||
if($strlen)
|
||||
{
|
||||
$content = trim(utf8_normalize_spaces(html_entity_decode(strip_tags($content))));
|
||||
|
|
@ -568,16 +568,16 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
// Remove tags
|
||||
$content = strip_tags($this->getContent(false, false));
|
||||
|
||||
|
||||
// Convert temporarily html entity for truncate
|
||||
$content = html_entity_decode($content, ENT_QUOTES);
|
||||
|
||||
|
||||
// Replace all whitespaces to single space
|
||||
$content = utf8_trim(utf8_normalize_spaces($content));
|
||||
|
||||
|
||||
// Truncate string
|
||||
$content = cut_str($content, $str_size, $tail);
|
||||
|
||||
|
||||
return escape($content);
|
||||
}
|
||||
|
||||
|
|
@ -633,7 +633,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return $this->get('uploaded_count') ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -643,12 +643,12 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->get('uploaded_count'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$file_list = FileModel::getFiles($this->comment_srl, array(), 'file_srl', TRUE);
|
||||
return $file_list;
|
||||
}
|
||||
|
|
@ -755,7 +755,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
$config->thumbnail_quality = 75;
|
||||
}
|
||||
|
||||
|
||||
// If signiture height setting is omitted, create a square
|
||||
if(!is_int($width))
|
||||
{
|
||||
|
|
@ -799,7 +799,7 @@ class CommentItem extends BaseObject
|
|||
{
|
||||
return $thumbnail_url . '?' . date('YmdHis', filemtime($thumbnail_file));
|
||||
}
|
||||
|
||||
|
||||
// return false if neigher attached file nor image;
|
||||
if(!$this->get('uploaded_count') && !preg_match("!<img!is", $this->get('content')))
|
||||
{
|
||||
|
|
@ -846,7 +846,7 @@ class CommentItem extends BaseObject
|
|||
}
|
||||
}
|
||||
|
||||
// get an image file from the doc content if no file attached.
|
||||
// get an image file from the doc content if no file attached.
|
||||
if(!$source_file && $config->thumbnail_target !== 'attachment')
|
||||
{
|
||||
$external_image_min_width = min(100, round($trigger_obj->width * 0.3));
|
||||
|
|
|
|||
|
|
@ -375,9 +375,9 @@ class CommentModel extends Comment
|
|||
|
||||
/**
|
||||
* Get the module info without duplication
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getDistinctModules()
|
||||
|
|
@ -573,7 +573,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
return $trigger_output;
|
||||
}
|
||||
|
||||
|
||||
// If an alternate output is set, use it instead of running the default queries
|
||||
if (isset($args->use_alternate_output) && $args->use_alternate_output instanceof BaseObject)
|
||||
{
|
||||
|
|
@ -587,7 +587,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// insert data into CommentPageList table if the number of results is different from stored comments
|
||||
if(!$output->data)
|
||||
{
|
||||
|
|
@ -605,7 +605,7 @@ class CommentModel extends Comment
|
|||
ModuleHandler::triggerCall('comment.getCommentList', 'after', $output);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Find out which page a comment is on
|
||||
* @param int $document_srl
|
||||
|
|
@ -623,14 +623,14 @@ class CommentModel extends Comment
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// return if no comment exists
|
||||
$document_comment_count = $oDocument->getCommentCount();
|
||||
if($document_comment_count < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// Get the comment count per page
|
||||
if(!$count)
|
||||
{
|
||||
|
|
@ -642,14 +642,14 @@ class CommentModel extends Comment
|
|||
{
|
||||
$comment_count = $count;
|
||||
}
|
||||
|
||||
|
||||
// Get the number of pages
|
||||
$total_pages = max(1, ceil($document_comment_count / $comment_count));
|
||||
if ($total_pages == 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// Find out which page the comment is on
|
||||
$args = new stdClass();
|
||||
$args->document_srl = $document_srl;
|
||||
|
|
@ -961,7 +961,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
// If an alternate output is set, use it instead of running the default queries
|
||||
if (isset($args->use_alternate_output) && $args->use_alternate_output instanceof BaseObject)
|
||||
{
|
||||
|
|
@ -972,7 +972,7 @@ class CommentModel extends Comment
|
|||
{
|
||||
$output = executeQueryArray($query_id, $args, $columnList);
|
||||
}
|
||||
|
||||
|
||||
// return when no result or error occurance
|
||||
if(!$output->toBool() || !count($output->data))
|
||||
{
|
||||
|
|
@ -1132,7 +1132,7 @@ class CommentModel extends Comment
|
|||
|
||||
return $comment_config;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of voting member
|
||||
* @return void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue