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

Add ability to setActionList to a PHUIHeaderView

Summary: We're using this a little more, so I'd prefer less copy-pasta and one place to manage the UI. Maybe add a caret?

Test Plan: grep for 'Actions', test Phriction, Diviner, ect, Action Menus.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15288

+21 -38
+1 -9
src/applications/diviner/controller/DivinerBookController.php
··· 29 29 $book->getShortTitle(), 30 30 '/book/'.$book->getName().'/'); 31 31 32 - $action_button = id(new PHUIButtonView()) 33 - ->setTag('a') 34 - ->setText(pht('Actions')) 35 - ->setHref('#') 36 - ->setIcon('fa-bars') 37 - ->addClass('phui-mobile-menu') 38 - ->setDropdownMenu($actions); 39 - 40 32 $header = id(new PHUIHeaderView()) 41 33 ->setHeader($book->getTitle()) 42 34 ->setUser($viewer) 43 35 ->setPolicyObject($book) 44 36 ->setEpoch($book->getDateModified()) 45 - ->addActionLink($action_button); 37 + ->setActionList($actions); 46 38 47 39 // TODO: This could probably look better. 48 40 if ($book->getRepositoryPHID()) {
+1 -10
src/applications/phame/controller/blog/PhameBlogViewController.php
··· 44 44 $header->setStatus($header_icon, $header_color, $header_name); 45 45 46 46 $actions = $this->renderActions($blog); 47 - $action_button = id(new PHUIButtonView()) 48 - ->setTag('a') 49 - ->setText(pht('Actions')) 50 - ->setHref('#') 51 - ->setIcon('fa-bars') 52 - ->addClass('phui-mobile-menu') 53 - ->setDropdownMenu($actions); 54 - 55 - $header->addActionLink($action_button); 56 - 47 + $header->setActionList($actions); 57 48 $header->setPolicyObject($blog); 58 49 } 59 50
+1 -10
src/applications/phame/controller/post/PhamePostViewController.php
··· 24 24 25 25 if (!$is_external) { 26 26 $actions = $this->renderActions($post); 27 - 28 - $action_button = id(new PHUIButtonView()) 29 - ->setTag('a') 30 - ->setText(pht('Actions')) 31 - ->setHref('#') 32 - ->setIcon('fa-bars') 33 - ->addClass('phui-mobile-menu') 34 - ->setDropdownMenu($actions); 35 - 36 27 $header->setPolicyObject($post); 37 - $header->addActionLink($action_button); 28 + $header->setActionList($actions); 38 29 } 39 30 40 31 $document = id(new PHUIDocumentViewPro())
+1 -9
src/applications/phriction/controller/PhrictionDocumentController.php
··· 203 203 $crumbs->addCrumb($view); 204 204 } 205 205 206 - $action_button = id(new PHUIButtonView()) 207 - ->setTag('a') 208 - ->setText(pht('Actions')) 209 - ->setHref('#') 210 - ->setIcon('fa-bars') 211 - ->addClass('phui-mobile-menu') 212 - ->setDropdownMenu($actions); 213 - 214 206 $header = id(new PHUIHeaderView()) 215 207 ->setUser($viewer) 216 208 ->setPolicyObject($document) 217 209 ->setHeader($page_title) 218 - ->addActionLink($action_button); 210 + ->setActionList($actions); 219 211 220 212 if ($content) { 221 213 $header->setEpoch($content->getDateCreated());
+17
src/view/phui/PHUIHeaderView.php
··· 23 23 private $actionIcons = array(); 24 24 private $badges = array(); 25 25 private $href; 26 + private $actionList; 26 27 27 28 public function setHeader($header) { 28 29 $this->header = $header; ··· 81 82 82 83 public function setHeaderIcon($icon) { 83 84 $this->headerIcon = $icon; 85 + return $this; 86 + } 87 + 88 + public function setActionList(PhabricatorActionListView $list) { 89 + $this->actionList = $list; 84 90 return $this; 85 91 } 86 92 ··· 190 196 } 191 197 192 198 protected function getTagContent() { 199 + 200 + if ($this->actionList) { 201 + $action_button = id(new PHUIButtonView()) 202 + ->setTag('a') 203 + ->setText(pht('Actions')) 204 + ->setHref('#') 205 + ->setIcon('fa-bars') 206 + ->addClass('phui-mobile-menu') 207 + ->setDropdownMenu($this->actionList); 208 + $this->addActionLink($action_button); 209 + } 193 210 194 211 $image = null; 195 212 if ($this->image) {