| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function modifyOnFrontPage() |
||
| 36 | { |
||
| 37 | $this->onlyAdmin(); |
||
| 38 | if (!$this->container->getRequest()->isPost()) { |
||
| 39 | throw new \Core\JsonException('Call is not post'); |
||
| 40 | } |
||
| 41 | $state = ($this->request->getData("state") === 'true'); |
||
| 42 | $postId = (int)$this->request->getData("postId"); |
||
| 43 | |||
| 44 | $result["success"] = $this->postModule->setOnFrontPage(!$state, $postId); |
||
| 45 | $result["state"] = !$state; |
||
| 46 | $result["postId"] = $postId; |
||
| 47 | echo json_encode($result); |
||
| 48 | } |
||
| 49 | } |