From 489851d1e7b1d346ff316e7a6721de574322d7d6 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 19 Jul 2021 16:57:40 +0200 Subject: Replace option $ITEM.EMOTICONS with WRAP_EMOTICONS This commit adds the configuration option "WRAP_EMOTICONS" to supersede the configuration options "(CATEGORY|PAGE|POST|USER).EMOTICONS". If the value of "WRAP_EMOTICONS" evaluates to TRUE, the emoticons found in the content of an item will be wrapped into a "" element which gives the user a description of the emoticon in the "title" attribute. --- core/functions.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'core/functions.php') diff --git a/core/functions.php b/core/functions.php index b622601..ff52e0c 100644 --- a/core/functions.php +++ b/core/functions.php @@ -188,30 +188,12 @@ function parseContentTags(string $text): string { # Parse entity content #=============================================================================== function parseEntityContent(EntityInterface $Entity): string { - switch($class = get_class($Entity)) { - case 'ORM\Entities\Category': - $prefix = 'CATEGORY'; - break; - case 'ORM\Entities\Page': - $prefix = 'PAGE'; - break; - case 'ORM\Entities\Post': - $prefix = 'POST'; - break; - case 'ORM\Entities\User': - $prefix = 'USER'; - break; - default: - $error = 'Unknown config prefix for %s entities.'; - throw new Exception(sprintf($error, $class)); - } - $Parsedown = new Parsedown(); $Parsedown->setUrlsLinked(FALSE); $text = parseContentTags($Entity->get('body')); - if(Application::get("$prefix.EMOTICONS")) { + if(Application::get('WRAP_EMOTICONS')) { $text = parseUnicodeEmoticons($text); } -- cgit v1.2.3