public function __construct($book)
 {
     $this->render = $book->getBookRenderer();
     $this->render->setMode('static');
     $this->book = $book;
     $this->booKey = $book->getBookKey();
     if ($this->book->getBookLanguage()) {
         colesoApplication::setLanguage($this->book->getBookLanguage(), $this->book->getBookLocale());
         colesoApplication::loadMessages('bulldoc/messages');
     }
     $this->toc = $this->render->getToc();
     $this->outputPath = rtrim($book->getBookDest(), '\\/') . '/';
     $this->mediaExt = 'gif,jpg,jpeg,png,pdf,zip,gz,tgz,css,js';
     $this->themeManager = $this->render->getThemeManager();
 }
Example #2
0
 protected function buildEnvironment()
 {
     $this->url = $this->Environment->getReqVar('colesoRequestPath');
     if ($this->checkRedirectToIndex()) {
         $this->Environment->redirect(colesoApplication::getConfigVal('/bulldoc/rootUrl') . rtrim($this->url, '\\/') . '/index.html');
     }
     $this->getAction();
     $this->parameters = array('bookLoader' => $this->bookLoader, 'url' => $this->getPageUrl());
     if ($this->action != 'bookshelf' && $this->action != 'book_edit' && $this->action != 'bookshelf_edit') {
         $bookKey = $this->getBookKey();
         $this->parameters['bookKey'] = $bookKey;
         $book = $this->bookLoader->getBook($bookKey);
         $this->parameters['book'] = $book;
         if ($book->getBookLanguage()) {
             colesoApplication::setLanguage($book->getBookLanguage(), $book->getBookLocale());
             colesoApplication::loadMessages('bulldoc/messages');
         }
     }
 }