Path: blob/master/src/applications/files/iconset/PhabricatorIconSet.php
12241 views
<?php12abstract class PhabricatorIconSet3extends Phobject {45final public function getIconSetKey() {6return $this->getPhobjectClassConstant('ICONSETKEY');7}89public function getChooseButtonText() {10return pht('Choose Icon...');11}1213public function getSelectIconTitleText() {14return pht('Choose Icon');15}1617public function getSelectURI() {18$key = $this->getIconSetKey();19return "/file/iconset/{$key}/select/";20}2122final public function getIcons() {23$icons = $this->newIcons();2425// TODO: Validate icons.26$icons = mpull($icons, null, 'getKey');2728return $icons;29}3031final public function getIcon($key) {32$icons = $this->getIcons();33return idx($icons, $key);34}3536final public function getIconLabel($key) {37$icon = $this->getIcon($key);3839if ($icon) {40return $icon->getLabel();41}4243return $key;44}4546final public function renderIconForControl(PhabricatorIconSetIcon $icon) {47return phutil_tag(48'span',49array(),50array(51id(new PHUIIconView())->setIcon($icon->getIcon()),52' ',53$icon->getLabel(),54));55}5657final public static function getIconSetByKey($key) {58$sets = self::getAllIconSets();59return idx($sets, $key);60}6162final public static function getAllIconSets() {63return id(new PhutilClassMapQuery())64->setAncestorClass(__CLASS__)65->setUniqueMethod('getIconSetKey')66->execute();67}6869}707172