Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/engine/PhabricatorProfileMenuItemView.php
<?php | <?php | ||||
final class PhabricatorProfileMenuItemView | final class PhabricatorProfileMenuItemView | ||||
extends Phobject { | extends Phobject { | ||||
private $config; | private $config; | ||||
private $uri; | private $uri; | ||||
private $name; | private $name; | ||||
private $icon; | private $icon; | ||||
private $iconImage; | |||||
private $disabled; | private $disabled; | ||||
private $tooltip; | private $tooltip; | ||||
private $actions = array(); | private $actions = array(); | ||||
private $counts = array(); | private $counts = array(); | ||||
private $images = array(); | private $images = array(); | ||||
private $progressBars = array(); | private $progressBars = array(); | ||||
private $isExternalLink; | private $isExternalLink; | ||||
private $specialType; | private $specialType; | ||||
Show All 30 Lines | public function setIcon($icon) { | ||||
$this->icon = $icon; | $this->icon = $icon; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIcon() { | public function getIcon() { | ||||
return $this->icon; | return $this->icon; | ||||
} | } | ||||
public function setIconImage($icon_image) { | |||||
$this->iconImage = $icon_image; | |||||
return $this; | |||||
} | |||||
public function getIconImage() { | |||||
return $this->iconImage; | |||||
} | |||||
public function setDisabled($disabled) { | public function setDisabled($disabled) { | ||||
$this->disabled = $disabled; | $this->disabled = $disabled; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getDisabled() { | public function getDisabled() { | ||||
return $this->disabled; | return $this->disabled; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | if (strlen($uri)) { | ||||
$view->setHref($uri); | $view->setHref($uri); | ||||
} | } | ||||
$icon = $this->getIcon(); | $icon = $this->getIcon(); | ||||
if ($icon) { | if ($icon) { | ||||
$view->setIcon($icon); | $view->setIcon($icon); | ||||
} | } | ||||
$icon_image = $this->getIconImage(); | |||||
if ($icon_image) { | |||||
$view->setProfileImage($icon_image); | |||||
} | |||||
if ($this->getDisabled()) { | if ($this->getDisabled()) { | ||||
$view->setDisabled(true); | $view->setDisabled(true); | ||||
} | } | ||||
if ($this->getIsLabel()) { | if ($this->getIsLabel()) { | ||||
$view->setType(PHUIListItemView::TYPE_LABEL); | $view->setType(PHUIListItemView::TYPE_LABEL); | ||||
} | } | ||||
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(); | |||||
if (strlen($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'; | ||||
if ($this->getDisabled()) { | if ($this->getDisabled()) { | ||||
$classes[] = 'phui-image-disabled'; | $classes[] = 'phui-image-disabled'; | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |