@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class DivinerBookItemView extends AphrontTagView {
4
5 private $title;
6 private $subtitle;
7 private $type;
8 private $href;
9
10 public function setTitle($title) {
11 $this->title = $title;
12 return $this;
13 }
14
15 public function setSubtitle($subtitle) {
16 $this->subtitle = $subtitle;
17 return $this;
18 }
19
20 public function setType($type) {
21 $this->type = $type;
22 return $this;
23 }
24
25 public function setHref($href) {
26 $this->href = $href;
27 return $this;
28 }
29
30 protected function getTagName() {
31 return 'a';
32 }
33
34 protected function getTagAttributes() {
35 return array(
36 'class' => 'diviner-book-item',
37 'href' => $this->href,
38 );
39 }
40
41 protected function getTagContent() {
42 require_celerity_resource('diviner-shared-css');
43
44 $title = phutil_tag(
45 'span',
46 array(
47 'class' => 'diviner-book-item-title',
48 ),
49 $this->title);
50
51 $subtitle = phutil_tag(
52 'span',
53 array(
54 'class' => 'diviner-book-item-subtitle',
55 ),
56 $this->subtitle);
57
58 $type = phutil_tag(
59 'span',
60 array(
61 'class' => 'diviner-book-item-type',
62 ),
63 $this->type);
64
65 return array($title, $type, $subtitle);
66 }
67
68}