Exemplo n.º 1
0
 public function editPage()
 {
     $return = array();
     $empty = $_POST['page_to_edid_id'];
     if (!empty($empty)) {
         $page_id = $_POST['page_to_edid_id'];
         $page = new Page($page_id);
         $cat = new CategoryPage();
         $page_name = $_POST['page_name'];
         $title = $_POST['title'];
         $header = $_POST['header'];
         $style = $_POST['style'];
         $content = $_POST['content'];
         $page->setPageName($page_name);
         $page->setTitle($title);
         $page->setHeader($header);
         $page->setStyle($style);
         $page->setContent($content);
         $page->writeData(true);
         $cat->excludePage($page_id);
         $cat->includePage($_POST['category'], $page_id);
         echo '';
         return true;
     }
     $http = new Http();
     $id = $http->post('id');
     $page = new Page($id);
     $cat = new CategoryPage();
     $return['category'] = $cat->getMembershipId($id);
     $return['page_name'] = $page->getPageName();
     $return['title'] = $page->getTitle();
     $return['header'] = $page->getHeader();
     $return['style'] = $page->getStyle();
     $return['content'] = $page->getContent();
     echo json_encode($return);
 }