ILIAS  release_8 Revision v8.24
class.ilGlyphGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 public const UP = "up";
25 public const DOWN = "down";
26 public const ADD = "add";
27 public const REMOVE = "remove";
28 public const PREVIOUS = "previous";
29 public const NEXT = "next";
30 public const CALENDAR = "calendar";
31 public const CLOSE = "close";
32 public const ATTACHMENT = "attachment";
33 public const CARET = "caret";
34 public const DRAG = "drag";
35 public const SEARCH = "search";
36 public const FILTER = "filter";
37 public const NO_TEXT = "**notext**";
38 public const INFO = "info";
39 public const EXCLAMATION = "exclamation";
40
41 protected static array $map = array(
42 "up" => array("class" => "glyphicon glyphicon-chevron-up", "txt" => "up"),
43 "down" => array("class" => "glyphicon glyphicon-chevron-down", "txt" => "down"),
44 "add" => array("class" => "glyphicon glyphicon-plus", "txt" => "add"),
45 "remove" => array("class" => "glyphicon glyphicon-minus", "txt" => "remove"),
46 "previous" => array("class" => "glyphicon glyphicon-chevron-left", "txt" => "previous"),
47 "next" => array("class" => "glyphicon glyphicon-chevron-right", "txt" => "next"),
48 "calendar" => array("class" => "glyphicon glyphicon-calendar", "txt" => "calendar"),
49 "close" => array("class" => "glyphicon glyphicon-remove", "txt" => "close"),
50 "attachment" => array("class" => "glyphicon glyphicon-paperclip", "txt" => "attachment"),
51 "caret" => array("class" => "", "txt" => ""),
52 "drag" => array("class" => "glyphicon glyphicon-share-alt", "txt" => "drag"),
53 "search" => array("class" => "glyphicon glyphicon-search", "txt" => "search"),
54 "filter" => array("class" => "glyphicon glyphicon-filter", "txt" => "filter"),
55 "exclamation" => array("class" => "glyphicon glyphicon-exclamation-sign ilAlert", "txt" => "exclamation"),
56 "info" => array("class" => "glyphicon glyphicon-info-sign", "txt" => "info")
57 );
58
59 public static function get(
60 string $a_glyph,
61 string $a_text = ""
62 ): string {
63 global $DIC;
64
65 $lng = $DIC->language();
66
67 $text = ($a_text === "")
68 ? $lng->txt(self::$map[$a_glyph]["txt"])
69 : (($a_text === self::NO_TEXT)
70 ? ""
71 : $a_text);
72 switch ($a_glyph) {
73 case self::CARET:
74 $html = '<span class="caret"></span>';
75 break;
76
77 default:
78 $html = '<span class="sr-only">' . $text .
79 '</span><span class="' . self::$map[$a_glyph]["class"] . '"></span>';
80 break;
81
82 }
83 return $html;
84 }
85}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static array $map
global $DIC
Definition: feed.php:28
$lng