Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/files/iconset/PhabricatorIconSet.php b/src/applications/files/iconset/PhabricatorIconSet.php
index baf5422375..c31c3e11fc 100644
--- a/src/applications/files/iconset/PhabricatorIconSet.php
+++ b/src/applications/files/iconset/PhabricatorIconSet.php
@@ -1,70 +1,72 @@
<?php
abstract class PhabricatorIconSet
extends Phobject {
+ abstract protected function newIcons();
+
final public function getIconSetKey() {
return $this->getPhobjectClassConstant('ICONSETKEY');
}
public function getChooseButtonText() {
return pht('Choose Icon...');
}
public function getSelectIconTitleText() {
return pht('Choose Icon');
}
public function getSelectURI() {
$key = $this->getIconSetKey();
return "/file/iconset/{$key}/select/";
}
final public function getIcons() {
$icons = $this->newIcons();
// TODO: Validate icons.
$icons = mpull($icons, null, 'getKey');
return $icons;
}
final public function getIcon($key) {
$icons = $this->getIcons();
return idx($icons, $key);
}
final public function getIconLabel($key) {
$icon = $this->getIcon($key);
if ($icon) {
return $icon->getLabel();
}
return $key;
}
final public function renderIconForControl(PhabricatorIconSetIcon $icon) {
return phutil_tag(
'span',
array(),
array(
id(new PHUIIconView())->setIcon($icon->getIcon()),
' ',
$icon->getLabel(),
));
}
final public static function getIconSetByKey($key) {
$sets = self::getAllIconSets();
return idx($sets, $key);
}
final public static function getAllIconSets() {
return id(new PhutilClassMapQuery())
->setAncestorClass(__CLASS__)
->setUniqueMethod('getIconSetKey')
->execute();
}
}

File Metadata

Mime Type
text/x-diff
Expires
Wed, Nov 27, 3:38 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1286
Default Alt Text
(1 KB)

Event Timeline