Page MenuHomePhabricator

D18016.diff
No OneTemporary

D18016.diff

diff --git a/src/applications/uiexample/examples/PHUIObjectItemListExample.php b/src/applications/uiexample/examples/PHUIObjectItemListExample.php
--- a/src/applications/uiexample/examples/PHUIObjectItemListExample.php
+++ b/src/applications/uiexample/examples/PHUIObjectItemListExample.php
@@ -330,6 +330,8 @@
$list->addItem(
id(new PHUIObjectItemView())
->setImageURI($default_project->getViewURI())
+ ->setImageHref('#')
+ ->setHref('$$$')
->setHeader(pht('Default Project Profile Image'))
->setGrippable(true)
->addAttribute(pht('This is the default project profile image.')));
diff --git a/src/view/phui/PHUIObjectItemView.php b/src/view/phui/PHUIObjectItemView.php
--- a/src/view/phui/PHUIObjectItemView.php
+++ b/src/view/phui/PHUIObjectItemView.php
@@ -19,6 +19,7 @@
private $headIcons = array();
private $disabled;
private $imageURI;
+ private $imageHref;
private $imageIcon;
private $titleText;
private $badge;
@@ -127,6 +128,11 @@
return $this;
}
+ public function setImageHref($image_href) {
+ $this->imageHref = $image_href;
+ return $this;
+ }
+
public function getImageURI() {
return $this->imageURI;
}
@@ -575,11 +581,12 @@
$this->getImageIcon());
}
- if ($image && $this->href) {
+ if ($image && (strlen($this->href) || strlen($this->imageHref))) {
+ $image_href = ($this->imageHref) ? $this->imageHref : $this->href;
$image = phutil_tag(
'a',
array(
- 'href' => $this->href,
+ 'href' => $image_href,
),
$image);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 11, 3:35 AM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7495124
Default Alt Text
D18016.diff (1 KB)

Event Timeline