@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

at recaptime-dev/main 113 lines 2.3 kB view raw
1<?php 2 3final class PhameNextPostView extends AphrontTagView { 4 5 private $nextTitle; 6 private $nextHref; 7 private $previousTitle; 8 private $previousHref; 9 10 public function setNext($title, $href) { 11 $this->nextTitle = $title; 12 $this->nextHref = $href; 13 return $this; 14 } 15 16 public function setPrevious($title, $href) { 17 $this->previousTitle = $title; 18 $this->previousHref = $href; 19 return $this; 20 } 21 22 protected function getTagAttributes() { 23 $classes = array(); 24 $classes[] = 'phame-next-post-view'; 25 $classes[] = 'grouped'; 26 return array('class' => implode(' ', $classes)); 27 } 28 29 protected function getTagContent() { 30 require_celerity_resource('phame-css'); 31 32 $p_icon = id(new PHUIIconView()) 33 ->setIcon('fa-angle-left'); 34 35 $previous_icon = phutil_tag( 36 'div', 37 array( 38 'class' => 'phame-previous-arrow', 39 ), 40 $p_icon); 41 42 $previous_text = phutil_tag( 43 'div', 44 array( 45 'class' => 'phame-previous-header', 46 ), 47 pht('Previous Post')); 48 49 $previous_title = phutil_tag( 50 'div', 51 array( 52 'class' => 'phame-previous-title', 53 ), 54 $this->previousTitle); 55 56 $previous = null; 57 if ($this->previousHref) { 58 $previous = phutil_tag( 59 'a', 60 array( 61 'class' => 'phame-previous', 62 'href' => $this->previousHref, 63 ), 64 array( 65 $previous_icon, 66 $previous_text, 67 $previous_title, 68 )); 69 } 70 71 $n_icon = id(new PHUIIconView()) 72 ->setIcon('fa-angle-right'); 73 74 $next_icon = phutil_tag( 75 'div', 76 array( 77 'class' => 'phame-next-arrow', 78 ), 79 $n_icon); 80 81 $next_text = phutil_tag( 82 'div', 83 array( 84 'class' => 'phame-next-header', 85 ), 86 pht('Next Post')); 87 88 $next_title = phutil_tag( 89 'div', 90 array( 91 'class' => 'phame-next-title', 92 ), 93 $this->nextTitle); 94 95 $next = null; 96 if ($this->nextHref) { 97 $next = phutil_tag( 98 'a', 99 array( 100 'class' => 'phame-next', 101 'href' => $this->nextHref, 102 ), 103 array( 104 $next_icon, 105 $next_text, 106 $next_title, 107 )); 108 } 109 110 return array($previous, $next); 111 } 112 113}