Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/icon/PhabricatorProjectIconSet.php
| Context not available. | |||||
| continue; | continue; | ||||
| } | } | ||||
| $spec_name = spec['name']; | |||||
| if ($spec_name) { | |||||
| $spec_name = pht("$spec_name"); | |||||
| } | |||||
| $icons[] = id(new PhabricatorIconSetIcon()) | $icons[] = id(new PhabricatorIconSetIcon()) | ||||
| ->setKey($spec['key']) | ->setKey($spec['key']) | ||||
| ->setIsDisabled(idx($spec, 'disabled')) | ->setIsDisabled(idx($spec, 'disabled')) | ||||
| ->setIcon($spec['icon']) | ->setIcon($spec['icon']) | ||||
| ->setLabel($spec_name); | ->setLabel($spec['name']); | ||||
| } | } | ||||
| return $icons; | return $icons; | ||||
| Context not available. | |||||
| public static function getIconName($key) { | public static function getIconName($key) { | ||||
| $spec = self::getIconSpec($key); | $spec = self::getIconSpec($key); | ||||
| $value = idx($spec, 'name', null); | return idx($spec, 'name', null); | ||||
| if ($value != null) { | |||||
| return pht("$value"); | |||||
| } | |||||
| return $value; | |||||
| } | } | ||||
| public static function getIconImage($key) { | public static function getIconImage($key) { | ||||
| Context not available. | |||||
| $icons = self::getIconSpecifications(); | $icons = self::getIconSpecifications(); | ||||
| foreach ($icons as $icon) { | foreach ($icons as $icon) { | ||||
| if (idx($icon, 'key') === $key) { | if (idx($icon, 'key') === $key) { | ||||
| $spec_local = array(); | return $icon; | ||||
| foreach ($icon as $key => $value) { | |||||
| if ($key == 'name') { | |||||
| $spec_local['name'] = pht("$value"); | |||||
| } else { | |||||
| $spec_local[$key] = $value; | |||||
| } | |||||
| } | |||||
| return $spec_local; | |||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||