2013-09-10 18:39:50 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DivinerBookItemView extends AphrontTagView {
|
|
|
|
|
|
|
|
private $title;
|
|
|
|
private $subtitle;
|
|
|
|
private $type;
|
|
|
|
private $href;
|
|
|
|
|
|
|
|
public function setTitle($title) {
|
|
|
|
$this->title = $title;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setSubtitle($subtitle) {
|
|
|
|
$this->subtitle = $subtitle;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setType($type) {
|
|
|
|
$this->type = $type;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setHref($href) {
|
|
|
|
$this->href = $href;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTagName() {
|
|
|
|
return 'a';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTagAttributes() {
|
|
|
|
return array(
|
|
|
|
'class' => 'diviner-book-item',
|
|
|
|
'href' => $this->href,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTagContent() {
|
|
|
|
require_celerity_resource('diviner-shared-css');
|
|
|
|
|
|
|
|
$title = phutil_tag(
|
|
|
|
'span',
|
|
|
|
array(
|
2014-10-07 15:01:04 +02:00
|
|
|
'class' => 'diviner-book-item-title',
|
2013-09-10 18:39:50 +02:00
|
|
|
),
|
|
|
|
$this->title);
|
|
|
|
|
|
|
|
$subtitle = phutil_tag(
|
|
|
|
'span',
|
|
|
|
array(
|
2014-10-07 15:01:04 +02:00
|
|
|
'class' => 'diviner-book-item-subtitle',
|
2013-09-10 18:39:50 +02:00
|
|
|
),
|
|
|
|
$this->subtitle);
|
|
|
|
|
|
|
|
$type = phutil_tag(
|
|
|
|
'span',
|
|
|
|
array(
|
2014-10-07 15:01:04 +02:00
|
|
|
'class' => 'diviner-book-item-type',
|
2013-09-10 18:39:50 +02:00
|
|
|
),
|
|
|
|
$this->type);
|
|
|
|
|
|
|
|
return array($title, $type, $subtitle);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|