Path: blob/master/src/view/phui/PHUIBigInfoView.php
12249 views
<?php12final class PHUIBigInfoView extends AphrontTagView {34private $icon;5private $title;6private $description;7private $image;8private $actions = array();910public function setIcon($icon) {11$this->icon = $icon;12return $this;13}1415public function setTitle($title) {16$this->title = $title;17return $this;18}1920public function setDescription($description) {21$this->description = $description;22return $this;23}2425public function setImage($image) {26$this->image = $image;27return $this;28}2930public function addAction(PHUIButtonView $button) {31$this->actions[] = $button;32return $this;33}3435protected function getTagName() {36return 'div';37}3839protected function getTagAttributes() {40$classes = array();41$classes[] = 'phui-big-info-view';4243return array(44'class' => implode(' ', $classes),45);46}4748protected function getTagContent() {49require_celerity_resource('phui-big-info-view-css');5051$icon = null;52if ($this->icon) {53$icon = id(new PHUIIconView())54->setIcon($this->icon)55->addClass('phui-big-info-icon');5657$icon = phutil_tag(58'div',59array(60'class' => 'phui-big-info-icon-container',61),62$icon);63}6465if ($this->image) {66$image = phutil_tag(67'img',68array(69'class' => 'phui-big-info-image',70'src' => $this->image,71));72$icon = phutil_tag(73'span',74array(75'class' => 'phui-big-info-icon-container',76),77$image);78}7980$title = phutil_tag(81'div',82array(83'class' => 'phui-big-info-title',84),85$this->title);8687$description = phutil_tag(88'div',89array(90'class' => 'phui-big-info-description',91),92$this->description);9394$buttons = array();95foreach ($this->actions as $button) {96$buttons[] = phutil_tag(97'div',98array(99'class' => 'phui-big-info-button',100),101$button);102}103104$actions = null;105if ($buttons) {106$actions = phutil_tag(107'div',108array(109'class' => 'phui-big-info-actions',110),111$buttons);112}113114return array($icon, $title, $description, $actions);115116}117118}119120121