Esempio n. 1
0
 /**
  * Spusti bobra.
  *
  */
 private function getBobr()
 {
     // veskery odeslany obsah zacnem bufferovat
     ob_start();
     echo '<p>Tyto blahy se daji vypnout v configu. Jedna se o debugMode</p>';
     $this->setUser();
     try {
         // Vytvorime si zaklad z url.
         $process = new Bobr_Process();
         print_Re($process);
         if (0 < $process->getPageId()) {
             $page = new Bobr_Page_Page($process->pageId);
             // Nastavime jazyk pro popiskovac a dame mu i informaci o pageId kvuli cachovani
             $description = Bobr_DescriptionList::getInstance($process->getLang(), $process->getPageId());
             // Nastavime jazyk generatoru linku
             Lib_LinkCreator::setLang($process->getLang());
             // To co se do ted vypsalo vypisem pod html kodem.
             $errorOutput = ob_get_contents();
             ob_end_clean();
             $config = new Config();
             $template = Bobr_Page_Template::getInstance();
             $template->setContainerColection($page->getContainerColection())->setCommand($process->getCommand());
             Bobr_Page_Template::add('title', 'Vitej');
             $template->addCssLink($page->getCss());
             $template->load(__WEB_ROOT__ . $config->share . $page->getTemplate(), FALSE);
             echo $template;
         } else {
             throw new Bobr_BobrException('Z nejakeho duvodu se nepovedlo nacist stranku.');
         }
     } catch (Bobr_Page_PageException $e) {
         // Nemuze se vytvorit stranka, vyhodime nejvissi vyjimku.
         throw new Bobr_BobrException($e->getMessage());
     } catch (Bobr_Page_TemplateException $e) {
         throw new Bobr_BobrException($e->getMessage());
     }
     echo $this->getErrorOutput($errorOutput);
 }
Esempio n. 2
0
 /**
  * Prida do sablony promenou a jeji hodnotu.
  *
  * @param string $name
  * @param mixed $value
  * @return mixed
  */
 protected function addToTemplate($name, $value)
 {
     Bobr_Page_Template::add($name, $value);
     return $this;
 }