Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 403]

Contains class \core\output\icon_system

Copyright: 2016 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 164 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

icon_system:: (6 methods):
  __construct()
  instance()
  is_valid_system()
  get_icon_name_map()
  remap_icon_name()
  reset_caches()


Class: icon_system  - X-Ref

Class allowing different systems for mapping and rendering icons.

Possible icon styles are:
1. standard - image tags are generated which point to pix icons stored in a plugin pix folder.
2. fontawesome - font awesome markup is generated with the name of the icon mapped from the moodle icon name.
3. inline - inline tags are used for svg and png so no separate page requests are made (at the expense of page size).

__construct()   X-Ref
Constructor


instance($type = null)   X-Ref
Factory method

param: string $type Either a specific type, or null to get the default type.
return: \core\output\icon_system

is_valid_system($system)   X-Ref
Validate the theme config setting.

param: string $system
return: boolean

get_icon_name_map()   X-Ref
Overridable function to get a mapping of all icons.
Default is to do no mapping.


remap_icon_name($iconname, $component)   X-Ref
Overridable function to map the icon name to something else.
Default is to do no mapping. Map is cached in the singleton.


reset_caches()   X-Ref
Clears the instance cache, for use in unit tests