#581 댓글관리 '휴지통' 이동 추가

This commit is contained in:
akasima 2014-03-18 21:46:42 +09:00
parent c05bceccf2
commit 2e96c67571
3 changed files with 38 additions and 0 deletions

View file

@ -340,6 +340,35 @@ class commentAdminController extends comment
}
}
/**
* @fn procCommentAdminMoveToTrash
* @brief move a comment to trash
* @see commentModel::getCommentMenu
*/
function procCommentAdminMoveToTrash()
{
$oDB = DB::getInstance();
$oDB->begin();
$comment_srl = Context::get('comment_srl');
$oCommentModel = getModel('comment');
$oCommentController = getController('comment');
$oComment = $oCommentModel->getComment($comment_srl, false);
if(!$oComment->isGranted()) return $this->stop('msg_not_permitted');
$message_content = "";
$this->_moveCommentToTrash(array($comment_srl), $oCommentController, $oDB, $message_content);
$isTrash = true;
$output = $oCommentController->deleteComment($comment_srl, TRUE, $isTrash);
$oDB->commit();
$returnUrl = Context::get('cur_url');
$this->add('redirect_url', $returnUrl);
}
/**
* Cancel the blacklist of abused comments reported by other users
* @return void|object

View file

@ -76,6 +76,13 @@ class commentModel extends comment
// call a trigger (after)
ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list);
if($this->grant->manager){
$str_confirm = Context::getLang('confirm_move');
$url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['comment_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('comment', 'procCommentAdminMoveToTrash', params)", $str_confirm, $comment_srl);
$oCommentController->addCommentPopupMenu($url,'cmd_trash','','javascript');
}
// find a comment by IP matching if an administrator.
if($logged_info->is_admin == 'Y')
{

View file

@ -4,6 +4,7 @@
<permissions>
<permission action="procCommentAdminAddCart" target="manager" />
<permission action="procCommentGetList" target="manager" />
<permission action="procCommentAdminMoveToTrash" target="manager" />
</permissions>
<actions>
<action name="getCommentMenu" type="model" />
@ -21,6 +22,7 @@
<action name="procCommentAdminCancelDeclare" type="controller" />
<action name="procCommentAdminAddCart" type="controller" />
<action name="procCommentGetList" type="controller" />
<action name="procCommentAdminMoveToTrash" type="controller" />
</actions>
<menus>
<menu name="comment">