DashboardNavModule::isActiveSection PHP Method

isActiveSection() private method

private isActiveSection ( $section )
    private function isActiveSection($section)
    {
        $allSectionsInfo = array_merge(self::$sectionsInfo, self::$altSectionsInfo);
        $allSections = [];
        foreach ($allSectionsInfo as $sectionInfo) {
            $allSections[] = $sectionInfo['section'];
        }
        $currentSections = Gdn_Theme::section('', 'get');
        $found = false;
        foreach ($currentSections as $currentSection) {
            if ($currentSection == $section) {
                return true;
            }
            if (in_array($currentSection, $allSections)) {
                $found = true;
            }
        }
        // We're active if the section is 'Settings' and the $currentSection doesn't exist in allsections
        if (!$found && $section == self::ACTIVE_SECTION_DEFAULT) {
            return true;
        }
        return false;
    }