Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / phame / view / PhameNextPostView.php
blobbeabcd6d72352d22d369f1b4a1ed8a5c8bb8fbe7
1 <?php
3 final class PhameNextPostView extends AphrontTagView {
5 private $nextTitle;
6 private $nextHref;
7 private $previousTitle;
8 private $previousHref;
10 public function setNext($title, $href) {
11 $this->nextTitle = $title;
12 $this->nextHref = $href;
13 return $this;
16 public function setPrevious($title, $href) {
17 $this->previousTitle = $title;
18 $this->previousHref = $href;
19 return $this;
22 protected function getTagAttributes() {
23 $classes = array();
24 $classes[] = 'phame-next-post-view';
25 $classes[] = 'grouped';
26 return array('class' => implode(' ', $classes));
29 protected function getTagContent() {
30 require_celerity_resource('phame-css');
32 $p_icon = id(new PHUIIconView())
33 ->setIcon('fa-angle-left');
35 $previous_icon = phutil_tag(
36 'div',
37 array(
38 'class' => 'phame-previous-arrow',
40 $p_icon);
42 $previous_text = phutil_tag(
43 'div',
44 array(
45 'class' => 'phame-previous-header',
47 pht('Previous Post'));
49 $previous_title = phutil_tag(
50 'div',
51 array(
52 'class' => 'phame-previous-title',
54 $this->previousTitle);
56 $previous = null;
57 if ($this->previousHref) {
58 $previous = phutil_tag(
59 'a',
60 array(
61 'class' => 'phame-previous',
62 'href' => $this->previousHref,
64 array(
65 $previous_icon,
66 $previous_text,
67 $previous_title,
68 ));
71 $n_icon = id(new PHUIIconView())
72 ->setIcon('fa-angle-right');
74 $next_icon = phutil_tag(
75 'div',
76 array(
77 'class' => 'phame-next-arrow',
79 $n_icon);
81 $next_text = phutil_tag(
82 'div',
83 array(
84 'class' => 'phame-next-header',
86 pht('Next Post'));
88 $next_title = phutil_tag(
89 'div',
90 array(
91 'class' => 'phame-next-title',
93 $this->nextTitle);
95 $next = null;
96 if ($this->nextHref) {
97 $next = phutil_tag(
98 'a',
99 array(
100 'class' => 'phame-next',
101 'href' => $this->nextHref,
103 array(
104 $next_icon,
105 $next_text,
106 $next_title,
110 return array($previous, $next);