Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/phid/view/PHUIHandleView.php b/src/applications/phid/view/PHUIHandleView.php
index db4b9e43ab..a4b766a991 100644
--- a/src/applications/phid/view/PHUIHandleView.php
+++ b/src/applications/phid/view/PHUIHandleView.php
@@ -1,42 +1,52 @@
<?php
/**
* Convenience class for rendering a single handle.
*
* This class simplifies rendering a single handle, and improves loading and
* caching semantics in the rendering pipeline by loading data at the last
* moment.
*/
final class PHUIHandleView
extends AphrontView {
private $handleList;
private $handlePHID;
private $asTag;
+ private $useShortName;
public function setHandleList(PhabricatorHandleList $list) {
$this->handleList = $list;
return $this;
}
public function setHandlePHID($phid) {
$this->handlePHID = $phid;
return $this;
}
public function setAsTag($tag) {
$this->asTag = $tag;
return $this;
}
+ public function setUseShortName($short) {
+ $this->useShortName = $short;
+ return $this;
+ }
+
public function render() {
$handle = $this->handleList[$this->handlePHID];
if ($this->asTag) {
return $handle->renderTag();
} else {
- return $handle->renderLink();
+ if ($this->useShortName) {
+ return $handle->renderLink($handle->getName());
+ } else {
+ return $handle->renderLink();
+ }
}
}
}
diff --git a/src/applications/spaces/view/PHUISpacesNamespaceContextView.php b/src/applications/spaces/view/PHUISpacesNamespaceContextView.php
index d63ae8e6f4..0bb5949b76 100644
--- a/src/applications/spaces/view/PHUISpacesNamespaceContextView.php
+++ b/src/applications/spaces/view/PHUISpacesNamespaceContextView.php
@@ -1,49 +1,49 @@
<?php
final class PHUISpacesNamespaceContextView extends AphrontView {
private $object;
public function setObject($object) {
$this->object = $object;
return $this;
}
public function getObject() {
return $this->object;
}
public function render() {
$object = $this->getObject();
$space_phid = PhabricatorSpacesNamespaceQuery::getObjectSpacePHID($object);
if (!$space_phid) {
return null;
}
// If the viewer can't see spaces, pretend they don't exist.
$viewer = $this->getUser();
if (!PhabricatorSpacesNamespaceQuery::getViewerSpacesExist($viewer)) {
return null;
}
// If this is the default space, don't show a space label.
$default = PhabricatorSpacesNamespaceQuery::getDefaultSpace();
if ($default) {
if ($default->getPHID() == $space_phid) {
return null;
}
}
return phutil_tag(
'span',
array(
'class' => 'spaces-name',
),
array(
- $viewer->renderHandle($space_phid),
+ $viewer->renderHandle($space_phid)->setUseShortName(true),
' | ',
));
}
}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Apr 30, 5:38 AM (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
108568
Default Alt Text
(2 KB)

Event Timeline