ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilGlyphGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
13 {
14  const UP = "up";
15  const DOWN = "down";
16  const ADD = "add";
17  const REMOVE = "remove";
18  const PREVIOUS = "previous";
19  const NEXT = "next";
20  const CALENDAR = "calendar";
21  const CLOSE = "close";
22  const ATTACHMENT = "attachment";
23  const CARET = "caret";
24  const DRAG = "drag";
25  const SEARCH = "search";
26  const NO_TEXT = "**notext**";
27 
28  static protected $map = array(
29  "up" => array("class" => "glyphicon glyphicon-chevron-up", "txt" => "up"),
30  "down" => array("class" => "glyphicon glyphicon-chevron-down", "txt" => "down"),
31  "add" => array("class" => "glyphicon glyphicon-plus", "txt" => "add"),
32  "remove" => array("class" => "glyphicon glyphicon-minus", "txt" => "remove"),
33  "previous" => array("class" => "glyphicon glyphicon-chevron-left", "txt" => "previous"),
34  "next" => array("class" => "glyphicon glyphicon-chevron-right", "txt" => "next"),
35  "calendar" => array("class" => "glyphicon glyphicon-calendar", "txt" => "calendar"),
36  "close" => array("class" => "glyphicon glyphicon-remove", "txt" => "close"),
37  "attachment" => array("class" => "glyphicon glyphicon-paperclip", "txt" => "attachment"),
38  "caret" => array("class" => "", "txt" => ""),
39  "drag" => array("class" => "glyphicon glyphicon-share-alt", "txt" => "drag"),
40  "search" => array("class" => "glyphicon glyphicon-search", "txt" => "search")
41  );
42 
50  static function get($a_glyph, $a_text = "")
51  {
52  global $lng;
53 
54  $html = "";
55  $text = ($a_text == "")
56  ? $lng->txt(self::$map[$a_glyph]["txt"])
57  : ($a_text == self::NO_TEXT)
58  ? ""
59  : $a_text;
60  switch ($a_glyph)
61  {
62  case self::CARET:
63  $html = '<span class="caret"></span>';
64  break;
65 
66  default:
67  $html = '<span class="sr-only">'.$text.
68  '</span><span class="'.self::$map[$a_glyph]["class"].'"></span>';
69  break;
70 
71  }
72  return $html;
73  }
74 
75 }
76 
77 ?>