<commit_before><?php
namespace Concrete\Controller\Element\Navigation;

use Concrete\Core\Controller\ElementController;
use Concrete\Core\Entity\Express\Entity;
use Concrete\Core\Page\Page;
use Concrete\Core\Page\PageList;

class DashboardMenu extends ApplicationMenu
{

    public function __construct(Page $currentPage)
    {
        $dashboard = \Page::getByPath('/dashboard');
        parent::__construct($dashboard, $currentPage);
    }

    public function displayChildPages(Page $page)
    {
        $display = parent::displayChildPages($page);
        if ($display) {
            return true;
        } else {
            if (
                strpos($this->currentPage->getCollectionPath(), '/account') === 0 &&
                (
                    strpos($page->getCollectionPath(), '/dashboard/welcome') === 0 ||
                    strpos($page->getCollectionPath(), '/account') === 0
                )
            ) {
                return true;
            }
        }
    }

    protected function getPageList($parent)
    {
        $list = parent::getPageList($parent);
        $list->includeSystemPages();
        $list->includeAliases();
        return $list;
    }

    public function getMenuItemClass(Page $page)
    {
        $class = parent::getMenuItemClass($page);
        $classes = explode(' ', $class);
        if (
            strpos($this->currentPage->getCollectionPath(), '/account') === 0 &&
            (
                strpos($page->getCollectionPath(), '/dashboard/welcome') === 0 ||
                strpos($page->getCollectionPath(), '/account') === 0
            )
        ) {
            $classes[] = 'nav-path-selected';<commit_msg>add function that checks if dashboard panel should render a top level menu which decides whether the link to the menu item is a real link or if it should load a panel when it is clicked instead<commit_after><?php
namespace Concrete\Controller\Element\Navigation;

use Concrete\Core\Controller\ElementController;
use Concrete\Core\Entity\Express\Entity;
use Concrete\Core\Page\Page;
use Concrete\Core\Page\PageList;

class DashboardMenu extends ApplicationMenu
{

    public function __construct(Page $currentPage)
    {
        $dashboard = \Page::getByPath('/dashboard');
        parent::__construct($dashboard, $currentPage);
    }

    public function displayChildPages(Page $page)
    {
        $display = parent::displayChildPages($page);
        if ($display) {
            return true;
        } else {
            if (
                strpos($this->currentPage->getCollectionPath(), '/account') === 0 &&
                (
                    strpos($page->getCollectionPath(), '/dashboard/welcome') === 0 ||
                    strpos($page->getCollectionPath(), '/account') === 0
                )
            ) {
                return true;
            }
        }
    }

    public function displayTopLevelMenu(Page $page) {
      $pagePath = $page->getCollectionPath();
      if ($pagePath == '/dashboard/welcome' || $pagePath == '/dashboard/system') {
        return true;
      }
      $result = $pagePath;
      return $result;
    }

    protected function getPageList($parent)
    {
        $list = parent::getPageList($parent);
        $list->includeSystemPages();
        $list->includeAliases();
        return $list;
    }

    public function getMenuItemClass(Page $page)
    {
        $class = parent::getMenuItemClass($page);
        $classes = explode(' ', $class);
        if (
            strpos($this->currentPage->getCollectionPath(), '/account') === 0 &&
            (
                strpos($page->getCollectionPath(), '/dashboard/welcome') === 0 ||
                strpos($page->getCollectionPath(), '/account') === 0
            )
        ) {
            $classes[] = 'nav-path-selected';
{'fraction_non_alphanumeric': 0.13645943097997892, 'fraction_numerical': 0.003161222339304531, 'mean_word_length': 2.1380165289256197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1690483', 'n_tokens_mistral': 1011, 'n_tokens_neox': 986, 'n_words': 205}