diff options
author | Thomas Lange <code@nerdmind.de> | 2021-06-21 18:43:34 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-06-21 18:43:34 +0200 |
commit | 57019638f3b72c42d9b72cab6f060537edbee038 (patch) | |
tree | d8398b93dfca8da852a01470a6431927fbefb360 /core/namespace | |
parent | 93e84ae4bcf58ace1f714e248a7bc2067f784467 (diff) | |
download | blog-57019638f3b72c42d9b72cab6f060537edbee038.tar.gz blog-57019638f3b72c42d9b72cab6f060537edbee038.tar.xz blog-57019638f3b72c42d9b72cab6f060537edbee038.zip |
Remove unused methods from Item class
Diffstat (limited to 'core/namespace')
-rw-r--r-- | core/namespace/Item.php | 50 |
1 files changed, 0 insertions, 50 deletions
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 @@ -51,56 +51,6 @@ abstract class Item implements ItemInterface { } #=============================================================================== - # 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 #=============================================================================== public function getArguments(): array { |