/** * The delete handler. * * @access public * @param int $id The Page id. * @return string The JSON response. */ public function delete($id = null) { $response = array('result' => 0); $Page = new Content_Page(); $Page = $Page->findItem(array('Id = ' . $id)); if ($Page->Id) { if ($Page->drop()) { Router::detachPage($Page); $response['result'] = 1; } else { $response['msg'] = 'Не могу удалить данные'; } } else { $response['msg'] = 'Страница не найдена'; } return $this->outputJSON($response); }