@@ -7,6 +7,7 @@ final class PhabricatorLinkProfileMenuItem
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,6 +39,10 @@ public function buildEditEngineFields(
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,6 +66,11 @@ private function getLinkURI(
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,6 +81,7 @@ protected function newNavigationMenuItems(
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,7 +98,8 @@ protected function newNavigationMenuItems(
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 ,
0 commit comments