ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
30 static protected $map = array(
31 "up" => array("class" => "glyphicon glyphicon-chevron-up", "txt" => "up"),
32 "down" => array("class" => "glyphicon glyphicon-chevron-down", "txt" => "down"),
33 "add" => array("class" => "glyphicon glyphicon-plus", "txt" => "add"),
34 "remove" => array("class" => "glyphicon glyphicon-minus", "txt" => "remove"),
35 "previous" => array("class" => "glyphicon glyphicon-chevron-left", "txt" => "previous"),
36 "next" => array("class" => "glyphicon glyphicon-chevron-right", "txt" => "next"),
37 "calendar" => array("class" => "glyphicon glyphicon-calendar", "txt" => "calendar"),
38 "close" => array("class" => "glyphicon glyphicon-remove", "txt" => "close"),
39 "attachment" => array("class" => "glyphicon glyphicon-paperclip", "txt" => "attachment"),
40 "caret" => array("class" => "", "txt" => ""),
41 "drag" => array("class" => "glyphicon glyphicon-share-alt", "txt" => "drag"),
42 "search" => array("class" => "glyphicon glyphicon-search", "txt" => "search"),
43 "filter" => array("class" => "glyphicon glyphicon-filter", "txt" => "filter"),
44 "info" => array("class" => "glyphicon glyphicon-info-sign", "txt" => "info")
45 );
46
54 static function get($a_glyph, $a_text = "")
55 {
56 global $lng;
57
58 $html = "";
59 $text = ($a_text == "")
60 ? $lng->txt(self::$map[$a_glyph]["txt"])
61 : ($a_text == self::NO_TEXT)
62 ? ""
63 : $a_text;
64 switch ($a_glyph)
65 {
66 case self::CARET:
67 $html = '<span class="caret"></span>';
68 break;
69
70 default:
71 $html = '<span class="sr-only">'.$text.
72 '</span><span class="'.self::$map[$a_glyph]["class"].'"></span>';
73 break;
74
75 }
76 return $html;
77 }
78
79}
80
81?>
$html
Definition: example_001.php:87
$text
global $lng
Definition: privfeed.php:40