Beispiel #1
0
        public function view() {
			Loader::helper('overlay')->init(false);
			$gathering = Gathering::getByID($this->gaID);
			if (is_object($gathering)) {
				$list = new GatheringItemList($gathering);
				$list->sortByDateDescending();
				$this->set('gathering', $gathering);
				$this->set('itemList', $list);
			}
		}
 public function view()
 {
     $r = ResponseAssetGroup::get();
     $r->requireAsset('core/gathering');
     Loader::helper('overlay')->init(false);
     $gathering = Gathering::getByID($this->gaID);
     if (is_object($gathering)) {
         $list = new GatheringItemList($gathering);
         $list->sortByDateDescending();
         $this->set('gathering', $gathering);
         $this->set('itemList', $list);
     }
 }
Beispiel #3
0
<?php

defined('C5_EXECUTE') or die("Access Denied.");
$nh = Loader::helper('validation/numbers');
if ($_POST['gaID'] && $nh->integer($_POST['gaID'])) {
    $gathering = Gathering::getByID($_POST['gaID']);
    if (is_object($gathering) && Loader::helper('validation/token')->validate('get_gathering_items', $_POST['loadToken'])) {
        $showTileControls = $_POST['showTileControls'] && Loader::helper('validation/token')->validate('update_gathering_items', $_POST['editToken']);
        $list = new GatheringItemList($gathering);
        $list->sortByDateDescending();
        $list->setItemsPerPage($_REQUEST['itemsPerPage']);
        $items = $list->getPage($_REQUEST['page']);
        foreach ($items as $item) {
            Loader::element('gathering/tile', array("item" => $item, 'showTileControls' => $showTileControls));
        }
    }
}
Beispiel #4
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);
         }
     }
 }
Beispiel #5
0
                    if (!$sh) {
                        $sh = 1;
                    }
                    $agi->setGatheringItemSlotWidth($sw);
                    $agi->setGatheringItemSlotHeight($sh);
                    break;
                case 'update_display_order':
                    $displayOrder = 0;
                    $batch = time();
                    foreach ($_POST['gaiID'] as $gaiID) {
                        $agi = GatheringItem::getByID($gaiID);
                        $agi->setGatheringItemBatchTimestamp($batch);
                        $agi->setGatheringItemBatchDisplayOrder($displayOrder);
                        ++$displayOrder;
                    }
                    break;
                case 'move_to_new_gathering':
                    $item = GatheringItem::getByID($_POST['gaiID']);
                    $item->moveToNewGathering($gathering);
                    $il = new GatheringItemList($gathering);
                    $il->sortByDateDescending();
                    $il->setItemsPerPage($_POST['itemsPerPage']);
                    $c = Page::getByID($_POST['cID'], 'RECENT');
                    if (is_object($c) && !$c->isError()) {
                        Loader::element('gathering/display', array('gathering' => $gathering, 'list' => $il, 'c' => $c));
                    }
                    break;
            }
        }
    }
}
Beispiel #6
0
<?php

defined('C5_EXECUTE') or die("Access Denied.");
$nh = Loader::helper('validation/numbers');
if ($_POST['gaID'] && $nh->integer($_POST['gaID'])) {
    $gathering = Gathering::getByID($_POST['gaID']);
    if (is_object($gathering) && Loader::helper('validation/token')->validate('update_gathering_items', $_POST['editToken'])) {
        $showTileControls = $_POST['showTileControls'] && Loader::helper('validation/token')->validate('update_gathering_items', $_POST['editToken']);
        $item = GatheringItem::getByID($_POST['newerThan']);
        if (is_object($item) && $item->getGatheringID() == $gathering->getGatheringID()) {
            $gathering->generateGatheringItems();
            $list = new GatheringItemList($gathering);
            $list->sortByDateAscending();
            // we sort by date ascending so we can get the ones closest to the last one we've seen, so in case we have to keep refreshing we can do so.
            $list->setItemsPerPage($_REQUEST['itemsPerPage']);
            $list->filterByPublicDate($item->getGatheringItemPublicDateTime(), '>');
            $items = $list->getPage();
            foreach ($items as $item) {
                Loader::element('gathering/tile', array("item" => $item, 'showTileControls' => $showTileControls));
            }
        }
    }
}