mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 05:54:19 +02:00
MDL-65106 theme_classic: set custom navigationitem icon
This commit is contained in:
parent
2c0b08c5a7
commit
46ff4741a1
56
theme/classic/classes/output/icon_system_fontawesome.php
Normal file
56
theme/classic/classes/output/icon_system_fontawesome.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Overridden fontawesome icons.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2019 Moodle
|
||||
* @author Bas Brands <bas@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
namespace theme_classic\output;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Class overriding some of the Moodle default FontAwesome icons.
|
||||
*
|
||||
* @package theme_classic
|
||||
* @copyright 2019 Moodle
|
||||
* @author Bas Brands <bas@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class icon_system_fontawesome extends \core\output\icon_system_fontawesome {
|
||||
|
||||
/**
|
||||
* @var array $map Cached map of moodle icon names to font awesome icon names.
|
||||
*/
|
||||
private $map = [];
|
||||
|
||||
|
||||
/**
|
||||
* Change the core icon map
|
||||
* @return Array replaced icons.
|
||||
*/
|
||||
public function get_core_icon_map() {
|
||||
$iconmap = parent::get_core_icon_map();
|
||||
|
||||
$iconmap['core:i/navigationitem'] = 'fa-square';
|
||||
|
||||
return $iconmap;
|
||||
}
|
||||
}
|
@ -156,3 +156,4 @@ $THEME->scss = function($theme) {
|
||||
return theme_classic_get_main_scss_content($theme);
|
||||
};
|
||||
$THEME->usefallback = true;
|
||||
$THEME->iconsystem = '\\theme_classic\\output\\icon_system_fontawesome';
|
||||
|
Loading…
x
Reference in New Issue
Block a user