Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14085334
D17437.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17437.diff
View Options
diff --git a/src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php
--- a/src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php
+++ b/src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php
@@ -7,6 +7,7 @@
const FIELD_URI = 'uri';
const FIELD_NAME = 'name';
+ const FIELD_TOOLTIP = 'tooltip';
public function getMenuItemTypeIcon() {
return 'fa-link';
@@ -38,6 +39,10 @@
->setLabel(pht('URI'))
->setIsRequired(true)
->setValue($this->getLinkURI($config)),
+ id(new PhabricatorTextEditField())
+ ->setKey(self::FIELD_TOOLTIP)
+ ->setLabel(pht('Tooltip'))
+ ->setValue($this->getLinkTooltip($config)),
id(new PhabricatorIconSetEditField())
->setKey('icon')
->setLabel(pht('Icon'))
@@ -61,6 +66,11 @@
return $config->getMenuItemProperty('uri');
}
+ private function getLinkTooltip(
+ PhabricatorProfileMenuItemConfiguration $config) {
+ return $config->getMenuItemProperty('tooltip');
+ }
+
private function isValidLinkURI($uri) {
return PhabricatorEnv::isValidURIForLink($uri);
}
@@ -71,6 +81,7 @@
$icon = $this->getLinkIcon($config);
$name = $this->getLinkName($config);
$href = $this->getLinkURI($config);
+ $tooltip = $this->getLinkTooltip($config);
if (!$this->isValidLinkURI($href)) {
$href = '#';
@@ -87,7 +98,8 @@
$item = $this->newItem()
->setHref($href)
->setName($name)
- ->setIcon($icon_class);
+ ->setIcon($icon_class)
+ ->setTooltip($tooltip);
return array(
$item,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 11:28 AM (18 h, 20 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6782502
Default Alt Text
D17437.diff (1 KB)
Attached To
Mode
D17437: Add a tooltip option to Link menu items
Attached
Detach File
Event Timeline
Log In to Comment