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