@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorProjectColumnHeader
4 extends Phobject {
5
6 private $orderKey;
7 private $headerKey;
8 private $sortVector;
9 private $name;
10 private $icon;
11 private $editProperties;
12 private $dropEffects = array();
13
14 public function setOrderKey($order_key) {
15 $this->orderKey = $order_key;
16 return $this;
17 }
18
19 public function getOrderKey() {
20 return $this->orderKey;
21 }
22
23 public function setHeaderKey($header_key) {
24 $this->headerKey = $header_key;
25 return $this;
26 }
27
28 public function getHeaderKey() {
29 return $this->headerKey;
30 }
31
32 public function setSortVector(array $sort_vector) {
33 $this->sortVector = $sort_vector;
34 return $this;
35 }
36
37 public function getSortVector() {
38 return $this->sortVector;
39 }
40
41 public function setName($name) {
42 $this->name = $name;
43 return $this;
44 }
45
46 public function getName() {
47 return $this->name;
48 }
49
50 public function setIcon(PHUIIconView$icon) {
51 $this->icon = $icon;
52 return $this;
53 }
54
55 public function getIcon() {
56 return $this->icon;
57 }
58
59 public function setEditProperties(array $edit_properties) {
60 $this->editProperties = $edit_properties;
61 return $this;
62 }
63
64 public function getEditProperties() {
65 return $this->editProperties;
66 }
67
68 public function addDropEffect(PhabricatorProjectDropEffect $effect) {
69 $this->dropEffects[] = $effect;
70 return $this;
71 }
72
73 public function getDropEffects() {
74 return $this->dropEffects;
75 }
76
77 public function toDictionary() {
78 return array(
79 'order' => $this->getOrderKey(),
80 'key' => $this->getHeaderKey(),
81 'template' => hsprintf('%s', $this->newView()),
82 'vector' => $this->getSortVector(),
83 'editProperties' => $this->getEditProperties(),
84 'effects' => mpull($this->getDropEffects(), 'toDictionary'),
85 );
86 }
87
88 private function newView() {
89 $icon_view = $this->getIcon();
90 $name = $this->getName();
91
92 $template = phutil_tag(
93 'li',
94 array(
95 'class' => 'workboard-group-header',
96 ),
97 array(
98 $icon_view,
99 phutil_tag(
100 'span',
101 array(
102 'class' => 'workboard-group-header-name',
103 ),
104 $name),
105 ));
106
107 return $template;
108 }
109
110}