| @@ 97-106 (lines=10) @@ | ||
| 94 | */ |
|
| 95 | public function handleAction(GridField $gridField, $actionName, $arguments, $data) |
|
| 96 | { |
|
| 97 | if ($actionName == 'spam') { |
|
| 98 | $comment = Comment::get()->byID($arguments['RecordID']); |
|
| 99 | $comment->markSpam(); |
|
| 100 | ||
| 101 | // output a success message to the user |
|
| 102 | Controller::curr()->getResponse()->setStatusCode( |
|
| 103 | 200, |
|
| 104 | _t('CommentsGridFieldAction.COMMENTMARKEDSPAM', 'Comment marked as spam.') |
|
| 105 | ); |
|
| 106 | } |
|
| 107 | ||
| 108 | if ($actionName == 'approve') { |
|
| 109 | $comment = Comment::get()->byID($arguments['RecordID']); |
|
| @@ 108-117 (lines=10) @@ | ||
| 105 | ); |
|
| 106 | } |
|
| 107 | ||
| 108 | if ($actionName == 'approve') { |
|
| 109 | $comment = Comment::get()->byID($arguments['RecordID']); |
|
| 110 | $comment->markApproved(); |
|
| 111 | ||
| 112 | // output a success message to the user |
|
| 113 | Controller::curr()->getResponse()->setStatusCode( |
|
| 114 | 200, |
|
| 115 | _t('CommentsGridFieldAction.COMMENTAPPROVED', 'Comment approved.') |
|
| 116 | ); |
|
| 117 | } |
|
| 118 | } |
|
| 119 | } |
|
| 120 | ||