@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 ImageHref attribute for PHUIObjectItemListView

Summary: In some cases we may want a different URI for the image on an item than the header/title of the item (like user / title). This prioritizes ImageHref over Href.

Test Plan: uiexamples

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+11 -2
+2
src/applications/uiexample/examples/PHUIObjectItemListExample.php
··· 330 330 $list->addItem( 331 331 id(new PHUIObjectItemView()) 332 332 ->setImageURI($default_project->getViewURI()) 333 + ->setImageHref('#') 334 + ->setHref('$$$') 333 335 ->setHeader(pht('Default Project Profile Image')) 334 336 ->setGrippable(true) 335 337 ->addAttribute(pht('This is the default project profile image.')));
+9 -2
src/view/phui/PHUIObjectItemView.php
··· 19 19 private $headIcons = array(); 20 20 private $disabled; 21 21 private $imageURI; 22 + private $imageHref; 22 23 private $imageIcon; 23 24 private $titleText; 24 25 private $badge; ··· 124 125 125 126 public function setImageURI($image_uri) { 126 127 $this->imageURI = $image_uri; 128 + return $this; 129 + } 130 + 131 + public function setImageHref($image_href) { 132 + $this->imageHref = $image_href; 127 133 return $this; 128 134 } 129 135 ··· 575 581 $this->getImageIcon()); 576 582 } 577 583 578 - if ($image && $this->href) { 584 + if ($image && (strlen($this->href) || strlen($this->imageHref))) { 585 + $image_href = ($this->imageHref) ? $this->imageHref : $this->href; 579 586 $image = phutil_tag( 580 587 'a', 581 588 array( 582 - 'href' => $this->href, 589 + 'href' => $image_href, 583 590 ), 584 591 $image); 585 592 }