Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
core\emoticon_manager Class Reference

Public Member Functions

 decode_stored_config (string $encoded,)
 Decodes the string into an array of emoticon objects.
 
 default_emoticons ()
 Returns default set of emoticons supported by Moodle.
 
 encode_stored_config (array $emoticons,)
 Encodes the array of emoticon objects into a string storable in config table.
 
 get_emoticons (bool $selectable=false,)
 Returns the currently enabled emoticons.
 
 prepare_renderable_emoticon (stdClass $emoticon, array $attributes=[],)
 Converts emoticon object into renderable pix_emoticon object.
 

Protected Member Functions

 prepare_emoticon_object (string|array $text, string $imagename, ?string $altidentifier=null, string $altcomponent='core_pix', string $imagecomponent='core',)
 Helper method preparing an emoticon object.
 

Member Function Documentation

◆ decode_stored_config()

core\emoticon_manager::decode_stored_config ( string $encoded)

Decodes the string into an array of emoticon objects.

Parameters
string$encoded
Return values
?array

◆ default_emoticons()

core\emoticon_manager::default_emoticons ( )

Returns default set of emoticons supported by Moodle.

Return values
stdClass[]array of emoticon objects

◆ encode_stored_config()

core\emoticon_manager::encode_stored_config ( array $emoticons)

Encodes the array of emoticon objects into a string storable in config table.

Parameters
stdClass[]$emoticonsarray of emoticon objects
Return values
string

◆ get_emoticons()

core\emoticon_manager::get_emoticons ( bool $selectable = false)

Returns the currently enabled emoticons.

Parameters
bool$selectableIf true, only return emoticons that should be selectable from a list
Return values
stdClass[]array of emoticon objects

◆ prepare_emoticon_object()

core\emoticon_manager::prepare_emoticon_object ( string|array $text,
string $imagename,
?string $altidentifier = null,
string $altcomponent = 'core_pix',
string $imagecomponent = 'core' )
protected

Helper method preparing an emoticon object.

Parameters
string | string[]$text
string$imagenameto be used by {
See also
pix_emoticon}
Parameters
?string$altidentifieralternative string identifier, null for no alt
string$altcomponentwhere the alternative string is defined
string$imagecomponentto be used by {
See also
pix_emoticon}
Return values
stdClass

◆ prepare_renderable_emoticon()

core\emoticon_manager::prepare_renderable_emoticon ( stdClass $emoticon,
array $attributes = [] )

Converts emoticon object into renderable pix_emoticon object.

Parameters
stdClass$emoticonemoticon object
array$attributesexplicit HTML attributes to set
Return values
pix_emoticon

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