1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Contains class \core\output\icon_system
|
|
|
19 |
*
|
|
|
20 |
* @package core
|
|
|
21 |
* @category output
|
|
|
22 |
* @copyright 2016 Damyon Wiese
|
|
|
23 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
24 |
*/
|
|
|
25 |
|
|
|
26 |
namespace core\output;
|
|
|
27 |
|
|
|
28 |
use renderer_base;
|
|
|
29 |
use pix_icon;
|
|
|
30 |
|
|
|
31 |
defined('MOODLE_INTERNAL') || die();
|
|
|
32 |
|
|
|
33 |
/**
|
|
|
34 |
* Class allowing different systems for mapping and rendering icons.
|
|
|
35 |
*
|
|
|
36 |
* Possible icon styles are:
|
|
|
37 |
* 1. standard - image tags are generated which point to pix icons stored in a plugin pix folder.
|
|
|
38 |
* 2. fontawesome - font awesome markup is generated with the name of the icon mapped from the moodle icon name.
|
|
|
39 |
* 3. inline - inline tags are used for svg and png so no separate page requests are made (at the expense of page size).
|
|
|
40 |
*
|
|
|
41 |
* @package core
|
|
|
42 |
* @category output
|
|
|
43 |
* @copyright 2016 Damyon Wiese
|
|
|
44 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
45 |
*/
|
|
|
46 |
class icon_system_fontawesome extends icon_system_font {
|
|
|
47 |
|
|
|
48 |
/**
|
|
|
49 |
* @var array $map Cached map of moodle icon names to font awesome icon names.
|
|
|
50 |
*/
|
|
|
51 |
private $map = [];
|
|
|
52 |
|
|
|
53 |
public function get_core_icon_map() {
|
|
|
54 |
return [
|
|
|
55 |
'core:docs' => 'fa-info-circle',
|
|
|
56 |
'core:book' => 'fa-book',
|
|
|
57 |
'core:help' => 'fa-question-circle text-info',
|
|
|
58 |
'core:req' => 'fa-exclamation-circle text-danger',
|
|
|
59 |
'core:a/add_file' => 'fa-file-o',
|
|
|
60 |
'core:a/create_folder' => 'fa-folder-o',
|
|
|
61 |
'core:a/download_all' => 'fa-download',
|
|
|
62 |
'core:a/help' => 'fa-question-circle text-info',
|
|
|
63 |
'core:a/logout' => 'fa-sign-out',
|
|
|
64 |
'core:a/refresh' => 'fa-refresh',
|
|
|
65 |
'core:a/search' => 'fa-search',
|
|
|
66 |
'core:a/setting' => 'fa-cog',
|
|
|
67 |
'core:a/view_icon_active' => 'fa-th',
|
|
|
68 |
'core:a/view_list_active' => 'fa-list',
|
|
|
69 |
'core:a/view_tree_active' => 'fa-folder',
|
|
|
70 |
'core:b/bookmark-new' => 'fa-bookmark',
|
|
|
71 |
'core:b/document-edit' => 'fa-pencil',
|
|
|
72 |
'core:b/document-new' => 'fa-file-o',
|
|
|
73 |
'core:b/document-properties' => 'fa-info',
|
|
|
74 |
'core:b/edit-copy' => 'fa-files-o',
|
|
|
75 |
'core:b/edit-delete' => 'fa-trash',
|
|
|
76 |
'core:e/abbr' => 'fa-comment',
|
|
|
77 |
'core:e/absolute' => 'fa-crosshairs',
|
|
|
78 |
'core:e/accessibility_checker' => 'fa-universal-access',
|
|
|
79 |
'core:e/acronym' => 'fa-comment',
|
|
|
80 |
'core:e/advance_hr' => 'fa-arrows-h',
|
|
|
81 |
'core:e/align_center' => 'fa-align-center',
|
|
|
82 |
'core:e/align_left' => 'fa-align-left',
|
|
|
83 |
'core:e/align_right' => 'fa-align-right',
|
|
|
84 |
'core:e/anchor' => 'fa-chain',
|
|
|
85 |
'core:e/backward' => 'fa-undo',
|
|
|
86 |
'core:e/bold' => 'fa-bold',
|
|
|
87 |
'core:e/bullet_list' => 'fa-list-ul',
|
|
|
88 |
'core:e/cancel' => 'fa-times',
|
|
|
89 |
'core:e/cancel_solid_circle' => 'fas fa-times-circle',
|
|
|
90 |
'core:e/cell_props' => 'fa-info',
|
|
|
91 |
'core:e/cite' => 'fa-quote-right',
|
|
|
92 |
'core:e/cleanup_messy_code' => 'fa-eraser',
|
|
|
93 |
'core:e/clear_formatting' => 'fa-i-cursor',
|
|
|
94 |
'core:e/copy' => 'fa-clone',
|
|
|
95 |
'core:e/cut' => 'fa-scissors',
|
|
|
96 |
'core:e/decrease_indent' => 'fa-outdent',
|
|
|
97 |
'core:e/delete_col' => 'fa-minus',
|
|
|
98 |
'core:e/delete_row' => 'fa-minus',
|
|
|
99 |
'core:e/delete' => 'fa-minus',
|
|
|
100 |
'core:e/delete_table' => 'fa-minus',
|
|
|
101 |
'core:e/document_properties' => 'fa-info',
|
|
|
102 |
'core:e/emoticons' => 'fa-smile-o',
|
|
|
103 |
'core:e/find_replace' => 'fa-search-plus',
|
|
|
104 |
'core:e/file-text' => 'fa-file-text',
|
|
|
105 |
'core:e/forward' => 'fa-arrow-right',
|
|
|
106 |
'core:e/fullpage' => 'fa-arrows-alt',
|
|
|
107 |
'core:e/fullscreen' => 'fa-arrows-alt',
|
|
|
108 |
'core:e/help' => 'fa-question-circle',
|
|
|
109 |
'core:e/increase_indent' => 'fa-indent',
|
|
|
110 |
'core:e/insert_col_after' => 'fa-columns',
|
|
|
111 |
'core:e/insert_col_before' => 'fa-columns',
|
|
|
112 |
'core:e/insert_date' => 'fa-calendar',
|
|
|
113 |
'core:e/insert_edit_image' => 'fa-picture-o',
|
|
|
114 |
'core:e/insert_edit_link' => 'fa-link',
|
|
|
115 |
'core:e/insert_edit_video' => 'fa-file-video-o',
|
|
|
116 |
'core:e/insert_file' => 'fa-file',
|
|
|
117 |
'core:e/insert_horizontal_ruler' => 'fa-arrows-h',
|
|
|
118 |
'core:e/insert_nonbreaking_space' => 'fa-square-o',
|
|
|
119 |
'core:e/insert_page_break' => 'fa-level-down',
|
|
|
120 |
'core:e/insert_row_after' => 'fa-plus',
|
|
|
121 |
'core:e/insert_row_before' => 'fa-plus',
|
|
|
122 |
'core:e/insert' => 'fa-plus',
|
|
|
123 |
'core:e/insert_time' => 'fa-clock-o',
|
|
|
124 |
'core:e/italic' => 'fa-italic',
|
|
|
125 |
'core:e/justify' => 'fa-align-justify',
|
|
|
126 |
'core:e/layers_over' => 'fa-level-up',
|
|
|
127 |
'core:e/layers' => 'fa-window-restore',
|
|
|
128 |
'core:e/layers_under' => 'fa-level-down',
|
|
|
129 |
'core:e/left_to_right' => 'fa-chevron-right',
|
|
|
130 |
'core:e/manage_files' => 'fa-files-o',
|
|
|
131 |
'core:e/math' => 'fa-calculator',
|
|
|
132 |
'core:e/merge_cells' => 'fa-compress',
|
|
|
133 |
'core:e/new_document' => 'fa-file-o',
|
|
|
134 |
'core:e/numbered_list' => 'fa-list-ol',
|
|
|
135 |
'core:e/page_break' => 'fa-level-down',
|
|
|
136 |
'core:e/paste' => 'fa-clipboard',
|
|
|
137 |
'core:e/paste_text' => 'fa-clipboard',
|
|
|
138 |
'core:e/paste_word' => 'fa-clipboard',
|
|
|
139 |
'core:e/prevent_autolink' => 'fa-exclamation',
|
|
|
140 |
'core:e/preview' => 'fa-search-plus',
|
|
|
141 |
'core:e/print' => 'fa-print',
|
|
|
142 |
'core:e/question' => 'fa-question',
|
|
|
143 |
'core:e/redo' => 'fa-repeat',
|
|
|
144 |
'core:e/remove_link' => 'fa-chain-broken',
|
|
|
145 |
'core:e/remove_page_break' => 'fa-remove',
|
|
|
146 |
'core:e/resize' => 'fa-expand',
|
|
|
147 |
'core:e/restore_draft' => 'fa-undo',
|
|
|
148 |
'core:e/restore_last_draft' => 'fa-undo',
|
|
|
149 |
'core:e/right_to_left' => 'fa-chevron-left',
|
|
|
150 |
'core:e/row_props' => 'fa-info',
|
|
|
151 |
'core:e/save' => 'fa-floppy-o',
|
|
|
152 |
'core:e/screenreader_helper' => 'fa-braille',
|
|
|
153 |
'core:e/search' => 'fa-search',
|
|
|
154 |
'core:e/select_all' => 'fa-arrows-h',
|
|
|
155 |
'core:e/show_invisible_characters' => 'fa-eye-slash',
|
|
|
156 |
'core:e/source_code' => 'fa-code',
|
|
|
157 |
'core:e/special_character' => 'fa-pencil-square-o',
|
|
|
158 |
'core:e/spellcheck' => 'fa-check',
|
|
|
159 |
'core:e/split_cells' => 'fa-columns',
|
|
|
160 |
'core:e/strikethrough' => 'fa-strikethrough',
|
|
|
161 |
'core:e/styleparagraph' => 'fa-font',
|
|
|
162 |
'core:e/subscript' => 'fa-subscript',
|
|
|
163 |
'core:e/superscript' => 'fa-superscript',
|
|
|
164 |
'core:e/table_props' => 'fa-table',
|
|
|
165 |
'core:e/table' => 'fa-table',
|
|
|
166 |
'core:e/template' => 'fa-sticky-note',
|
|
|
167 |
'core:e/text_color_picker' => 'fa-paint-brush',
|
|
|
168 |
'core:e/text_color' => 'fa-paint-brush',
|
|
|
169 |
'core:e/text_highlight_picker' => 'fa-lightbulb-o',
|
|
|
170 |
'core:e/text_highlight' => 'fa-lightbulb-o',
|
|
|
171 |
'core:e/tick' => 'fa-check',
|
|
|
172 |
'core:e/toggle_blockquote' => 'fa-quote-left',
|
|
|
173 |
'core:e/underline' => 'fa-underline',
|
|
|
174 |
'core:e/undo' => 'fa-undo',
|
|
|
175 |
'core:e/visual_aid' => 'fa-universal-access',
|
|
|
176 |
'core:e/visual_blocks' => 'fa-audio-description',
|
|
|
177 |
'theme:fp/add_file' => 'fa-file-o',
|
|
|
178 |
'theme:fp/alias' => 'fa-share',
|
|
|
179 |
'theme:fp/alias_sm' => 'fa-share',
|
|
|
180 |
'theme:fp/check' => 'fa-check',
|
|
|
181 |
'theme:fp/create_folder' => 'fa-folder-o',
|
|
|
182 |
'theme:fp/cross' => 'fa-remove',
|
|
|
183 |
'theme:fp/download_all' => 'fa-download',
|
|
|
184 |
'theme:fp/help' => 'fa-question-circle',
|
|
|
185 |
'theme:fp/link' => 'fa-link',
|
|
|
186 |
'theme:fp/link_sm' => 'fa-link',
|
|
|
187 |
'theme:fp/logout' => 'fa-sign-out',
|
|
|
188 |
'theme:fp/path_folder' => 'fa-folder',
|
|
|
189 |
'theme:fp/path_folder_rtl' => 'fa-folder',
|
|
|
190 |
'theme:fp/refresh' => 'fa-refresh',
|
|
|
191 |
'theme:fp/search' => 'fa-search',
|
|
|
192 |
'theme:fp/setting' => 'fa-cog',
|
|
|
193 |
'theme:fp/view_icon_active' => 'fa-th',
|
|
|
194 |
'theme:fp/view_list_active' => 'fa-list',
|
|
|
195 |
'theme:fp/view_tree_active' => 'fa-folder',
|
|
|
196 |
'core:i/activities' => 'fa-file-pen',
|
|
|
197 |
'core:i/addblock' => 'fa-plus-square',
|
|
|
198 |
'core:i/assignroles' => 'fa-user-plus',
|
|
|
199 |
'core:i/asterisk' => 'fa-asterisk',
|
|
|
200 |
'core:i/backup' => 'fa-file-zip-o',
|
|
|
201 |
'core:i/badge' => 'fa-shield',
|
|
|
202 |
'core:i/breadcrumbdivider' => 'fa-angle-right',
|
|
|
203 |
'core:i/bullhorn' => 'fa-bullhorn',
|
|
|
204 |
'core:i/calc' => 'fa-calculator',
|
|
|
205 |
'core:i/calendar' => 'fa-calendar',
|
|
|
206 |
'core:i/calendareventdescription' => 'fa-align-left',
|
|
|
207 |
'core:i/calendareventtime' => 'fa-clock-o',
|
|
|
208 |
'core:i/caution' => 'fa-exclamation text-warning',
|
|
|
209 |
'core:i/checked' => 'fa-check',
|
|
|
210 |
'core:i/checkedcircle' => 'fa-check-circle',
|
|
|
211 |
'core:i/checkpermissions' => 'fa-unlock-alt',
|
|
|
212 |
'core:i/cohort' => 'fa-users',
|
|
|
213 |
'core:i/competencies' => 'fa-check-square-o',
|
|
|
214 |
'core:i/completion_self' => 'fa-user-o',
|
|
|
215 |
'core:i/contentbank' => 'fa-paint-brush',
|
|
|
216 |
'core:i/dashboard' => 'fa-tachometer',
|
|
|
217 |
'core:i/categoryevent' => 'fa-cubes',
|
|
|
218 |
'core:i/chartbar' => 'fa-chart-bar',
|
|
|
219 |
'core:i/course' => 'fa-graduation-cap',
|
|
|
220 |
'core:i/courseevent' => 'fa-graduation-cap',
|
|
|
221 |
'core:i/cloudupload' => 'fa-cloud-upload',
|
|
|
222 |
'core:i/customfield' => 'fa-hand-o-right',
|
|
|
223 |
'core:i/db' => 'fa-database',
|
|
|
224 |
'core:i/delete' => 'fa-trash',
|
|
|
225 |
'core:i/down' => 'fa-arrow-down',
|
|
|
226 |
'core:i/dragdrop' => 'fa-arrows',
|
|
|
227 |
'core:i/duration' => 'fa-clock-o',
|
|
|
228 |
'core:i/emojicategoryactivities' => 'fa-futbol-o',
|
|
|
229 |
'core:i/emojicategoryanimalsnature' => 'fa-leaf',
|
|
|
230 |
'core:i/emojicategoryflags' => 'fa-flag',
|
|
|
231 |
'core:i/emojicategoryfooddrink' => 'fa-cutlery',
|
|
|
232 |
'core:i/emojicategoryobjects' => 'fa-lightbulb-o',
|
|
|
233 |
'core:i/emojicategorypeoplebody' => 'fa-male',
|
|
|
234 |
'core:i/emojicategoryrecent' => 'fa-clock-o',
|
|
|
235 |
'core:i/emojicategorysmileysemotion' => 'fa-smile-o',
|
|
|
236 |
'core:i/emojicategorysymbols' => 'fa-heart',
|
|
|
237 |
'core:i/emojicategorytravelplaces' => 'fa-plane',
|
|
|
238 |
'core:i/edit' => 'fa-pencil',
|
|
|
239 |
'core:i/email' => 'fa-envelope',
|
|
|
240 |
'core:i/empty' => 'fa-fw',
|
|
|
241 |
'core:i/enrolmentsuspended' => 'fa-pause',
|
|
|
242 |
'core:i/enrolusers' => 'fa-user-plus',
|
|
|
243 |
'core:i/excluded' => 'fa-minus-circle',
|
|
|
244 |
'core:i/expired' => 'fa-exclamation text-warning',
|
|
|
245 |
'core:i/export' => 'fa-download',
|
|
|
246 |
'core:i/link' => 'fa-link',
|
|
|
247 |
'core:i/externallink' => 'fa-external-link',
|
|
|
248 |
'core:i/files' => 'fa-file',
|
|
|
249 |
'core:i/filter' => 'fa-filter',
|
|
|
250 |
'core:i/flagged' => 'fa-flag',
|
|
|
251 |
'core:i/folder' => 'fa-folder',
|
|
|
252 |
'core:i/grade_correct' => 'fa-check text-success',
|
|
|
253 |
'core:i/grade_incorrect' => 'fa-remove text-danger',
|
|
|
254 |
'core:i/grade_partiallycorrect' => 'fa-check-square',
|
|
|
255 |
'core:i/grades' => 'fa-table',
|
|
|
256 |
'core:i/grading' => 'fa-magic',
|
|
|
257 |
'core:i/gradingnotifications' => 'fa-bell-o',
|
|
|
258 |
'core:i/groupevent' => 'fa-group',
|
|
|
259 |
'core:i/group' => 'fa-users',
|
|
|
260 |
'core:i/home' => 'fa-home',
|
|
|
261 |
'core:i/hide' => 'fa-eye',
|
|
|
262 |
'core:i/hierarchylock' => 'fa-lock',
|
|
|
263 |
'core:i/import' => 'fa-level-up',
|
|
|
264 |
'core:i/incorrect' => 'fa-exclamation',
|
|
|
265 |
'core:i/info' => 'fa-info',
|
|
|
266 |
'core:i/invalid' => 'fa-times text-danger',
|
|
|
267 |
'core:i/item' => 'fa-circle',
|
|
|
268 |
'core:i/loading' => 'fa-circle-o-notch fa-spin fa-sm',
|
|
|
269 |
'core:i/loading_small' => 'fa-circle-o-notch fa-spin fa-sm',
|
|
|
270 |
'core:i/location' => 'fa-map-marker',
|
|
|
271 |
'core:i/lock' => 'fa-lock',
|
|
|
272 |
'core:i/log' => 'fa-list-alt',
|
|
|
273 |
'core:i/mahara_host' => 'fa-id-badge',
|
|
|
274 |
'core:i/manual_item' => 'fa-pencil-square-o',
|
|
|
275 |
'core:i/marked' => 'fa-circle',
|
|
|
276 |
'core:i/marker' => 'fa-circle-o',
|
|
|
277 |
'core:i/mean' => 'fa-calculator',
|
|
|
278 |
'core:i/menu' => 'fa-ellipsis-v',
|
|
|
279 |
'core:i/menubars' => 'fa-bars',
|
|
|
280 |
'core:i/messagecontentaudio' => 'fa-headphones',
|
|
|
281 |
'core:i/messagecontentimage' => 'fa-image',
|
|
|
282 |
'core:i/messagecontentvideo' => 'fa-film',
|
|
|
283 |
'core:i/messagecontentmultimediageneral' => 'fa-file-video-o',
|
|
|
284 |
'core:i/mnethost' => 'fa-external-link',
|
|
|
285 |
'core:i/moodle_host' => 'fa-graduation-cap',
|
|
|
286 |
'core:i/moremenu' => 'fa-ellipsis-h',
|
|
|
287 |
'core:i/move_2d' => 'fa-arrows',
|
|
|
288 |
'core:i/muted' => 'fa-microphone-slash',
|
|
|
289 |
'core:i/navigationitem' => 'fa-fw',
|
|
|
290 |
'core:i/ne_red_mark' => 'fa-remove',
|
|
|
291 |
'core:i/new' => 'fa-bolt',
|
|
|
292 |
'core:i/news' => 'fa-newspaper-o',
|
|
|
293 |
'core:i/next' => 'fa-chevron-right',
|
|
|
294 |
'core:i/nosubcat' => 'fa-plus-square-o',
|
|
|
295 |
'core:i/notifications' => 'fa-bell-o',
|
|
|
296 |
'core:i/open' => 'fa-folder-open',
|
|
|
297 |
'core:i/otherevent' => 'fa-calendar',
|
|
|
298 |
'core:i/outcomes' => 'fa-tasks',
|
|
|
299 |
'core:i/overriden_grade' => 'fa-edit',
|
|
|
300 |
'core:i/payment' => 'fa-money',
|
|
|
301 |
'core:i/permissionlock' => 'fa-lock',
|
|
|
302 |
'core:i/permissions' => 'fa-pencil-square-o',
|
|
|
303 |
'core:i/persona_sign_in_black' => 'fa-male',
|
|
|
304 |
'core:i/portfolio' => 'fa-id-badge',
|
|
|
305 |
'core:i/preview' => 'fa-search-plus',
|
|
|
306 |
'core:i/previous' => 'fa-chevron-left',
|
|
|
307 |
'core:i/privatefiles' => 'fa-file-o',
|
|
|
308 |
'core:i/progressbar' => 'fa-spinner fa-spin',
|
|
|
309 |
'core:i/publish' => 'fa-share',
|
|
|
310 |
'core:i/questions' => 'fa-question',
|
|
|
311 |
'core:i/reload' => 'fa-refresh',
|
|
|
312 |
'core:i/report' => 'fa-area-chart',
|
|
|
313 |
'core:i/repository' => 'fa-hdd-o',
|
|
|
314 |
'core:i/restore' => 'fa-level-up',
|
|
|
315 |
'core:i/return' => 'fa-arrow-left',
|
|
|
316 |
'core:i/risk_config' => 'fa-exclamation text-muted',
|
|
|
317 |
'core:i/risk_managetrust' => 'fa-exclamation-triangle text-warning',
|
|
|
318 |
'core:i/risk_personal' => 'fa-exclamation-circle text-info',
|
|
|
319 |
'core:i/risk_spam' => 'fa-exclamation text-primary',
|
|
|
320 |
'core:i/risk_xss' => 'fa-exclamation-triangle text-danger',
|
|
|
321 |
'core:i/role' => 'fa-user-md',
|
|
|
322 |
'core:i/rss' => 'fa-rss',
|
|
|
323 |
'core:i/rsssitelogo' => 'fa-graduation-cap',
|
|
|
324 |
'core:i/scales' => 'fa-balance-scale',
|
|
|
325 |
'core:i/scheduled' => 'fa-calendar-check-o',
|
|
|
326 |
'core:i/search' => 'fa-search',
|
|
|
327 |
'core:i/section' => 'fa-folder-o',
|
|
|
328 |
'core:i/sendmessage' => 'fa-paper-plane',
|
|
|
329 |
'core:i/settings' => 'fa-cog',
|
|
|
330 |
'core:i/share' => 'fa-share-square-o',
|
|
|
331 |
'core:i/show' => 'fa-eye-slash',
|
|
|
332 |
'core:i/siteevent' => 'fa-globe',
|
|
|
333 |
'core:i/star' => 'fa-star',
|
|
|
334 |
'core:i/star-o' => 'fa-star-o',
|
|
|
335 |
'core:i/star-rating' => 'fa-star',
|
|
|
336 |
'core:i/stats' => 'fa-line-chart',
|
|
|
337 |
'core:i/switch' => 'fa-exchange',
|
|
|
338 |
'core:i/switchrole' => 'fa-user-secret',
|
|
|
339 |
'core:i/trash' => 'fa-trash',
|
|
|
340 |
'core:i/twoway' => 'fa-arrows-h',
|
|
|
341 |
'core:i/unchecked' => 'fa-square-o',
|
|
|
342 |
'core:i/uncheckedcircle' => 'fa-circle-o',
|
|
|
343 |
'core:i/unflagged' => 'fa-flag-o',
|
|
|
344 |
'core:i/unlock' => 'fa-unlock',
|
|
|
345 |
'core:i/up' => 'fa-arrow-up',
|
|
|
346 |
'core:i/upload' => 'fa-upload',
|
|
|
347 |
'core:i/userevent' => 'fa-user',
|
|
|
348 |
'core:i/user' => 'fa-user',
|
|
|
349 |
'core:i/users' => 'fa-users',
|
|
|
350 |
'core:i/valid' => 'fa-check text-success',
|
|
|
351 |
'core:i/viewsection' => 'fa-pager',
|
|
|
352 |
'core:i/warning' => 'fa-exclamation text-warning',
|
|
|
353 |
'core:i/window_close' => 'fa-window-close',
|
|
|
354 |
'core:i/withsubcat' => 'fa-plus-square',
|
|
|
355 |
'core:i/language' => 'fa-language',
|
|
|
356 |
'core:m/USD' => 'fa-usd',
|
|
|
357 |
'core:t/addcontact' => 'fa-address-card',
|
|
|
358 |
'core:t/add' => 'fa-plus',
|
|
|
359 |
'core:t/angles-down' => 'fa-angles-down',
|
|
|
360 |
'core:t/angles-left' => 'fa-angles-left',
|
|
|
361 |
'core:t/angles-right' => 'fa-angles-right',
|
|
|
362 |
'core:t/angles-up' => 'fa-angles-up',
|
|
|
363 |
'core:t/approve' => 'fa-thumbs-up',
|
|
|
364 |
'core:t/assignroles' => 'fa-user-circle',
|
|
|
365 |
'core:t/award' => 'fa-trophy',
|
|
|
366 |
'core:t/backpack' => 'fa-shopping-bag',
|
|
|
367 |
'core:t/backup' => 'fa-arrow-circle-down',
|
|
|
368 |
'core:t/block' => 'fa-ban',
|
|
|
369 |
'core:t/block_to_dock_rtl' => 'fa-chevron-right',
|
|
|
370 |
'core:t/block_to_dock' => 'fa-chevron-left',
|
|
|
371 |
'core:t/blocks_drawer' => 'fa-chevron-left',
|
|
|
372 |
'core:t/blocks_drawer_rtl' => 'fa-chevron-right',
|
|
|
373 |
'core:t/calc_off' => 'fa-calculator', // TODO: Change to better icon once we have stacked icon support or more icons.
|
|
|
374 |
'core:t/calc' => 'fa-calculator',
|
|
|
375 |
'core:t/check' => 'fa-check',
|
|
|
376 |
'core:t/clipboard' => 'fa-clipboard',
|
|
|
377 |
'core:t/cohort' => 'fa-users',
|
|
|
378 |
'core:t/collapsed_empty_rtl' => 'fa-caret-square-o-left',
|
|
|
379 |
'core:t/collapsed_empty' => 'fa-caret-square-o-right',
|
|
|
380 |
'core:t/collapsed_rtl' => 'fa-caret-left',
|
|
|
381 |
'core:t/collapsed' => 'fa-caret-right',
|
|
|
382 |
'core:t/collapsedcaret' => 'fa-caret-right',
|
|
|
383 |
'core:t/collapsedchevron' => 'fa-chevron-right',
|
|
|
384 |
'core:t/collapsedchevron_rtl' => 'fa-chevron-left',
|
|
|
385 |
'core:t/collapsedchevron_up' => 'fa-chevron-up',
|
|
|
386 |
'core:t/completion_complete' => 'fa-circle',
|
|
|
387 |
'core:t/completion_fail' => 'fa-times',
|
|
|
388 |
'core:t/completion_incomplete' => 'fa-circle-thin',
|
|
|
389 |
'core:t/contextmenu' => 'fa-cog',
|
|
|
390 |
'core:t/copy' => 'fa-copy',
|
|
|
391 |
'core:t/delete' => 'fa-trash',
|
|
|
392 |
'core:t/dockclose' => 'fa-window-close',
|
|
|
393 |
'core:t/dock_to_block_rtl' => 'fa-chevron-right',
|
|
|
394 |
'core:t/dock_to_block' => 'fa-chevron-left',
|
|
|
395 |
'core:t/download' => 'fa-download',
|
|
|
396 |
'core:t/down' => 'fa-arrow-down',
|
|
|
397 |
'core:t/downlong' => 'fa-long-arrow-down',
|
|
|
398 |
'core:t/dropdown' => 'fa-cog',
|
|
|
399 |
'core:t/editinline' => 'fa-pencil',
|
|
|
400 |
'core:t/edit_menu' => 'fa-cog',
|
|
|
401 |
'core:t/editstring' => 'fa-pencil',
|
|
|
402 |
'core:t/edit' => 'fa-cog',
|
|
|
403 |
'core:t/emailno' => 'fa-ban',
|
|
|
404 |
'core:t/email' => 'fa-envelope-o',
|
|
|
405 |
'core:t/emptystar' => 'fa-star-o',
|
|
|
406 |
'core:t/enrolusers' => 'fa-user-plus',
|
|
|
407 |
'core:t/expanded' => 'fa-caret-down',
|
|
|
408 |
'core:t/expandedchevron' => 'fa-chevron-down',
|
|
|
409 |
'core:t/go' => 'fa-play',
|
|
|
410 |
'core:t/grades' => 'fa-table',
|
|
|
411 |
'core:t/groupn' => 'fa-user',
|
|
|
412 |
'core:t/groups' => 'fa-user-circle',
|
11 |
efrain |
413 |
'core:t/groupv' => 'fa-user-group',
|
1 |
efrain |
414 |
'core:t/hide' => 'fa-eye',
|
|
|
415 |
'core:t/index_drawer' => 'fa-list',
|
|
|
416 |
'core:t/left' => 'fa-arrow-left',
|
|
|
417 |
'core:t/less' => 'fa-caret-up',
|
|
|
418 |
'core:t/life-ring' => 'fa-life-ring',
|
|
|
419 |
'core:t/locked' => 'fa-lock',
|
|
|
420 |
'core:t/lock' => 'fa-unlock',
|
|
|
421 |
'core:t/locktime' => 'fa-lock',
|
|
|
422 |
'core:t/markasread' => 'fa-check',
|
|
|
423 |
'core:t/messages' => 'fa-comments',
|
|
|
424 |
'core:t/messages-o' => 'fa-comments-o',
|
|
|
425 |
'core:t/message' => 'fa-comment-o',
|
|
|
426 |
'core:t/more' => 'fa-caret-down',
|
|
|
427 |
'core:t/move' => 'fa-arrows-v',
|
|
|
428 |
'core:t/online' => 'fa-circle',
|
|
|
429 |
'core:t/passwordunmask-edit' => 'fa-pencil',
|
|
|
430 |
'core:t/passwordunmask-reveal' => 'fa-eye',
|
|
|
431 |
'core:t/play' => 'fa-play',
|
|
|
432 |
'core:t/portfolioadd' => 'fa-plus',
|
|
|
433 |
'core:t/preferences' => 'fa-wrench',
|
|
|
434 |
'core:t/preview' => 'fa-search-plus',
|
|
|
435 |
'core:t/print' => 'fa-print',
|
|
|
436 |
'core:t/removecontact' => 'fa-user-times',
|
|
|
437 |
'core:t/reload' => 'fa-refresh',
|
|
|
438 |
'core:t/reset' => 'fa-repeat',
|
|
|
439 |
'core:t/restore' => 'fa-arrow-circle-up',
|
|
|
440 |
'core:t/right' => 'fa-arrow-right',
|
|
|
441 |
'core:t/sendmessage' => 'fa-paper-plane',
|
|
|
442 |
'core:t/show' => 'fa-eye-slash',
|
|
|
443 |
'core:t/sort_by' => 'fa-sort-amount-asc',
|
|
|
444 |
'core:t/sort_asc' => 'fa-sort-asc',
|
|
|
445 |
'core:t/sort_desc' => 'fa-sort-desc',
|
|
|
446 |
'core:t/sort' => 'fa-sort',
|
|
|
447 |
'core:t/stealth' => 'fa-low-vision',
|
|
|
448 |
'core:t/stop' => 'fa-stop',
|
|
|
449 |
'core:t/switch_minus' => 'fa-minus',
|
|
|
450 |
'core:t/switch_plus' => 'fa-plus',
|
|
|
451 |
'core:t/switch_whole' => 'fa-square-o',
|
|
|
452 |
'core:t/tags' => 'fa-tags',
|
|
|
453 |
'core:t/unblock' => 'fa-commenting',
|
|
|
454 |
'core:t/unlocked' => 'fa-unlock-alt',
|
|
|
455 |
'core:t/unlock' => 'fa-lock',
|
|
|
456 |
'core:t/up' => 'fa-arrow-up',
|
|
|
457 |
'core:t/uplong' => 'fa-long-arrow-up',
|
|
|
458 |
'core:t/user' => 'fa-user',
|
|
|
459 |
'core:t/viewdetails' => 'fa-list',
|
|
|
460 |
];
|
|
|
461 |
}
|
|
|
462 |
|
|
|
463 |
/**
|
|
|
464 |
* Overridable function to get a mapping of all icons.
|
|
|
465 |
* Default is to do no mapping.
|
|
|
466 |
*/
|
|
|
467 |
public function get_icon_name_map() {
|
|
|
468 |
if ($this->map === []) {
|
|
|
469 |
$cache = \cache::make('core', 'fontawesomeiconmapping');
|
|
|
470 |
|
|
|
471 |
// Create different mapping keys for different icon system classes, there may be several different
|
|
|
472 |
// themes on the same site.
|
|
|
473 |
$mapkey = 'mapping_'.preg_replace('/[^a-zA-Z0-9_]/', '_', get_class($this));
|
|
|
474 |
$this->map = $cache->get($mapkey);
|
|
|
475 |
|
|
|
476 |
if (empty($this->map)) {
|
|
|
477 |
$this->map = $this->get_core_icon_map();
|
|
|
478 |
$callback = 'get_fontawesome_icon_map';
|
|
|
479 |
|
|
|
480 |
if ($pluginsfunction = get_plugins_with_function($callback)) {
|
|
|
481 |
foreach ($pluginsfunction as $plugintype => $plugins) {
|
|
|
482 |
foreach ($plugins as $pluginfunction) {
|
|
|
483 |
$pluginmap = $pluginfunction();
|
|
|
484 |
$this->map += $pluginmap;
|
|
|
485 |
}
|
|
|
486 |
}
|
|
|
487 |
}
|
|
|
488 |
$cache->set($mapkey, $this->map);
|
|
|
489 |
}
|
|
|
490 |
|
|
|
491 |
}
|
|
|
492 |
return $this->map;
|
|
|
493 |
}
|
|
|
494 |
|
|
|
495 |
|
|
|
496 |
public function get_amd_name() {
|
|
|
497 |
return 'core/icon_system_fontawesome';
|
|
|
498 |
}
|
|
|
499 |
|
|
|
500 |
public function render_pix_icon(renderer_base $output, pix_icon $icon) {
|
|
|
501 |
$subtype = 'pix_icon_fontawesome';
|
|
|
502 |
$subpix = new $subtype($icon);
|
|
|
503 |
|
|
|
504 |
$data = $subpix->export_for_template($output);
|
|
|
505 |
|
|
|
506 |
if (!$subpix->is_mapped()) {
|
|
|
507 |
$data['unmappedIcon'] = $icon->export_for_template($output);
|
|
|
508 |
}
|
|
|
509 |
if (isset($icon->attributes['aria-hidden'])) {
|
|
|
510 |
$data['aria-hidden'] = $icon->attributes['aria-hidden'];
|
|
|
511 |
}
|
|
|
512 |
|
|
|
513 |
// Flip question mark icon orientation when the `questioniconfollowlangdirection` lang config string is set to `yes`.
|
|
|
514 |
$isquestionicon = strpos($data['key'], 'fa-question') !== false;
|
|
|
515 |
if ($isquestionicon && right_to_left() && get_string('questioniconfollowlangdirection', 'langconfig') === 'yes') {
|
|
|
516 |
$data['extraclasses'] = "fa-flip-horizontal";
|
|
|
517 |
}
|
|
|
518 |
|
|
|
519 |
return $output->render_from_template('core/pix_icon_fontawesome', $data);
|
|
|
520 |
}
|
|
|
521 |
|
|
|
522 |
}
|