Пример #1
0
 public function run()
 {
     // retrieve all gatherings
     $list = Gathering::getList();
     foreach ($list as $gathering) {
         // generate all new items since the last time the gathering was updated.
         $gathering->generateGatheringItems();
     }
 }
Пример #2
0
 public function duplicate()
 {
     $db = Loader::db();
     $newag = Gathering::add();
     // dupe data sources
     foreach ($this->getConfiguredGatheringDataSources() as $source) {
         $source->duplicate($newag);
     }
     // dupe items
     foreach ($this->getGatheringItems() as $item) {
         $item->duplicate($newag);
     }
     return $newag;
 }
Пример #3
0
 public function view()
 {
     if ($this->gaID) {
         $gathering = Gathering::getByID($this->gaID);
         if (is_object($gathering)) {
             Core::make('helper/overlay')->init(false);
             if ($this->enablePostingFromGathering && $this->ptID) {
                 $pt = PageType::getByID($this->ptID);
                 Core::make('helper/concrete/composer')->addAssetsToRequest($pt, $this);
                 $p = new Permissions($pt);
                 if ($p->canEditPageTypeInComposer()) {
                     $this->set('pagetype', $pt);
                 }
             }
             $list = new GatheringItemList($gathering);
             $list->sortByDateDescending();
             $list->setItemsPerPage($this->itemsPerPage);
             $this->set('gathering', $gathering);
             $this->set('itemList', $list);
         }
     }
 }