Ejemplo n.º 1
0
 private function prepareContent()
 {
     if (!$this->loadCache()) {
         $this->addArticle();
         $this->generatePath();
         $this->generateTitle();
         $this->generateContent();
         $this->applyGlobals();
         $this->saveCache();
     }
     if (isset($this->type) && isset($this->typeId)) {
         $this->gPageInfo = array('type' => $this->type, 'typeId' => $this->typeId, 'name' => $this->name);
     }
     if (!empty($this->path)) {
         $this->pageTemplate['breadcrumb'] = $this->path;
     }
     if (!empty($this->filter)) {
         $this->pageTemplate['filter'] = empty($this->filter['query']) ? 0 : 1;
     }
     if (method_exists($this, 'postCache')) {
         // e.g. update dates for events and such
         $this->postCache();
     }
     if (!empty($this->hasComContent)) {
         $this->community = CommunityContent::getAll($this->type, $this->typeId, $jsGlobals);
         $this->extendGlobalData($jsGlobals);
         // as comments are not cached, those globals cant be either
         $this->applyGlobals();
     }
     $this->time = microtime(true) - $this->time;
     Util::arraySumByKey($this->mysql, DB::Aowow()->getStatistics(), DB::World()->getStatistics());
 }