Ejemplo n.º 1
0
 /**
  * Handles a page connected to the processes route
  */
 public function process()
 {
     // TODO: observer entity_process_before pass $this (?)
     $routeResolver = $this->balcon->getRouteResolver();
     $page = new Page($routeResolver->getRoute());
     $page->process();
     $this->setEntity($page);
 }
Ejemplo n.º 2
0
 /**
  * Processes response for the handled Blog page
  *
  * @param Page $page
  * @return string
  * @throws \Exception
  */
 protected function processBlogPage(Page $page)
 {
     $dispatchedPage = $page->getDispatchedBlock();
     if ($dispatchedPage) {
         /* Check the route to identify the blog page type index or post */
         // TODO: implement as a separate routine that has a list of routes for listofposts page
         $pageIsBlogpost = count(explode('/', $page->getRoute())) > 1;
         $defaultTemplate = $pageIsBlogpost ? 'blogpost.blade.php' : 'blog.blade.php';
         $this->setTemplatesProcessor(new TemplatesProcessor($defaultTemplate));
         $this->rawView = $this->templatesProcessor->applyPageBlocksTemplates($dispatchedPage);
         $this->renderer = new Renderer($this->templatesProcessor->getResultViewParams());
         if (!$pageIsBlogpost) {
             $this->renderer->collectListOfPosts($page);
         }
         $this->renderer->setNavigationItems($page->getNavigationItems());
     } else {
         throw new \Exception("No CMS page has been dispatched");
     }
 }
Ejemplo n.º 3
0
 /**
  * Processes response for the handled CMS page
  *
  * @param Page $page
  * @return string
  * @throws \Exception
  */
 protected function processCmsPage(Page $page)
 {
     $dispatchedPage = $page->getDispatchedBlock();
     if ($dispatchedPage) {
         $view = $this->templatesProcessor->applyPageBlocksTemplates($dispatchedPage);
         $response = view($view, $this->templatesProcessor->getResultViewParams())->render();
         return $response;
     } else {
         throw new \Exception("No CMS page has been dispatched");
     }
 }
Ejemplo n.º 4
0
 /**
  * Processes response for the handled CMS page
  *
  * @param Page $page
  * @throws \Exception
  */
 protected function processCmsPage(Page $page)
 {
     $dispatchedPage = $page->getDispatchedBlock();
     if ($dispatchedPage) {
         $this->setTemplatesProcessor(new TemplatesProcessor('default.blade.php'));
         $this->rawView = $this->templatesProcessor->applyPageBlocksTemplates($dispatchedPage);
         $this->renderer = new Renderer($this->templatesProcessor->getResultViewParams());
         $this->renderer->setNavigationItems($page->getNavigationItems());
     } else {
         throw new \Exception("No CMS page has been dispatched");
     }
 }
Ejemplo n.º 5
0
 /**
  * Collects list of posts for current page
  *
  * @param Page $post
  */
 public function collectListOfPosts(Page $post)
 {
     $pagesCollection = $post->getBlocksCollection();
     $blogPostsCollection = $pagesCollection->getBlock(Plugin::getConfig('blogRootBlockName'))->getChildren();
     $this->listOfPosts = $this->sortPosts($blogPostsCollection);
 }