aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/frontend.php
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-09-25 21:18:18 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-09-25 21:28:55 +0200
commit378881378aab5454c84cb1fecbbcc675f64dc27f (patch)
treef8bbe239c2a87cc61bec05b987099e4401dd2693 /ratatoeskr/frontend.php
parent78c0350b3b7fc025ba565e19bfa195b68e95bb88 (diff)
downloadratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.tar.gz
ratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.tar.bz2
ratatoeskr-cms-378881378aab5454c84cb1fecbbcc675f64dc27f.zip
Refactor textprocessors
They are now managed by TextprocessorRepository and are instances of Textprocessor. This replaces the global $textprocessors variable.
Diffstat (limited to 'ratatoeskr/frontend.php')
-rw-r--r--ratatoeskr/frontend.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php
index eb62378..696d446 100644
--- a/ratatoeskr/frontend.php
+++ b/ratatoeskr/frontend.php
@@ -9,6 +9,7 @@
* See "ratatoeskr/licenses/ratatoeskr" for more information.
*/
+use r7r\cms\sys\Env;
use r7r\cms\sys\Esc;
require_once(dirname(__FILE__) . "/sys/utils.php");
@@ -103,6 +104,8 @@ function article_transform_ste($article, $lang)
{
global $rel_path_to_root;
+ $textprocessors = Env::getGlobal()->textprocessors();
+
$languages = [];
$a_section = $article->get_section();
foreach ($article->title as $language => $_) {
@@ -114,8 +117,8 @@ function article_transform_ste($article, $lang)
"urlname" => $article->urlname,
"fullurl" => Esc::esc("$rel_path_to_root/$lang/{$a_section->name}/{$article->urlname}"),
"title" => Esc::esc($article->title[$lang]->text),
- "text" => textprocessor_apply(str_replace("%root%", $rel_path_to_root, $article->text[$lang]->text), $article->text[$lang]->texttype),
- "excerpt" => textprocessor_apply(str_replace("%root%", $rel_path_to_root, $article->excerpt[$lang]->text), $article->excerpt[$lang]->texttype),
+ "text" => $textprocessors->mustApply(str_replace("%root%", $rel_path_to_root, $article->text[$lang]->text), $article->text[$lang]->texttype),
+ "excerpt" => $textprocessors->mustApply(str_replace("%root%", $rel_path_to_root, $article->excerpt[$lang]->text), $article->excerpt[$lang]->texttype),
"custom" => $article->custom,
"status" => $article->status,
"section" => section_transform_ste($a_section, $lang),