Esempio n. 1
0
 public function postPreviewComment($preview_key)
 {
     try {
         $version = $this->pageRepository->getVersionByPreviewKey($preview_key);
         $this->pageRepository->addVersionComment($version, Input::all());
         return Redirect::to('pages/preview/' . $preview_key)->with('comment_saved', true);
     } catch (PageVersionNotFound $exception) {
         return App::abort('404');
     } catch (ValidationException $exception) {
         return Redirect::to('pages/preview/' . $preview_key)->with('invalid_fields', $exception->getInvalidFields())->withInput();
     }
 }
Esempio n. 2
0
 /**
  * @param $version
  * @param $publish_handler
  * @param $data
  * @return mixed
  */
 public function executePublishHandler($version, $publish_handler, $data)
 {
     $publish_handler = $this->callModuleMethod('getPublishHandler', [$publish_handler]);
     if ($publish_handler) {
         return $this->repository->executePublishHandler($version, $publish_handler, $data);
     }
 }
Esempio n. 3
0
 /**
  * @param $query
  * @return mixed
  */
 private function addOrdering($query)
 {
     if ($this->using_custom_order) {
         return $query;
     }
     $order = 'manual';
     if ($this->parent_page_id != 0) {
         try {
             $parent = $this->repository->findById($this->parent_page_id);
             $order = $parent->sub_page_order;
         } catch (\CoandaCMS\Coanda\Pages\Exceptions\PageNotFound $exception) {
             // Default to manual above...
         }
     }
     $query = $this->handleOrder($order, $query);
     return $query;
 }
Esempio n. 4
0
 /**
  * @return mixed
  */
 public function first()
 {
     $list = $this->pageRepository->subPageList($this->page_id, $this->limit, $this->buildParameters());
     return $list->first();
 }