@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 a tooltip option to Link menu items

Summary: Ref T12174. Let's users add a tooltip to LinkProfileMenuItem

Test Plan: Add a tooltip, remove tooltip. Menu appears as expected

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T12174

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

+13 -1
+13 -1
src/applications/search/menuitem/PhabricatorLinkProfileMenuItem.php
··· 7 7 8 8 const FIELD_URI = 'uri'; 9 9 const FIELD_NAME = 'name'; 10 + const FIELD_TOOLTIP = 'tooltip'; 10 11 11 12 public function getMenuItemTypeIcon() { 12 13 return 'fa-link'; ··· 38 39 ->setLabel(pht('URI')) 39 40 ->setIsRequired(true) 40 41 ->setValue($this->getLinkURI($config)), 42 + id(new PhabricatorTextEditField()) 43 + ->setKey(self::FIELD_TOOLTIP) 44 + ->setLabel(pht('Tooltip')) 45 + ->setValue($this->getLinkTooltip($config)), 41 46 id(new PhabricatorIconSetEditField()) 42 47 ->setKey('icon') 43 48 ->setLabel(pht('Icon')) ··· 61 66 return $config->getMenuItemProperty('uri'); 62 67 } 63 68 69 + private function getLinkTooltip( 70 + PhabricatorProfileMenuItemConfiguration $config) { 71 + return $config->getMenuItemProperty('tooltip'); 72 + } 73 + 64 74 private function isValidLinkURI($uri) { 65 75 return PhabricatorEnv::isValidURIForLink($uri); 66 76 } ··· 71 81 $icon = $this->getLinkIcon($config); 72 82 $name = $this->getLinkName($config); 73 83 $href = $this->getLinkURI($config); 84 + $tooltip = $this->getLinkTooltip($config); 74 85 75 86 if (!$this->isValidLinkURI($href)) { 76 87 $href = '#'; ··· 87 98 $item = $this->newItem() 88 99 ->setHref($href) 89 100 ->setName($name) 90 - ->setIcon($icon_class); 101 + ->setIcon($icon_class) 102 + ->setTooltip($tooltip); 91 103 92 104 return array( 93 105 $item,