public function view() { $btl = new BlockTypeList(); $blockTypes = $btl->get(); $dsh = Loader::helper('concrete/dashboard'); $dashboardBlockTypes = array(); if ($dsh->inDashboard()) { $dashboardBlockTypes = BlockTypeList::getDashboardBlockTypes(); } $blockTypes = array_merge($blockTypes, $dashboardBlockTypes); if ($this->page->isMasterCollection()) { $bt = BlockType::getByHandle(BLOCK_HANDLE_PAGE_TYPE_OUTPUT_PROXY); $blockTypes[] = $bt; } if ($_REQUEST['tab']) { Session::set('panels_page_add_block_tab', $_REQUEST['tab']); $tab = $_REQUEST['tab']; } else { $tab = Session::get('panels_page_add_block_tab'); } $sp = Pile::getDefault(); $contents = $sp->getPileContentObjects('date_desc'); $stacks = new StackList(); if (\Core::make('multilingual/detector')->isEnabled()) { $stacks->filterByPageLanguage($this->page); } $stacks->filterByUserAdded(); $this->set('stacks', $stacks->get()); $this->set('contents', $contents); $this->set('tab', $tab); $this->set('blockTypes', $blockTypes); $this->set('ih', Loader::helper('concrete/ui')); $this->set('ci', Loader::helper('concrete/urls')); }
$cp = new Permissions($c); if (!$cp->canViewPage()) { die(t("Access Denied.")); } if (Request::request('task', 'default') === 'delete') { $pileContent = PileContent::get(Request::request('pcID', 0)); if (!$pileContent->getPile()->isMyPile()) { die(t("Access Denied.")); } $pileContent->delete(); } else { $u = new User(); $a = Area::get($c, $_REQUEST['arHandle']); if ($a->isGlobalArea()) { $ax = STACKS_AREA_NAME; $cx = Stack::getByName($_REQUEST['arHandle']); } $b = Block::getByID($_REQUEST['bID'], $cx, $ax); if ($b->getBlockTypeHandle() == BLOCK_HANDLE_SCRAPBOOK_PROXY) { $bi = $b->getInstance(); $b = Block::getByID($bi->getOriginalBlockID()); } $ap = new Permissions($a); if (!$ap->canViewArea()) { die(t("Access Denied.")); } $obj =& $b; $p = Pile::getDefault(); $p->add($obj); $added = true; }
} $p = false; $c = Page::getByID($_REQUEST['cID']); // add a block to a pile $cp = new Permissions($c); if (!$cp->canViewPage()) { exit; } if (Request::request('task', 'default') === 'delete') { PileContent::get(Request::request('pcID', 0))->delete(); } else { $u = new User(); $a = Area::get($c, $_REQUEST['arHandle']); if ($a->isGlobalArea()) { $ax = STACKS_AREA_NAME; $cx = Stack::getByName($_REQUEST['arHandle']); } $b = Block::getByID($_REQUEST['bID'], $cx, $ax); if ($b->getBlockTypeHandle() == BLOCK_HANDLE_SCRAPBOOK_PROXY) { $bi = $b->getInstance(); $b = Block::getByID($bi->getOriginalBlockID()); } $ap = new Permissions($a); if (!$ap->canViewArea()) { exit; } $obj =& $b; $p = \Concrete\Core\Page\Stack\Pile\Pile::getDefault(); $p->add($obj); $added = true; }