Ejemplo n.º 1
0
 public function filterUpdateLuceneIndex($args)
 {
     $slug = $args['stored']['slug_stored'];
     // We are only interested in the virtual pages associated with
     // this engine, leave the actual engine pages alone
     if (preg_match('/^@.*?(\\d+)$/', $slug, $matches)) {
         $id = $matches[1];
     } else {
         return $args;
     }
     $event = aEventTable::getInstance()->find($id);
     if (!$event) {
         return false;
     }
     $this->storeArguments($args, $event);
     return $args;
 }
 public function executeNormalView()
 {
     $this->setup();
     $this->values = $this->slot->getArrayValue();
     $q = Doctrine::getTable($this->modelClass)->createQuery()->leftJoin($this->modelClass . '.Author a')->leftJoin($this->modelClass . '.Categories c');
     Doctrine::getTable($this->modelClass)->addPublished($q);
     if (isset($this->values['categories_list']) && count($this->values['categories_list']) > 0) {
         $q->andWhereIn('c.id', $this->values['categories_list']);
     }
     if (isset($this->values['tags_list']) && strlen($this->values['tags_list']) > 0) {
         PluginTagTable::getObjectTaggedWithQuery($q->getRootAlias(), $this->values['tags_list'], $q, array('nb_common_tags' => 1));
     }
     $limit = isset($this->values['count']) ? $this->values['count'] : 5;
     $this->options['slideshowOptions']['width'] = isset($this->options['slideshowOptions']['width']) ? $this->options['slideshowOptions']['width'] : 100;
     $this->options['slideshowOptions']['height'] = isset($this->options['slideshowOptions']['height']) ? $this->options['slideshowOptions']['height'] : 100;
     $this->options['slideshowOptions']['resizeType'] = isset($this->options['slideshowOptions']['resizeType']) ? $this->options['slideshowOptions']['resizeType'] : 'c';
     $this->options['excerptLength'] = $this->getOption('excerptLength', 100);
     $this->options['maxImages'] = $this->getOption('maxImages', 1);
     aEventTable::getInstance()->addUpcoming($q, $limit);
     $this->aEvents = $q->execute();
     aBlogItemTable::populatePages($this->aEvents);
 }