Path: blob/master/src/applications/oauthserver/editor/PhabricatorOAuthServerEditEngine.php
12241 views
<?php12final class PhabricatorOAuthServerEditEngine3extends PhabricatorEditEngine {45const ENGINECONST = 'oauthserver.application';67public function isEngineConfigurable() {8return false;9}1011public function getEngineName() {12return pht('OAuth Applications');13}1415public function getSummaryHeader() {16return pht('Edit OAuth Applications');17}1819public function getSummaryText() {20return pht('This engine manages OAuth client applications.');21}2223public function getEngineApplicationClass() {24return 'PhabricatorOAuthServerApplication';25}2627protected function newEditableObject() {28return PhabricatorOAuthServerClient::initializeNewClient(29$this->getViewer());30}3132protected function newObjectQuery() {33return id(new PhabricatorOAuthServerClientQuery());34}3536protected function getObjectCreateTitleText($object) {37return pht('Create OAuth Server');38}3940protected function getObjectCreateButtonText($object) {41return pht('Create OAuth Server');42}4344protected function getObjectEditTitleText($object) {45return pht('Edit OAuth Server: %s', $object->getName());46}4748protected function getObjectEditShortText($object) {49return pht('Edit OAuth Server');50}5152protected function getObjectCreateShortText() {53return pht('Create OAuth Server');54}5556protected function getObjectName() {57return pht('OAuth Server');58}5960protected function getObjectViewURI($object) {61return $object->getViewURI();62}6364protected function getCreateNewObjectPolicy() {65return $this->getApplication()->getPolicy(66PhabricatorOAuthServerCreateClientsCapability::CAPABILITY);67}6869protected function buildCustomEditFields($object) {70return array(71id(new PhabricatorTextEditField())72->setKey('name')73->setLabel(pht('Name'))74->setIsRequired(true)75->setTransactionType(PhabricatorOAuthServerTransaction::TYPE_NAME)76->setDescription(pht('The name of the OAuth application.'))77->setConduitDescription(pht('Rename the application.'))78->setConduitTypeDescription(pht('New application name.'))79->setValue($object->getName()),80id(new PhabricatorTextEditField())81->setKey('redirectURI')82->setLabel(pht('Redirect URI'))83->setIsRequired(true)84->setTransactionType(85PhabricatorOAuthServerTransaction::TYPE_REDIRECT_URI)86->setDescription(87pht('The redirect URI for OAuth handshakes.'))88->setConduitDescription(89pht(90'Change where this application redirects users to during OAuth '.91'handshakes.'))92->setConduitTypeDescription(93pht(94'New OAuth application redirect URI.'))95->setValue($object->getRedirectURI()),96);97}9899}100101102