/**
* Returns the currently enabled emoticons
*
+ * @param boolean $selectable - If true, only return emoticons that should be selectable from a list.
* @return array of emoticon objects
*/
- public function get_emoticons() {
+ public function get_emoticons($selectable = false) {
global $CFG;
+ $notselectable = ['martin', 'egg'];
if (empty($CFG->emoticons)) {
return array();
debugging('Invalid format of emoticons setting, please resave the emoticons settings form', DEBUG_NORMAL);
return array();
}
+ if ($selectable) {
+ foreach ($emoticons as $index => $emote) {
+ if (in_array($emote->altidentifier, $notselectable)) {
+ // Skip this one.
+ unset($emoticons[$index]);
+ }
+ }
+ }
return $emoticons;
}