Path: blob/master/src/view/phui/PHUIHeadThingView.php
12249 views
<?php12final class PHUIHeadThingView extends AphrontTagView {34private $image;5private $imageHref;6private $content;7private $size;89const SMALL = 'head-thing-small';10const MEDIUM = 'head-thing-medium';1112public function setImageHref($href) {13$this->imageHref = $href;14return $this;15}1617public function setImage($image) {18$this->image = $image;19return $this;20}2122public function setContent($content) {23$this->content = $content;24return $this;25}2627public function setSize($size) {28$this->size = $size;29return $this;30}3132protected function getTagAttributes() {33require_celerity_resource('phui-head-thing-view-css');3435$classes = array();36$classes[] = 'phui-head-thing-view';37if ($this->image) {38$classes[] = 'phui-head-has-image';39}4041if ($this->size) {42$classes[] = $this->size;43} else {44$classes[] = self::SMALL;45}4647return array(48'class' => $classes,49);50}5152protected function getTagContent() {5354$image = javelin_tag(55'a',56array(57'class' => 'phui-head-thing-image',58'style' => 'background-image: url('.$this->image.');',59'href' => $this->imageHref,60'aural' => false,61));6263if ($this->image) {64return array($image, $this->content);65} else {66return $this->content;67}6869}7071}727374