| @@ 78-87 (lines=10) @@ | ||
| 75 | * {@inheritdoc} |
|
| 76 | */ |
|
| 77 | public function handleAction(GridField $gridField, $actionName, $arguments, $data) { |
|
| 78 | if($actionName == 'spam') { |
|
| 79 | $comment = Comment::get()->byID($arguments["RecordID"]); |
|
| 80 | $comment->markSpam(); |
|
| 81 | ||
| 82 | // output a success message to the user |
|
| 83 | Controller::curr()->getResponse()->setStatusCode( |
|
| 84 | 200, |
|
| 85 | 'Comment marked as spam.' |
|
| 86 | ); |
|
| 87 | } |
|
| 88 | ||
| 89 | if($actionName == 'approve') { |
|
| 90 | $comment = Comment::get()->byID($arguments["RecordID"]); |
|
| @@ 89-98 (lines=10) @@ | ||
| 86 | ); |
|
| 87 | } |
|
| 88 | ||
| 89 | if($actionName == 'approve') { |
|
| 90 | $comment = Comment::get()->byID($arguments["RecordID"]); |
|
| 91 | $comment->markApproved(); |
|
| 92 | ||
| 93 | // output a success message to the user |
|
| 94 | Controller::curr()->getResponse()->setStatusCode( |
|
| 95 | 200, |
|
| 96 | 'Comment approved.' |
|
| 97 | ); |
|
| 98 | } |
|
| 99 | } |
|
| 100 | } |
|
| 101 | ||