Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorProfileMenuItemView.php
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | private function isSpecialType($type) { | ||||
return ($this->specialType === $type); | return ($this->specialType === $type); | ||||
} | } | ||||
public function newListItemView() { | public function newListItemView() { | ||||
$view = id(new PHUIListItemView()) | $view = id(new PHUIListItemView()) | ||||
->setName($this->getName()); | ->setName($this->getName()); | ||||
$uri = $this->getURI(); | $uri = $this->getURI(); | ||||
if (strlen($uri)) { | if (phutil_nonempty_string($uri)) { | ||||
valerio.bozzolan: ✅ OK since the expected input domain is **NULL** (default) or a **string**. The phutil will… | |||||
if ($this->getIsExternalLink()) { | if ($this->getIsExternalLink()) { | ||||
if (!PhabricatorEnv::isValidURIForLink($uri)) { | if (!PhabricatorEnv::isValidURIForLink($uri)) { | ||||
$uri = '#'; | $uri = '#'; | ||||
} | } | ||||
$view->setRel('noreferrer'); | $view->setRel('noreferrer'); | ||||
} | } | ||||
$view->setHref($uri); | $view->setHref($uri); | ||||
Show All 19 Lines | public function newListItemView() { | ||||
if ($this->getIsDivider()) { | if ($this->getIsDivider()) { | ||||
$view | $view | ||||
->setType(PHUIListItemView::TYPE_DIVIDER) | ->setType(PHUIListItemView::TYPE_DIVIDER) | ||||
->addClass('phui-divider'); | ->addClass('phui-divider'); | ||||
} | } | ||||
$tooltip = $this->getTooltip(); | $tooltip = $this->getTooltip(); | ||||
if (strlen($tooltip)) { | if (phutil_nonempty_string($tooltip)) { | ||||
Done Inline Actions✅ OK since the expected input domain is NULL (default) or a string. The phutil will throw for alien types, and it's OK. Example usage: ->setTooltip(pht('Silent Edit')) valerio.bozzolan: ✅ OK since the expected input domain is **NULL** (default) or a **string**. The phutil will… | |||||
$view->setTooltip($tooltip); | $view->setTooltip($tooltip); | ||||
} | } | ||||
if ($this->images) { | if ($this->images) { | ||||
require_celerity_resource('people-picture-menu-item-css'); | require_celerity_resource('people-picture-menu-item-css'); | ||||
foreach ($this->images as $image_src) { | foreach ($this->images as $image_src) { | ||||
$classes = array(); | $classes = array(); | ||||
$classes[] = 'people-menu-image'; | $classes[] = 'people-menu-image'; | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
✅ OK since the expected input domain is NULL (default) or a string. The phutil will throw for alien types, and it's OK.