Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function modifyApproved() |
||
24 | { |
||
25 | $this->onlyAdmin(); |
||
26 | $this->onlyPost(); |
||
27 | $state = (bool)($this->request->getData("state") === 'true'); |
||
28 | $commentId = (int)$this->request->getData("commentId"); |
||
29 | |||
30 | $result = array(); |
||
31 | $result["success"] = $this->commentModel->setApproved(!$state, $commentId); |
||
32 | $result["state"] = !$state; |
||
33 | $result["commentId"] = $commentId; |
||
34 | echo json_encode($result); |
||
35 | } |
||
37 | } |