Differential D13589 Diff 33531 src/applications/settings/controller/PhabricatorSettingsMainController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/controller/PhabricatorSettingsMainController.php
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| return $this->buildApplicationPage( | return $this->buildApplicationPage( | ||||
| $nav, | $nav, | ||||
| array( | array( | ||||
| 'title' => $panel->getPanelName(), | 'title' => $panel->getPanelName(), | ||||
| )); | )); | ||||
| } | } | ||||
| private function buildPanels() { | private function buildPanels() { | ||||
| $panel_specs = id(new PhutilSymbolLoader()) | $panels = id(new PhutilClassMapQuery()) | ||||
| ->setAncestorClass('PhabricatorSettingsPanel') | ->setAncestorClass('PhabricatorSettingsPanel') | ||||
| ->setConcreteOnly(true) | ->setExpandMethod('buildPanels') | ||||
| ->selectAndLoadSymbols(); | ->setUniqueMethod('getPanelKey') | ||||
| ->execute(); | |||||
| $panels = array(); | |||||
| foreach ($panel_specs as $spec) { | |||||
| $class = newv($spec['name'], array()); | |||||
| $panels[] = $class->buildPanels(); | |||||
| } | |||||
| $panels = array_mergev($panels); | |||||
| $panels = mpull($panels, null, 'getPanelKey'); | |||||
| $result = array(); | $result = array(); | ||||
| foreach ($panels as $key => $panel) { | foreach ($panels as $key => $panel) { | ||||
| $panel->setUser($this->user); | $panel->setUser($this->user); | ||||
| if (!$panel->isEnabled()) { | if (!$panel->isEnabled()) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||