3 final class PHUIPolicySectionView
4 extends AphrontTagView
{
8 private $documentationLink;
10 public function setHeader($header) {
11 $this->header
= $header;
15 public function getHeader() {
19 public function setIcon($icon) {
24 public function getIcon() {
28 public function setDocumentationLink($name, $href) {
37 $this->documentationLink
= phutil_tag(
40 'class' => 'phui-policy-section-view-link',
43 id(new PHUIIconView())->setIcon('fa-book'),
50 public function getDocumentationLink() {
51 return $this->documentationLink
;
54 public function appendList(array $items) {
55 foreach ($items as $key => $item) {
56 $items[$key] = phutil_tag(
59 'class' => 'remarkup-list-item',
67 'class' => 'remarkup-list',
71 return $this->appendChild($list);
74 public function appendHint($content) {
78 'class' => 'phui-policy-section-view-hint',
81 id(new PHUIIconView())
82 ->setIcon('fa-sticky-note bluegrey'),
89 return $this->appendChild($hint);
92 public function appendParagraph($content) {
93 return $this->appendChild(phutil_tag('p', array(), $content));
96 public function appendRulesView(PhabricatorPolicyRulesView
$rules_view) {
97 return $this->appendChild(
101 'class' => 'phui-policy-section-view-rules',
106 protected function getTagAttributes() {
108 'class' => 'phui-policy-section-view',
112 protected function getTagContent() {
113 require_celerity_resource('phui-policy-section-view-css');
116 $icon = $this->getIcon();
117 if ($icon !== null) {
118 $icon_view = id(new PHUIIconView())
122 $header_view = phutil_tag(
125 'class' => 'phui-policy-section-view-header-text',
129 $header = phutil_tag(
132 'class' => 'phui-policy-section-view-header',
137 $this->getDocumentationLink(),
145 'class' => 'phui-policy-section-view-body',
147 $this->renderChildren()),