Ejemplo n.º 1
0
 /**
  * Display the page
  */
 public function display()
 {
     // parse header
     $this->header->parse();
     // parse breadcrumb
     $this->breadcrumb->parse();
     // parse languages
     $this->parseLanguages();
     // parse footer
     $this->footer->parse();
     // assign the id so we can use it as an option
     $this->tpl->assign('isPage' . $this->pageId, true);
     // the the positions to the template
     $this->parsePositions();
     // assign empty positions
     $unusedPositions = array_diff($this->record['template_data']['names'], array_keys($this->record['positions']));
     foreach ($unusedPositions as $position) {
         $this->tpl->assign('position' . SpoonFilter::ucfirst($position), array());
     }
     // only overwrite when status code is 404
     if ($this->statusCode == 404) {
         SpoonHTTP::setHeadersByCode(404);
     }
     // output
     $this->tpl->display($this->templatePath, false, true);
 }
Ejemplo n.º 2
0
 /**
  * Display the page
  *
  * @return	void
  */
 public function display()
 {
     // parse header
     $this->header->parse();
     // parse breadcrumb
     $this->breadcrumb->parse();
     // parse languages
     $this->parseLanguages();
     // parse footer
     $this->footer->parse();
     // assign the id so we can use it as an option
     $this->tpl->assign('page' . $this->pageId, true);
     // fetch variables from main template
     $mainVariables = $this->tpl->getAssignedVariables();
     // loop all extras
     foreach ((array) $this->extras as $templateVariable => $extra) {
         // fetch extra-specific variables
         $extraVariables = $extra->getTemplate()->getAssignedVariables();
         // assign all main variables
         $extra->getTemplate()->assignArray($mainVariables);
         // overwrite with all specific variables
         $extra->getTemplate()->assignArray($extraVariables);
         // parse extra and assign to main template
         $this->tpl->assign($templateVariable, $extra->getContent());
     }
     // only overwrite when status code is 404
     if ($this->statusCode == 404) {
         SpoonHTTP::setHeadersByCode(404);
     }
     // output
     $this->tpl->display($this->templatePath, false, true);
 }
Ejemplo n.º 3
0
 /**
  * Display the page
  */
 public function display()
 {
     // parse header
     $this->header->parse();
     // parse breadcrumb
     $this->breadcrumb->parse();
     // parse languages
     $this->parseLanguages();
     // parse footer
     $this->footer->parse();
     // assign the id so we can use it as an option
     $this->tpl->assign('isPage' . $this->pageId, true);
     // fetch variables from main template
     $mainVariables = $this->tpl->getAssignedVariables();
     // loop all positions
     foreach ($this->record['positions'] as $position => &$blocks) {
         // loop all blocks in this position
         foreach ($blocks as &$block) {
             // check for extra's that need to be reparsed
             if (isset($block['extra'])) {
                 // fetch extra-specific variables
                 $extraVariables = $block['extra']->getTemplate()->getAssignedVariables();
                 // assign all main variables
                 $block['extra']->getTemplate()->assignArray($mainVariables);
                 // overwrite with all specific variables
                 $block['extra']->getTemplate()->assignArray($extraVariables);
                 // parse extra
                 $block = array('blockIsHTML' => false, 'blockContent' => $block['extra']->getContent());
             }
         }
         // assign position to template
         $this->tpl->assign('position' . SpoonFilter::ucfirst($position), $blocks);
     }
     // assign empty positions
     $unusedPositions = array_diff($this->record['template_data']['names'], array_keys($this->record['positions']));
     foreach ($unusedPositions as $position) {
         $this->tpl->assign('position' . SpoonFilter::ucfirst($position), array());
     }
     // only overwrite when status code is 404
     if ($this->statusCode == 404) {
         SpoonHTTP::setHeadersByCode(404);
     }
     // output
     $this->tpl->display($this->templatePath, false, true);
 }