Give Phame blogs mutable interact policies
[phabricator.git] / src / applications / phame / view / PhameDescriptionView.php
blob346b22640f9e22d7f6988ccd21ce804cad5d9504
1 <?php
3 final class PhameDescriptionView extends AphrontTagView {
5 private $title;
6 private $description;
7 private $image;
8 private $imageHref;
10 public function setTitle($title) {
11 $this->title = $title;
12 return $this;
15 public function setDescription($description) {
16 $this->description = $description;
17 return $this;
20 public function setImage($image) {
21 $this->image = $image;
22 return $this;
25 public function setImageHref($href) {
26 $this->imageHref = $href;
27 return $this;
30 protected function getTagAttributes() {
31 $classes = array();
32 $classes[] = 'phame-blog-description';
33 return array('class' => implode(' ', $classes));
36 protected function getTagContent() {
37 require_celerity_resource('phame-css');
39 $description = phutil_tag_div(
40 'phame-blog-description-content', $this->description);
42 $image = phutil_tag(
43 ($this->imageHref) ? 'a' : 'div',
44 array(
45 'class' => 'phame-blog-description-image',
46 'style' => 'background-image: url('.$this->image.');',
47 'href' => $this->imageHref,
48 ));
50 $header = phutil_tag(
51 'div',
52 array(
53 'class' => 'phame-blog-description-name',
55 $this->title);
57 return array($image, $header, $description);