Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core_course\output\activity_icon Class Reference
Inheritance diagram for core_course\output\activity_icon:
core\output\renderable core\output\templatable

Public Member Functions

 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template.
 
 get_colourize ()
 Get the colourize icon value.
 
 get_extra_classes ()
 Get the extra classes.
 
 get_icon_classes (renderer_base $output)
 Get the icon classes.
 
 get_icon_size ()
 Get the icon size.
 
 get_icon_url (renderer_base $output)
 Get the icon URL.
 
 get_purpose ()
 Get the activity purpose.
 
 get_title ()
 Get the title text.
 
 is_branded ()
 Check if the module is branded.
 
 set_colourize (bool $colourize)
 Set the colourize icon value.
 
 set_extra_classes (string $extraclasses)
 Set the extra classes.
 
 set_icon_size (iconsize $iconsize)
 Set the icon size.
 
 set_title (string $title)
 Set the title.
 

Static Public Member Functions

static from_cm_info (cm_info $cm)
 Create an activity icon from a cm_info object.
 
static from_modname (string $modname)
 Create an activity icon from a module name.
 

Protected Member Functions

 __construct (protected string string $modname,)
 Constructor.
 

Protected Attributes

bool bool $colourize = true
 Determine if the icon must be colored or not.
 
string string $extraclasses = ''
 Extra container classes.
 
iconsize iconsize $iconsize = iconsize::UNDEFINED
 set the icon size
 
url url $iconurl
 The icon URL.
 
bool bool $isbranded
 is branded
 
string string $purpose
 The module purpose.
 
string string $title = ''
 optional text title
 

Constructor & Destructor Documentation

◆ __construct()

core_course\output\activity_icon::__construct ( protected string string $modname)
protected

Constructor.

Parameters
string$modnamethe module name
Parameters
$modnamethe module name

Member Function Documentation

◆ export_for_template()

core_course\output\activity_icon::export_for_template ( renderer_base $output)

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implements core\output\templatable.

◆ from_cm_info()

static core_course\output\activity_icon::from_cm_info ( cm_info $cm)
static

Create an activity icon from a cm_info object.

Parameters
cm_info$cm
Return values
self

◆ from_modname()

static core_course\output\activity_icon::from_modname ( string $modname)
static

Create an activity icon from a module name.

Parameters
string$modname
Return values
self

◆ get_colourize()

core_course\output\activity_icon::get_colourize ( )

Get the colourize icon value.

Return values
bool

◆ get_extra_classes()

core_course\output\activity_icon::get_extra_classes ( )

Get the extra classes.

Return values
string

◆ get_icon_classes()

core_course\output\activity_icon::get_icon_classes ( renderer_base $output)

Get the icon classes.

Parameters
renderer_base$output
Return values
string

◆ get_icon_size()

core_course\output\activity_icon::get_icon_size ( )

Get the icon size.

Return values
iconsize

◆ get_icon_url()

core_course\output\activity_icon::get_icon_url ( renderer_base $output)

Get the icon URL.

Parameters
renderer_base$output
Return values
url

◆ get_purpose()

core_course\output\activity_icon::get_purpose ( )

Get the activity purpose.

Return values
string

◆ get_title()

core_course\output\activity_icon::get_title ( )

Get the title text.

Return values
string

◆ is_branded()

core_course\output\activity_icon::is_branded ( )

Check if the module is branded.

Return values
bool

◆ set_colourize()

core_course\output\activity_icon::set_colourize ( bool $colourize)

Set the colourize icon value.

Parameters
bool$colourize
Return values
self

◆ set_extra_classes()

core_course\output\activity_icon::set_extra_classes ( string $extraclasses)

Set the extra classes.

Parameters
string$extraclasses
Return values
self

◆ set_icon_size()

core_course\output\activity_icon::set_icon_size ( iconsize $iconsize)

Set the icon size.

Parameters
iconsize$iconsize
Return values
self

◆ set_title()

core_course\output\activity_icon::set_title ( string $title)

Set the title.

Parameters
string$title
Return values
self

The documentation for this class was generated from the following file: