public function view() { if ($this->request->get('tab')) { Cookie::set('panels/dashboard/tab', $this->request->get('tab')); $tab = $this->request->get('tab'); } else { $tab = Cookie::get('panels/dashboard/tab'); } $nav = array(); if ($tab != 'favorites') { $nav = new \Concrete\Controller\Element\Navigation\DashboardMenu($this->page); $this->set('nav', $nav); } else { $dh = Loader::helper('concrete/dashboard'); $qn = \Concrete\Core\Application\Service\DashboardMenu::getMine(); foreach ($qn->getItems() as $path) { $c = Page::getByPath($path, 'ACTIVE'); if (is_object($c) && !$c->isError()) { $nav[] = $c; } } $this->set('nav', $nav); } $u = new User(); $ui = UserInfo::getByID($u->getUserID()); $this->set('ui', $ui); $this->set('tab', $tab); }
public function on_start() { $this->token = Loader::helper('validation/token'); $this->error = Loader::helper('validation/error'); $this->set('interface', Loader::helper('concrete/ui')); $this->set('dashboard', Loader::helper('concrete/dashboard')); $this->entityManager = \Core::make('Doctrine\\ORM\\EntityManager'); $hideDashboardPanel = false; if (\Cookie::has('dashboardPanelStatus') && \Cookie::get('dashboardPanelStatus') == 'closed') { $hideDashboardPanel = true; } $this->set('hideDashboardPanel', $hideDashboardPanel); \Core::make('helper/concrete/dashboard'); $dh = \Concrete\Core\Application\Service\DashboardMenu::getMine(); if ($dh->contains($this->getPageObject())) { $this->set("_bookmarked", true); } else { $this->set('_bookmarked', false); } }
public function view() { if ($this->request->get('tab')) { Cookie::set('panels/dashboard/tab', $this->request->get('tab')); $tab = $this->request->get('tab'); } else { $tab = Cookie::get('panels/dashboard/tab'); } $nav = array(); if ($tab != 'favorites') { $c = Page::getByPath('/dashboard'); $bt = BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'custom'; $bt->controller->displaySystemPages = true; $bt->controller->displayPagesCID = $c->getCollectionID(); $bt->controller->orderBy = 'display_asc'; $bt->controller->displaySubPages = 'relevant'; $bt->controller->displaySubPageLevels = 'all'; $bt->controller->set('translate', true); $this->set('nav', $bt); } else { $dh = Loader::helper('concrete/dashboard'); $qn = \Concrete\Core\Application\Service\DashboardMenu::getMine(); foreach ($qn->getItems() as $path) { $c = Page::getByPath($path, 'ACTIVE'); if (is_object($c) && !$c->isError()) { $nav[] = $c; } } $this->set('nav', $nav); } $u = new User(); $ui = UserInfo::getByID($u->getUserID()); $this->set('ui', $ui); $this->set('tab', $tab); }
$ish = Loader::helper('concrete/ui'); $canAdd = false; if ($ih->integer($_REQUEST['cID'])) { $c = Page::getByID($_REQUEST['cID']); if (is_object($c) && !$c->isError()) { $cp = new Permissions($c); if ($dh->inDashboard($c)) { if ($cp->canViewPage()) { $canAdd = true; } } } } $ish->clearInterfaceItemsCache(); if ($canAdd) { $u = new User(); $r = new stdClass(); if (Loader::helper('validation/token')->validate('access_quick_nav', $_REQUEST['token'])) { $qn = \Concrete\Core\Application\Service\DashboardMenu::getMine(); if ($qn->contains($c)) { $qn->remove($c); $task = 'add'; } else { $qn->add($c); $task = 'remove'; } $u->saveConfig('QUICK_NAV_BOOKMARKS', serialize($qn)); echo $dh->getDashboardAndSearchMenus(); exit; } }