ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 FILTER = "filter";
27 const NO_TEXT = "**notext**";
28 const INFO = "info";
29 const EXCLAMATION = "exclamation";
30
31 static protected $map = array(
32 "up" => array("class" => "glyphicon glyphicon-chevron-up", "txt" => "up"),
33 "down" => array("class" => "glyphicon glyphicon-chevron-down", "txt" => "down"),
34 "add" => array("class" => "glyphicon glyphicon-plus", "txt" => "add"),
35 "remove" => array("class" => "glyphicon glyphicon-minus", "txt" => "remove"),
36 "previous" => array("class" => "glyphicon glyphicon-chevron-left", "txt" => "previous"),
37 "next" => array("class" => "glyphicon glyphicon-chevron-right", "txt" => "next"),
38 "calendar" => array("class" => "glyphicon glyphicon-calendar", "txt" => "calendar"),
39 "close" => array("class" => "glyphicon glyphicon-remove", "txt" => "close"),
40 "attachment" => array("class" => "glyphicon glyphicon-paperclip", "txt" => "attachment"),
41 "caret" => array("class" => "", "txt" => ""),
42 "drag" => array("class" => "glyphicon glyphicon-share-alt", "txt" => "drag"),
43 "search" => array("class" => "glyphicon glyphicon-search", "txt" => "search"),
44 "filter" => array("class" => "glyphicon glyphicon-filter", "txt" => "filter"),
45 "exclamation" => array("class" => "glyphicon glyphicon-exclamation-sign ilAlert", "txt" => "exclamation"),
46 "info" => array("class" => "glyphicon glyphicon-info-sign", "txt" => "info")
47 );
48
56 static function get($a_glyph, $a_text = "")
57 {
58 global $lng;
59
60 $html = "";
61 $text = ($a_text == "")
62 ? $lng->txt(self::$map[$a_glyph]["txt"])
63 : ($a_text == self::NO_TEXT)
64 ? ""
65 : $a_text;
66 switch ($a_glyph)
67 {
68 case self::CARET:
69 $html = '<span class="caret"></span>';
70 break;
71
72 default:
73 $html = '<span class="sr-only">'.$text.
74 '</span><span class="'.self::$map[$a_glyph]["class"].'"></span>';
75 break;
76
77 }
78 return $html;
79 }
80
81}
82
83?>
An exception for terminatinating execution or to throw for unit testing.
$html
Definition: example_001.php:87
$text
global $lng
Definition: privfeed.php:17