@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
at recaptime-dev/main 54 lines 834 B view raw
1<?php 2 3final class PHUILinkView 4 extends AphrontTagView { 5 6 private $uri; 7 private $text; 8 private $workflow; 9 10 public function setURI($uri) { 11 $this->uri = $uri; 12 return $this; 13 } 14 15 public function getURI() { 16 return $this->uri; 17 } 18 19 public function setText($text) { 20 $this->text = $text; 21 return $this; 22 } 23 24 /** 25 * @param bool $workflow 26 * @return $this 27 */ 28 public function setWorkflow($workflow) { 29 $this->workflow = $workflow; 30 return $this; 31 } 32 33 protected function getTagName() { 34 return 'a'; 35 } 36 37 protected function getTagAttributes() { 38 $sigil = array(); 39 40 if ($this->workflow) { 41 $sigil[] = 'workflow'; 42 } 43 44 return array( 45 'href' => $this->getURI(), 46 'sigil' => $sigil, 47 ); 48 } 49 50 protected function getTagContent() { 51 return $this->text; 52 } 53 54}