Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
emoticon_manager Class Reference

Provides core support for plugins that have to deal with emoticons (like HTML editor or emoticon filter). More...

Public Member Functions

 decode_stored_config ($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 ($selectable=false)
 Returns the currently enabled emoticons.
 
 prepare_renderable_emoticon (stdClass $emoticon, array $attributes=array())
 Converts emoticon object into renderable pix_emoticon object.
 

Protected Member Functions

 prepare_emoticon_object ($text, $imagename, $altidentifier=null, $altcomponent='core_pix', $imagecomponent='core')
 Helper method preparing the stdClass with the emoticon properties.
 

Detailed Description

Provides core support for plugins that have to deal with emoticons (like HTML editor or emoticon filter).

Whenever this manager mentiones 'emoticon object', the following data structure is expected: stdClass with properties text, imagename, imagecomponent, altidentifier and altcomponent

See also
admin_setting_emoticons
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ decode_stored_config()

emoticon_manager::decode_stored_config ( $encoded)

Decodes the string into an array of emoticon objects.

See also
self\encode_stored_config()
Parameters
string$encoded
Return values
array|null

◆ default_emoticons()

emoticon_manager::default_emoticons ( )

Returns default set of emoticons supported by Moodle.

Return values
arrayof sdtClasses

◆ encode_stored_config()

emoticon_manager::encode_stored_config ( array $emoticons)

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

See also
self\decode_stored_config()
Parameters
array$emoticonsarray of emtocion objects
Return values
string

◆ get_emoticons()

emoticon_manager::get_emoticons ( $selectable = false)

Returns the currently enabled emoticons.

Parameters
boolean$selectable- If true, only return emoticons that should be selectable from a list.
Return values
arrayof emoticon objects

◆ prepare_emoticon_object()

emoticon_manager::prepare_emoticon_object ( $text,
$imagename,
$altidentifier = null,
$altcomponent = 'core_pix',
$imagecomponent = 'core' )
protected

Helper method preparing the stdClass with the emoticon properties.

Parameters
string | array$textor array of strings
string$imagenameto be used by pix_emoticon
string$altidentifieralternative string identifier, null for no alt
string$altcomponentwhere the alternative string is defined
string$imagecomponentto be used by pix_emoticon
Return values
stdClass

◆ prepare_renderable_emoticon()

emoticon_manager::prepare_renderable_emoticon ( stdClass $emoticon,
array $attributes = array() )

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: