3 final class DiffusionRepositorySymbolsManagementPanel
4 extends DiffusionRepositoryManagementPanel
{
6 const PANELKEY
= 'symbols';
8 public function getManagementPanelLabel() {
12 public function getManagementPanelOrder() {
16 public function getManagementPanelGroupKey() {
17 return DiffusionRepositoryManagementIntegrationsPanelGroup
::PANELGROUPKEY
;
20 public function getManagementPanelIcon() {
21 $repository = $this->getRepository();
24 $repository->getSymbolLanguages() ||
25 $repository->getSymbolSources();
30 return 'fa-link grey';
34 protected function getEditEngineFieldKeys() {
37 'symbolRepositoryPHIDs',
41 public function buildManagementPanelCurtain() {
42 $repository = $this->getRepository();
43 $viewer = $this->getViewer();
44 $action_list = $this->newActionList();
46 $can_edit = PhabricatorPolicyFilter
::hasCapability(
49 PhabricatorPolicyCapability
::CAN_EDIT
);
51 $symbols_uri = $this->getEditPageURI();
53 $action_list->addAction(
54 id(new PhabricatorActionView())
55 ->setIcon('fa-pencil')
56 ->setName(pht('Edit Symbols'))
57 ->setHref($symbols_uri)
58 ->setDisabled(!$can_edit)
59 ->setWorkflow(!$can_edit));
61 return $this->newCurtainView()
62 ->setActionList($action_list);
65 public function buildManagementPanelContent() {
66 $repository = $this->getRepository();
67 $viewer = $this->getViewer();
69 $view = id(new PHUIPropertyListView())
72 $languages = $repository->getSymbolLanguages();
74 $languages = implode(', ', $languages);
76 $languages = phutil_tag('em', array(), pht('Any'));
78 $view->addProperty(pht('Languages'), $languages);
80 $sources = $repository->getSymbolSources();
82 $sources = $viewer->renderHandleList($sources);
84 $sources = phutil_tag('em', array(), pht('This Repository Only'));
86 $view->addProperty(pht('Uses Symbols From'), $sources);
88 return $this->newBox(pht('Symbols'), $view);