changing the font awesome icon of the 'send message'

changing the font awesome icon of the 'send message'

by Ava Taylor -
Number of replies: 1
hi

I'm tying to change the font awesome icon for sending messages.
I can see that the icon currently used is from:
lib/classes/output/icon_system_fontawesome.php, function named get_core_icon_map:
'core:i/sendmessage' => 'fa-paper-plane',

I've read the documentation here: https://docs.moodle.org/dev/Moodle_icons#Font_awesome_icons

but I'm not sure what I should put in the config.php file in my theme.
this is what I've tried:
function message_get_fontawesome_icon_map() {
    return [
        'core:i/sendmessage' => 'fa-folder-o',
    ];
}

it didn't work, it didn't change anything.
what am I doing wrong?

my installed Moodle version 3.9.6
Average of ratings: -
In reply to Ava Taylor

Re: changing the font awesome icon of the 'send message'

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
You have to extend 'icon_system_fontawesome.php' in your theme as a new class, then override the method 'get_core_icon_map', call the parent and then alter the returned 'map' to have your value for the icon, then return that changed '$map', then in the theme 'config.php', tell Moodle about your class, i.e. "$THEME->iconsystem = '\\theme_mytheme\\output\\icon_system_fontawesome';". If you want to see a slightly more complicated implementation that works along the same lines, then look at my Foundation theme.