Differential D15593 Diff 37613 src/applications/conduit/controller/PhabricatorConduitConsoleController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitConsoleController.php
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | foreach ($error_types as $error => $meaning) { | ||||
$meaning); | $meaning); | ||||
} | } | ||||
$error_description = phutil_tag('ul', array(), $error_description); | $error_description = phutil_tag('ul', array(), $error_description); | ||||
$view->addProperty( | $view->addProperty( | ||||
pht('Errors'), | pht('Errors'), | ||||
$error_description); | $error_description); | ||||
$scope = $method->getRequiredScope(); | |||||
switch ($scope) { | |||||
case ConduitAPIMethod::SCOPE_ALWAYS: | |||||
$oauth_icon = 'fa-globe green'; | |||||
$oauth_description = pht( | |||||
'OAuth clients may always call this method.'); | |||||
break; | |||||
case ConduitAPIMethod::SCOPE_NEVER: | |||||
$oauth_icon = 'fa-ban red'; | |||||
$oauth_description = pht( | |||||
'OAuth clients may never call this method.'); | |||||
break; | |||||
default: | |||||
$oauth_icon = 'fa-unlock-alt blue'; | |||||
$oauth_description = pht( | |||||
'OAuth clients may call this method after requesting access to '. | |||||
'the "%s" scope.', | |||||
$scope); | |||||
break; | |||||
} | |||||
$view->addProperty( | |||||
pht('OAuth Scope'), | |||||
array( | |||||
id(new PHUIIconView())->setIcon($oauth_icon), | |||||
' ', | |||||
$oauth_description, | |||||
)); | |||||
$view->addSectionHeader( | $view->addSectionHeader( | ||||
pht('Description'), PHUIPropertyListView::ICON_SUMMARY); | pht('Description'), PHUIPropertyListView::ICON_SUMMARY); | ||||
$view->addTextContent( | $view->addTextContent( | ||||
new PHUIRemarkupView($viewer, $method->getMethodDescription())); | new PHUIRemarkupView($viewer, $method->getMethodDescription())); | ||||
return $view; | return $view; | ||||
} | } | ||||
} | } |