/** * Test if the current path is within the dashboard. * Optionally, a Page or path can be passed to test. * * @param bool|\Concrete\Core\Page\Page|string $page (optional) * @return bool */ public function inDashboard($page = false) { $path = ""; if ($page instanceof Page && !$page->isError()) { $path = $page->getCollectionPath(); } elseif (is_string($page)) { $path = $page; } else { $page = Page::getCurrentPage(); if ($page instanceof Page && !$page->isError()) { $path = $page->getCollectionPath(); } } return strpos($path, '/dashboard') === 0; }
/** * Test if the current path is within the dashboard. * Optionally, a Page or path can be passed to test. * * @param bool|\Concrete\Core\Page\Page|string $page (optional) * * @return bool */ public function inDashboard($page = false) { $view = \View::getInstance(); if (is_object($view) && $view->getThemeHandle() == 'dashboard') { return true; } $path = ""; if ($page instanceof Page && !$page->isError()) { $path = $page->getCollectionPath(); } elseif (is_string($page)) { $path = $page; } else { $page = Page::getCurrentPage(); if ($page instanceof Page && !$page->isError()) { $path = $page->getCollectionPath(); } } return strpos($path, '/dashboard') === 0; }
public function isError() { return parent::isError(); }