Commit 2b931458 authored by Damyon Wiese's avatar Damyon Wiese
Browse files

MDL-40759 plugins: Add font icon mapping to all plugins

parent e6bf10c7
......@@ -208,3 +208,12 @@ function tool_lp_coursemodule_edit_post_actions($data, $course) {
return $data;
}
/**
* Map icons for font-awesome themes.
*/
function tool_lp_get_fontawesome_icon_map() {
return [
'tool_lp:url' => 'fa-external-link'
];
}
......@@ -197,3 +197,12 @@ function tool_recyclebin_pre_course_category_delete($category) {
$categorybin = new \tool_recyclebin\category_bin($category->id);
$categorybin->delete_all_items();
}
/**
* Map icons for font-awesome themes.
*/
function tool_recyclebin_get_fontawesome_icon_map() {
return [
'tool_recyclebin:trash' => 'fa-trash'
];
}
......@@ -74,3 +74,14 @@ function tool_usertours_extend_navigation_user() {
function tool_usertours_before_footer() {
\tool_usertours\helper::bootstrap();
}
/**
* Map icons for font-awesome themes.
*/
function tool_usertours_get_fontawesome_icon_map() {
return [
'tool_usertours:t/export' => 'fa-download',
'tool_usertours:i/reload' => 'fa-refresh',
'tool_usertours:filler' => 'fa-spacer',
];
}
......@@ -480,3 +480,13 @@ class enrol_guest_plugin extends enrol_plugin {
}
/**
* Get icon mapping for font-awesome.
*/
function enrol_guest_get_fontawesome_icon_map() {
return [
'enrol_guest:withpassword' => 'fa-key',
'enrol_guest:withoutpassword' => 'fa-unlock-alt',
];
}
......@@ -730,3 +730,4 @@ class enrol_manual_plugin extends enrol_plugin {
}
}
......@@ -1053,3 +1053,13 @@ class enrol_self_plugin extends enrol_plugin {
return $contact;
}
}
/**
* Get icon mapping for font-awesome.
*/
function enrol_self_get_fontawesome_icon_map() {
return [
'enrol_self:withkey' => 'fa-key',
'enrol_self:withoutkey' => 'fa-unlock-alt',
];
}
......@@ -43,6 +43,9 @@ function atto_collapse_params_for_js($elementid, $options, $fpoptions) {
return $params;
}
/**
* Map icons for font-awesome themes.
*/
function atto_collapse_get_fontawesome_icon_map() {
return [
'atto_collapse:icon' => 'fa-level-down'
......
......@@ -670,3 +670,19 @@ function book_check_updates_since(cm_info $cm, $from, $filter = array()) {
return $updates;
}
/**
* Get icon mapping for font-awesome.
*/
function mod_book_get_fontawesome_icon_map() {
return [
'mod_book:chapter' => 'fa-bookmark-o',
'mod_book:nav_prev' => 'fa-arrow-left',
'mod_book:nav_prev_dis' => 'fa-angle-left',
'mod_book:nav-sep' => 'fa-minus',
'mod_book:add' => 'fa-plus',
'mod_book:nav_next' => 'fa-arrow-right',
'mod_book:nav_next_dis' => 'fa-angle-right',
'mod_book:nav_exit' => 'fa-arrow-up',
];
}
......@@ -161,7 +161,7 @@ if ($book->navstyle) {
if ($book->navstyle == 1) {
$chnavigation .= '<a title="' . $navprevtitle . '" class="bookprev" href="view.php?id=' .
$cm->id . '&amp;chapterid=' . $previd . '">' .
'<img src="' . $OUTPUT->pix_url($navprevicon, 'mod_book') . '" class="icon" alt="' . $navprevtitle . '"/></a>';
$OUTPUT->pix_icon($navprevicon, $navprevtitle, 'mod_book') . '</a>';
} else {
$chnavigation .= '<a title="' . $navprev . '" class="bookprev" href="view.php?id=' .
$cm->id . '&amp;chapterid=' . $previd . '">' .
......@@ -170,7 +170,7 @@ if ($book->navstyle) {
}
} else {
if ($book->navstyle == 1) {
$chnavigation .= '<img src="' . $OUTPUT->pix_url($navprevdisicon, 'mod_book') . '" class="icon" alt="" />';
$chnavigation .= $OUTPUT->pix_icon($navprevdisicon, '', 'mod_book');
}
}
if ($nextid) {
......@@ -178,7 +178,7 @@ if ($book->navstyle) {
if ($book->navstyle == 1) {
$chnavigation .= '<a title="' . $navnexttitle . '" class="booknext" href="view.php?id=' .
$cm->id . '&amp;chapterid='.$nextid.'">' .
'<img src="' . $OUTPUT->pix_url($navnexticon, 'mod_book').'" class="icon" alt="' . $navnexttitle . '" /></a>';
$OUTPUT->pix_icon($navnexticon, $navnexttitle, 'mod_book') . '</a>';
} else {
$chnavigation .= ' <a title="' . $navnext . '" class="booknext" href="view.php?id=' .
$cm->id . '&amp;chapterid='.$nextid.'">' .
......@@ -191,7 +191,7 @@ if ($book->navstyle) {
$returnurl = course_get_url($course, $sec);
if ($book->navstyle == 1) {
$chnavigation .= '<a title="' . $navexit . '" class="bookexit" href="'.$returnurl.'">' .
'<img src="' . $OUTPUT->pix_url('nav_exit', 'mod_book') . '" class="icon" alt="' . $navexit . '" /></a>';
$OUTPUT->pix_icon('nav_exit', $navexit, 'mod_book') . '</a>';
} else {
$chnavigation .= ' <a title="' . $navexit . '" class="bookexit" href="'.$returnurl.'">' .
'<span class="chaptername">' . $navexit . '&nbsp;' . $OUTPUT->uarrow() . '</span></a>';
......
......@@ -1167,3 +1167,13 @@ function choice_check_updates_since(cm_info $cm, $from, $filter = array()) {
return $updates;
}
/**
* Get icon mapping for font-awesome.
*/
function mod_choice_get_fontawesome_icon_map() {
return [
'mod_choice:row' => 'fa-info',
'mod_choice:column' => 'fa-columns',
];
}
......@@ -3316,3 +3316,13 @@ function feedback_can_view_analysis($feedback, $context, $courseid = false) {
return feedback_is_already_submitted($feedback->id, $courseid);
}
/**
* Get icon mapping for font-awesome.
*/
function mod_feedback_get_fontawesome_icon_map() {
return [
'mod_feedback:required' => 'fa-exclamation-circle',
'mod_feedback:notrequired' => 'fa-spacer',
];
}
......@@ -8079,7 +8079,10 @@ function forum_check_updates_since(cm_info $cm, $from, $filter = array()) {
return $updates;
}
function forum_get_fontawesome_icon_map() {
/**
* Get icon mapping for font-awesome.
*/
function mod_forum_get_fontawesome_icon_map() {
return [
'mod_forum:i/pinned' => 'fa-map-pin',
'mod_forum:t/selected' => 'fa-check',
......
......@@ -4154,3 +4154,12 @@ function glossary_check_updates_since(cm_info $cm, $from, $filter = array()) {
return $updates;
}
/**
* Get icon mapping for font-awesome.
*/
function forum_get_fontawesome_icon_map() {
return [
'mod_glossary:export' => 'fa-download'
];
}
......@@ -1480,3 +1480,12 @@ function lesson_update_media_file($lessonid, $context, $draftitemid) {
$DB->set_field('lesson', 'mediafile', '', array('id' => $lessonid));
}
}
/**
* Get icon mapping for font-awesome.
*/
function mod_lesson_get_fontawesome_icon_map() {
return [
'mod_lesson:e/copy' => 'fa-clone',
];
}
......@@ -587,3 +587,12 @@ function lti_check_updates_since(cm_info $cm, $from, $filter = array()) {
return $updates;
}
/**
* Get icon mapping for font-awesome.
*/
function mod_lti_get_fontawesome_icon_map() {
return [
'mod_lti:warning' => 'fa-exclamation',
];
}
......@@ -2051,3 +2051,12 @@ function quiz_check_updates_since(cm_info $cm, $from, $filter = array()) {
return $updates;
}
/**
* Get icon mapping for font-awesome.
*/
function mod_quiz_get_fontawesome_icon_map() {
return [
'mod_quiz:navflagged' => 'fa-flag',
];
}
......@@ -779,3 +779,12 @@ function wiki_check_updates_since(cm_info $cm, $from, $filter = array()) {
}
return $updates;
}
/**
* Get icon mapping for font-awesome.
*/
function mod_wiki_get_fontawesome_icon_map() {
return [
'mod_wiki:attachment' => 'fa-paperclip',
];
}
......@@ -1846,3 +1846,15 @@ function workshop_reset_userdata(stdClass $data) {
return $status;
}
/**
* Get icon mapping for font-awesome.
*/
function mod_workshop_get_fontawesome_icon_map() {
return [
'mod_workshop:userplan/task-info' => 'fa-info',
'mod_workshop:userplan/task-todo' => 'fa-square-o',
'mod_workshop:userplan/task-done' => 'fa-check',
'mod_workshop:userplan/task-fail' => 'fa-remove',
];
}
......@@ -41,3 +41,13 @@ function qtype_ddmarker_pluginfile($course, $cm, $context, $filearea, $args, $fo
require_once($CFG->libdir . '/questionlib.php');
question_pluginfile($course, $context, 'qtype_ddmarker', $filearea, $args, $forcedownload, $options);
}
/**
* Get icon mapping for font-awesome.
*/
function qtype_ddmarker_get_fontawesome_icon_map() {
return [
'qtype_ddmarker:crosshairs' => 'fa-crosshairs',
'qtype_ddmarker:grid' => 'fa-th',
];
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment