Differential D16028 Diff 38580 src/applications/settings/setting/PhabricatorPinnedApplicationsSetting.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/setting/PhabricatorPinnedApplicationsSetting.php
- This file was added.
| <?php | |||||
| final class PhabricatorPinnedApplicationsSetting | |||||
| extends PhabricatorInternalSetting { | |||||
| const SETTINGKEY = 'app-pinned'; | |||||
| public function getSettingName() { | |||||
| return pht('Pinned Applications'); | |||||
| } | |||||
| public function getSettingDefaultValue() { | |||||
| $viewer = $this->getViewer(); | |||||
| $applications = id(new PhabricatorApplicationQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withInstalled(true) | |||||
| ->withUnlisted(false) | |||||
| ->withLaunchable(true) | |||||
| ->execute(); | |||||
| $pinned = array(); | |||||
| foreach ($applications as $application) { | |||||
| if ($application->isPinnedByDefault($viewer)) { | |||||
| $pinned[] = get_class($application); | |||||
| } | |||||
| } | |||||
| return $pinned; | |||||
| } | |||||
| } | |||||