[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/project/icon/ -> PhabricatorProjectIcon.php (source)

   1  <?php
   2  
   3  final class PhabricatorProjectIcon extends Phobject {
   4  
   5    public static function getIconMap() {
   6      return
   7        array(
   8          'fa-briefcase' => pht('Briefcase'),
   9          'fa-tags' => pht('Tag'),
  10          'fa-folder' => pht('Folder'),
  11          'fa-users' => pht('Team'),
  12          'fa-bug' => pht('Bug'),
  13          'fa-trash-o' => pht('Garbage'),
  14          'fa-calendar' => pht('Deadline'),
  15          'fa-flag-checkered' => pht('Goal'),
  16          'fa-envelope' => pht('Communication'),
  17          'fa-truck' => pht('Release'),
  18          'fa-lock' => pht('Policy'),
  19          'fa-umbrella' => pht('An Umbrella'),
  20          'fa-cloud' => pht('The Cloud'),
  21          'fa-building' => pht('Company'),
  22          'fa-credit-card' => pht('Accounting'),
  23          'fa-flask' => pht('Experimental'),
  24        );
  25    }
  26  
  27    public static function getColorMap() {
  28      $shades = PHUITagView::getShadeMap();
  29      $shades = array_select_keys(
  30        $shades,
  31        array(PhabricatorProject::DEFAULT_COLOR)) + $shades;
  32      unset($shades[PHUITagView::COLOR_DISABLED]);
  33  
  34      return $shades;
  35    }
  36  
  37    public static function getLabel($key) {
  38      $map = self::getIconMap();
  39      return $map[$key];
  40    }
  41  
  42    public static function getAPIName($key) {
  43      return substr($key, 3);
  44    }
  45  
  46    public static function renderIconForChooser($icon) {
  47      $project_icons = PhabricatorProjectIcon::getIconMap();
  48  
  49      return phutil_tag(
  50        'span',
  51        array(),
  52        array(
  53          id(new PHUIIconView())->setIconFont($icon),
  54          ' ',
  55          idx($project_icons, $icon, pht('Unknown Icon')),
  56        ));
  57    }
  58  
  59  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1