1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00
phorge-phorge/src/applications/diviner/view/DivinerBookItemView.php
Chad Little 93f735ed2f Diviner Book Index styles
Summary: Slightly more readable, less space than current index. LMK if you hate it though.

Test Plan: Look at user and dev book indexes.

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Differential Revision: https://secure.phabricator.com/D6932
2013-09-10 09:39:50 -07:00

68 lines
1.2 KiB
PHP

<?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(
'class' => 'diviner-book-item-title'
),
$this->title);
$subtitle = phutil_tag(
'span',
array(
'class' => 'diviner-book-item-subtitle'
),
$this->subtitle);
$type = phutil_tag(
'span',
array(
'class' => 'diviner-book-item-type'
),
$this->type);
return array($title, $type, $subtitle);
}
}