Changeset View
Changeset View
Standalone View
Standalone View
src/view/phui/PHUIHeadThingView.php
| Show All 29 Lines | public function setSize($size) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| protected function getTagAttributes() { | protected function getTagAttributes() { | ||||
| require_celerity_resource('phui-head-thing-view-css'); | require_celerity_resource('phui-head-thing-view-css'); | ||||
| $classes = array(); | $classes = array(); | ||||
| $classes[] = 'phui-head-thing-view'; | $classes[] = 'phui-head-thing-view'; | ||||
| if ($this->image) { | |||||
| $classes[] = 'phui-head-has-image'; | |||||
| } | |||||
| if ($this->size) { | if ($this->size) { | ||||
| $classes[] = $this->size; | $classes[] = $this->size; | ||||
| } else { | } else { | ||||
| $classes[] = self::SMALL; | $classes[] = self::SMALL; | ||||
| } | } | ||||
| return array( | return array( | ||||
| 'class' => $classes, | 'class' => $classes, | ||||
| ); | ); | ||||
| } | } | ||||
| protected function getTagContent() { | protected function getTagContent() { | ||||
| $image = phutil_tag( | $image = phutil_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| 'class' => 'phui-head-thing-image', | 'class' => 'phui-head-thing-image', | ||||
| 'style' => 'background-image: url('.$this->image.');', | 'style' => 'background-image: url('.$this->image.');', | ||||
| 'href' => $this->imageHref, | 'href' => $this->imageHref, | ||||
| )); | )); | ||||
| if ($this->image) { | |||||
| return array($image, $this->content); | return array($image, $this->content); | ||||
| } else { | |||||
| return $this->content; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||