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