Use PHUIIconView for PhabricatorActionView
Summary: Allows application icons to appear in action lists.
Test Plan: {F49487}
Reviewers: chad, btrahan
Reviewed By: chad
CC: aran
Differential Revision: https://secure.phabricator.com/D6408
This commit is contained in:
@@ -4,6 +4,7 @@ final class PhabricatorActionView extends AphrontView {
|
||||
|
||||
private $name;
|
||||
private $icon;
|
||||
private $iconSheet;
|
||||
private $href;
|
||||
private $disabled;
|
||||
private $workflow;
|
||||
@@ -29,6 +30,11 @@ final class PhabricatorActionView extends AphrontView {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setIconSheet($sheet) {
|
||||
$this->iconSheet = $sheet;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
@@ -53,20 +59,17 @@ final class PhabricatorActionView extends AphrontView {
|
||||
|
||||
$icon = null;
|
||||
if ($this->icon) {
|
||||
$sheet = nonempty($this->iconSheet, PHUIIconView::SPRITE_ICONS);
|
||||
|
||||
$suffix = '';
|
||||
if ($this->disabled) {
|
||||
$suffix = '-grey';
|
||||
}
|
||||
|
||||
require_celerity_resource('sprite-icons-css');
|
||||
$icon = phutil_tag(
|
||||
'span',
|
||||
array(
|
||||
'class' => 'phabricator-action-view-icon sprite-icons '.
|
||||
'icons-'.$this->icon.$suffix,
|
||||
),
|
||||
'');
|
||||
$icon = id(new PHUIIconView())
|
||||
->addClass('phabricator-action-view-icon')
|
||||
->setSpriteIcon($this->icon.$suffix)
|
||||
->setSpriteSheet($sheet);
|
||||
}
|
||||
|
||||
if ($this->href) {
|
||||
|
||||
Reference in New Issue
Block a user