* default config and the general and error functions. More control is possible * here, but some things have already been loaded and are immutable. */ if (file_exists(PATH_CONF . '/bootstrap.early.php')) { require_once PATH_CONF . '/bootstrap.early.php'; } Gdn::config()->caching(true); debug(c('Debug', false)); setHandlers(); /** * Installer Redirect * * If Garden is not yet installed, force the request to /dashboard/setup and * begin installation. */ if (Gdn::config('Garden.Installed', false) === false && strpos(Gdn_Url::request(), 'setup') === false) { safeHeader('Location: ' . Gdn::request()->url('dashboard/setup', true)); exit; } /** * Extension Managers * * Now load the Addon, Application, Theme and Plugin managers into the Factory, and * process the application-specific configuration defaults. */ // ApplicationManager Gdn::factoryInstall(Gdn::AliasApplicationManager, 'Gdn_ApplicationManager', '', Gdn::FactorySingleton, [Gdn::addonManager()]); // ThemeManager Gdn::factoryInstall(Gdn::AliasThemeManager, 'Gdn_ThemeManager', '', Gdn::FactorySingleton, [Gdn::addonManager()]); // PluginManager Gdn::factoryInstall(Gdn::AliasPluginManager, 'Gdn_PluginManager', '', Gdn::FactorySingleton, [Gdn::addonManager()]);
/** * Checks whether the current request url matches an item's link url. * * @param array $item The item to check. * @return bool Whether the current request url matches an item's link url. */ protected function isActive($item) { if (empty($this->highlightRoute)) { $highlightRoute = Gdn_Url::request(true); } else { $highlightRoute = url($this->highlightRoute); } return val('url', $item) && trim(url(val('url', $item)), '/') == trim($highlightRoute, '/'); }
/** * Checks whether the current request url matches an item's link url. * * @param array $item The item to check. * @return bool Whether the current request url matches an item's link url. */ public function isActive($item) { $highlightRoute = Gdn_Url::request(); $highlightUrl = Url($highlightRoute); return val('linkUrl', $item) && Url(val('linkUrl', $item)) == $highlightUrl; }