Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/editor/PhabricatorSettingsEditEngine.php
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | protected function getObjectCreateButtonText($object) { | ||||
| return pht('Create Settings'); | return pht('Create Settings'); | ||||
| } | } | ||||
| protected function getObjectEditTitleText($object) { | protected function getObjectEditTitleText($object) { | ||||
| return pht('Edit Settings'); | return pht('Edit Settings'); | ||||
| } | } | ||||
| protected function getObjectEditShortText($object) { | protected function getObjectEditShortText($object) { | ||||
| return pht('Edit Settings'); | if (!$object->getUser()) { | ||||
| return pht('Global Defaults'); | |||||
| } else { | |||||
| if ($this->getIsSelfEdit()) { | |||||
| return pht('Personal Settings'); | |||||
| } else { | |||||
| return pht('Account Settings'); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| protected function getObjectCreateShortText() { | protected function getObjectCreateShortText() { | ||||
| return pht('Create Settings'); | return pht('Create Settings'); | ||||
| } | } | ||||
| protected function getObjectName() { | protected function getObjectName() { | ||||
| $page = $this->getSelectedPage(); | $page = $this->getSelectedPage(); | ||||
| if ($page) { | if ($page) { | ||||
| return $page->getLabel(); | return $page->getLabel(); | ||||
| } | } | ||||
| return pht('Settings'); | return pht('Settings'); | ||||
| } | } | ||||
| protected function getEditorURI() { | protected function getEditorURI() { | ||||
| return '/settings/edit/'; | throw new PhutilMethodNotImplementedException(); | ||||
| } | } | ||||
| protected function getObjectCreateCancelURI($object) { | protected function getObjectCreateCancelURI($object) { | ||||
| return '/settings/'; | return '/settings/'; | ||||
| } | } | ||||
| protected function getObjectViewURI($object) { | protected function getObjectViewURI($object) { | ||||
| // TODO: This isn't correct... | return $object->getEditURI(); | ||||
| return '/settings/user/'.$this->getViewer()->getUsername().'/'; | |||||
| } | } | ||||
| protected function getCreateNewObjectPolicy() { | protected function getCreateNewObjectPolicy() { | ||||
| return PhabricatorPolicies::POLICY_ADMIN; | return PhabricatorPolicies::POLICY_ADMIN; | ||||
| } | } | ||||
| public function getEffectiveObjectEditDoneURI($object) { | |||||
| return parent::getEffectiveObjectViewURI($object).'saved/'; | |||||
| } | |||||
| public function getEffectiveObjectEditCancelURI($object) { | public function getEffectiveObjectEditCancelURI($object) { | ||||
| if (!$object->getUser()) { | |||||
| return '/settings/'; | |||||
| } | |||||
| if ($this->getIsSelfEdit()) { | if ($this->getIsSelfEdit()) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| if ($this->getProfileURI()) { | if ($this->getProfileURI()) { | ||||
| return $this->getProfileURI(); | return $this->getProfileURI(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines | |||||