Page MenuHomePhabricator

D12710.diff
No OneTemporary

D12710.diff

diff --git a/src/applications/search/view/PhabricatorSearchResultView.php b/src/applications/search/view/PhabricatorSearchResultView.php
--- a/src/applications/search/view/PhabricatorSearchResultView.php
+++ b/src/applications/search/view/PhabricatorSearchResultView.php
@@ -31,12 +31,12 @@
$type_name = nonempty($handle->getTypeName(), pht('Document'));
- $title = $this->emboldenQuery($handle->getFullName());
- if ($handle->getStatus() == PhabricatorObjectHandleStatus::STATUS_CLOSED) {
- }
+ $raw_title = $handle->getFullName();
+ $title = $this->emboldenQuery($raw_title);
$item = id(new PHUIObjectItemView())
->setHeader($title)
+ ->setTitleText($raw_title)
->setHref($handle->getURI())
->setImageURI($handle->getImageURI())
->addAttribute($type_name);
@@ -110,6 +110,9 @@
$buf = '';
$pos = 0;
$is_bold = false;
+
+ // Make sure this is UTF8 because phutil_utf8v() will explode if it isn't.
+ $str = phutil_utf8ize($str);
foreach (phutil_utf8v($str) as $chr) {
if ($bold[$pos] != $is_bold) {
if (strlen($buf)) {
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
@@ -22,6 +22,7 @@
private $state;
private $fontIcon;
private $imageIcon;
+ private $titleText;
const AGE_FRESH = 'fresh';
const AGE_STALE = 'stale';
@@ -98,6 +99,15 @@
return $this;
}
+ public function setTitleText($title_text) {
+ $this->titleText = $title_text;
+ return $this;
+ }
+
+ public function getTitleText() {
+ return $this->titleText;
+ }
+
public function getHeader() {
return $this->header;
}
@@ -329,12 +339,19 @@
);
}
+ $title_text = null;
+ if ($this->titleText) {
+ $title_text = $this->titleText;
+ } else if ($this->href) {
+ $title_text = $this->header;
+ }
+
$header_link = phutil_tag(
$this->href ? 'a' : 'div',
array(
'href' => $this->href,
'class' => 'phui-object-item-link',
- 'title' => ($this->href) ? $this->header : null,
+ 'title' => $title_text,
),
$this->header);

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 3:51 AM (20 h, 30 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6917356
Default Alt Text
D12710.diff (2 KB)

Event Timeline