From 57019638f3b72c42d9b72cab6f060537edbee038 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 21 Jun 2021 18:43:34 +0200 Subject: Remove unused methods from Item class --- core/namespace/Item.php | 50 ------------------------------------------------- 1 file changed, 50 deletions(-) (limited to 'core/namespace/Item.php') diff --git a/core/namespace/Item.php b/core/namespace/Item.php index 0cd504b..92eb0e8 100644 --- a/core/namespace/Item.php +++ b/core/namespace/Item.php @@ -50,56 +50,6 @@ abstract class Item implements ItemInterface { return $this->Attribute->get('id'); } - #=============================================================================== - # Return pre-parsed content - #=============================================================================== - public function getBody(): string { - $content = preg_replace_callback('#\{(POST|PAGE|USER)\[([0-9]+)\]\}#', function($matches) { - $namespace = ucfirst(strtolower($matches[1])).'\\Factory'; - - try { - $Item = $namespace::build($matches[2]); - return Application::getEntityURL($Item); - } catch(Exception $Exception) { - return '{undefined}'; - } - }, $this->Attribute->get('body')); - - $content = preg_replace('#\{BASE\[\"([^"]+)\"\]\}#', \Application::getURL('$1'), $content); - $content = preg_replace('#\{FILE\[\"([^"]+)\"\]\}#', \Application::getFileURL('$1'), $content); - - return $content; - } - - #=============================================================================== - # Return parsed content - #=============================================================================== - public function getHTML(): string { - $item = "{$this->Reflection->getNamespaceName()}\\Item"; - - $Parsedown = new Parsedown(); - $Parsedown->setUrlsLinked(FALSE); - $content = $this->getBody(); - - if(\Application::get($item::CONFIGURATION.'.EMOTICONS') === TRUE) { - $content = parseUnicodeEmoticons($content); - $content = parseEmoticons($content); - } - - return $Parsedown->text($content); - } - - #=============================================================================== - # Return attached files - #=============================================================================== - public function getFiles(): array { - if(preg_match_all('#\!\[(.*)\][ ]?(?:\n[ ]*)?\((.*)(\s[\'"](.*)[\'"])?\)#U', $this->getBody(), $matches)) { - return array_map('htmlentities', $matches[2]); - } - - return []; - } - #=============================================================================== # Return parsed arguments #=============================================================================== -- cgit v1.2.3