Add option to control updating the document's last-updated timestamp when a comment is posted

This commit is contained in:
Kijin Sung 2017-05-07 21:37:37 +09:00
parent 8c797aaba1
commit d3db01aae0
7 changed files with 49 additions and 35 deletions

View file

@ -290,9 +290,10 @@ class commentController extends comment
* Enter comments
* @param object $obj
* @param bool $manual_inserted
* @param bool $update_document
* @return object
*/
function insertComment($obj, $manual_inserted = FALSE)
function insertComment($obj, $manual_inserted = FALSE, $update_document = TRUE)
{
if(!$manual_inserted && !checkCSRF())
{
@ -565,16 +566,9 @@ class commentController extends comment
$oDocumentController = getController('document');
// Update the number of comments in the post
if(!$using_validation)
if(!$using_validation || $is_admin)
{
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
}
else
{
if($is_admin)
{
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, TRUE);
}
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, $update_document);
}
// call a trigger(after)