From 2870bef5d11d01f90929a0a5e67ff605e68d9ded Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sun, 9 Sep 2018 21:40:56 +0200 Subject: Add function "getUnicodeEmoticons" This function returns an associative array with the UTF-8 encoded emoticon character as key and the corresponding explanation text as value. --- core/functions.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'core/functions.php') diff --git a/core/functions.php b/core/functions.php index ad63334..7bddb5b 100644 --- a/core/functions.php +++ b/core/functions.php @@ -192,6 +192,30 @@ function parseEmoticons($string): string { return $string; } +#=============================================================================== +# Get unicode emoticons with their corresponding explanation +#=============================================================================== +function getUnicodeEmoticons(): array { + $Language = Application::getLanguage(); + + return [ + html_entity_decode('😊') => $Language->text('emoticon_1F60A'), + html_entity_decode('😞') => $Language->text('emoticon_1F61E'), + html_entity_decode('😃') => $Language->text('emoticon_1F603'), + html_entity_decode('😛') => $Language->text('emoticon_1F61B'), + html_entity_decode('😲') => $Language->text('emoticon_1F632'), + html_entity_decode('😉') => $Language->text('emoticon_1F609'), + html_entity_decode('😢') => $Language->text('emoticon_1F622'), + html_entity_decode('😐') => $Language->text('emoticon_1F610'), + html_entity_decode('😵') => $Language->text('emoticon_1F635'), + html_entity_decode('😒') => $Language->text('emoticon_1F612'), + html_entity_decode('😎') => $Language->text('emoticon_1F60E'), + html_entity_decode('😟') => $Language->text('emoticon_1F61F'), + html_entity_decode('😂') => $Language->text('emoticon_1F602'), + html_entity_decode('😄') => $Language->text('emoticon_1F604'), + ]; +} + #=============================================================================== # Wrapper function for htmlspecialchars() #=============================================================================== -- cgit v1.2.3