Esempio n. 1
0
 /**
  * Controller-Processing
  * @return boolean
  */
 public function process()
 {
     parent::process();
     $parsed = array();
     if ($this->cache->isExpired() || $this->session->exists()) {
         $conditions = array('limit' => array($this->limit, $this->listShowLimit), 'archived' => 0, 'postponed' => 0, 'orderby' => array('pinned DESC, ' . $this->config->articles_sort . ' ' . $this->config->articles_sort_order));
         if ($this->category !== 0) {
             $conditions['category'] = $this->category;
         }
         $articles = $this->articleList->getArticlesByCondition($conditions);
         foreach ($articles as $article) {
             $parsed[] = $this->assignData($article);
         }
         $countConditions = array();
         $countConditions['active'] = true;
         if ($this->category !== 0) {
             $countConditions['category'] = $this->category;
         }
         $parsed[] = $this->createPagination($this->articleList->countArticlesByCondition($countConditions));
         $parsed = $this->events->runEvent('publicShowAll', $parsed);
         if (!$this->session->exists()) {
             $this->cache->write($parsed, $this->config->system_cache_timeout);
         }
     } else {
         $parsed = $this->cache->read();
     }
     $content = implode(PHP_EOL, $parsed);
     if (!$this->isUtf8) {
         $content = utf8_decode($content);
     }
     $this->view->assign('content', $content);
     $this->view->assign('systemMode', $this->config->system_mode);
     $this->view->render();
 }