3 abstract class DiffusionRepositoryManagementPanel
10 final public function setViewer(PhabricatorUser
$viewer) {
11 $this->viewer
= $viewer;
15 final public function getViewer() {
19 final public function setRepository(PhabricatorRepository
$repository) {
20 $this->repository
= $repository;
24 final public function getRepository() {
25 return $this->repository
;
28 final public function getRequest() {
29 return $this->controller
->getRequest();
32 final public function setController(PhabricatorController
$controller) {
33 $this->controller
= $controller;
37 final public function getManagementPanelKey() {
38 return $this->getPhobjectClassConstant('PANELKEY');
41 abstract public function getManagementPanelLabel();
42 abstract public function getManagementPanelOrder();
43 abstract public function buildManagementPanelContent();
44 public function buildManagementPanelCurtain() { return null; }
46 public function getManagementPanelIcon() {
50 public function getManagementPanelGroupKey() {
51 return DiffusionRepositoryManagementMainPanelGroup
::PANELGROUPKEY
;
54 public function shouldEnableForRepository(
55 PhabricatorRepository
$repository) {
59 public static function getAllPanels() {
60 return id(new PhutilClassMapQuery())
61 ->setAncestorClass(__CLASS__
)
62 ->setUniqueMethod('getManagementPanelKey')
63 ->setSortMethod('getManagementPanelOrder')
67 final protected function newTimeline() {
68 return $this->controller
->newTimeline($this->getRepository());
71 final public function getPanelURI() {
72 $repository = $this->getRepository();
73 $key = $this->getManagementPanelKey();
74 return $repository->getPathURI("manage/{$key}/");
77 final public function newEditEnginePage() {
78 $field_keys = $this->getEditEngineFieldKeys();
83 $key = $this->getManagementPanelKey();
84 $label = $this->getManagementPanelLabel();
85 $panel_uri = $this->getPanelURI();
87 return id(new PhabricatorEditPage())
90 ->setViewURI($panel_uri)
91 ->setFieldKeys($field_keys);
94 protected function getEditEngineFieldKeys() {
98 protected function getEditPageURI($page = null) {
100 $page = $this->getManagementPanelKey();
103 $repository = $this->getRepository();
104 $id = $repository->getID();
105 return "/diffusion/edit/{$id}/page/{$page}/";
108 public function getPanelNavigationURI() {
109 return $this->getPanelURI();
112 final protected function newActionList() {
113 $viewer = $this->getViewer();
114 $action_id = celerity_generate_unique_node_id();
116 return id(new PhabricatorActionListView())
121 final protected function newCurtainView() {
122 $viewer = $this->getViewer();
124 return id(new PHUICurtainView())
125 ->setViewer($viewer);
128 final protected function newBox($header_text, $body) {
129 $viewer = $this->getViewer();
131 $header = id(new PHUIHeaderView())
133 ->setHeader($header_text);
135 $view = id(new PHUIObjectBoxView())
138 ->setBackground(PHUIObjectBoxView
::BLUE_PROPERTY
)
139 ->appendChild($body);