Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / view / phui / PHUIBigInfoView.php
blob31a458ed6041c10044b50095c9c6ed5b287c4cf0
1 <?php
3 final class PHUIBigInfoView extends AphrontTagView {
5 private $icon;
6 private $title;
7 private $description;
8 private $image;
9 private $actions = array();
11 public function setIcon($icon) {
12 $this->icon = $icon;
13 return $this;
16 public function setTitle($title) {
17 $this->title = $title;
18 return $this;
21 public function setDescription($description) {
22 $this->description = $description;
23 return $this;
26 public function setImage($image) {
27 $this->image = $image;
28 return $this;
31 public function addAction(PHUIButtonView $button) {
32 $this->actions[] = $button;
33 return $this;
36 protected function getTagName() {
37 return 'div';
40 protected function getTagAttributes() {
41 $classes = array();
42 $classes[] = 'phui-big-info-view';
44 return array(
45 'class' => implode(' ', $classes),
49 protected function getTagContent() {
50 require_celerity_resource('phui-big-info-view-css');
52 $icon = null;
53 if ($this->icon) {
54 $icon = id(new PHUIIconView())
55 ->setIcon($this->icon)
56 ->addClass('phui-big-info-icon');
58 $icon = phutil_tag(
59 'div',
60 array(
61 'class' => 'phui-big-info-icon-container',
63 $icon);
66 if ($this->image) {
67 $image = phutil_tag(
68 'img',
69 array(
70 'class' => 'phui-big-info-image',
71 'src' => $this->image,
72 ));
73 $icon = phutil_tag(
74 'span',
75 array(
76 'class' => 'phui-big-info-icon-container',
78 $image);
81 $title = phutil_tag(
82 'div',
83 array(
84 'class' => 'phui-big-info-title',
86 $this->title);
88 $description = phutil_tag(
89 'div',
90 array(
91 'class' => 'phui-big-info-description',
93 $this->description);
95 $buttons = array();
96 foreach ($this->actions as $button) {
97 $buttons[] = phutil_tag(
98 'div',
99 array(
100 'class' => 'phui-big-info-button',
102 $button);
105 $actions = null;
106 if ($buttons) {
107 $actions = phutil_tag(
108 'div',
109 array(
110 'class' => 'phui-big-info-actions',
112 $buttons);
115 return array($icon, $title, $description, $actions);