aboutsummaryrefslogtreecommitdiff
path: root/app/class/Modelrender.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-01-18 16:35:20 +0100
committervincent-peugnet <v.peugnet@free.fr>2020-01-18 16:35:20 +0100
commit227a2a35d64db87d889f7a44101f11a117b8e06a (patch)
tree9854f830e728c66d165006ac1eaeae7958baf785 /app/class/Modelrender.php
parent57ef3a9a12738081b3ab26559076bfb2b43e75db (diff)
downloadwcms-227a2a35d64db87d889f7a44101f11a117b8e06a.tar.gz
wcms-227a2a35d64db87d889f7a44101f11a117b8e06a.zip
refactoring medialist
Diffstat (limited to 'app/class/Modelrender.php')
-rw-r--r--app/class/Modelrender.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/class/Modelrender.php b/app/class/Modelrender.php
index 778b327..593a420 100644
--- a/app/class/Modelrender.php
+++ b/app/class/Modelrender.php
@@ -437,16 +437,17 @@ class Modelrender extends Modelpage
*/
public function automedialist(string $text)
{
- preg_match_all('~\%MEDIA\?([a-zA-Z0-9\&=\-\/\%]*)\%~', $text, $out);
+ preg_match_all('~\%MEDIA\?([a-zA-Z0-9\[\]\&=\-\/\%]*)\%~', $text, $out);
foreach ($out[0] as $key => $match) {
- $matches[$key] = ['fullmatch' => $match, 'options' => $out[1][$key]];
+ $matches[$key] = ['fullmatch' => $match, 'filter' => $out[1][$key]];
}
if(isset($matches)) {
foreach ($matches as $match) {
$medialist = new Medialist($match);
- $text = str_replace($medialist->fullmatch(), $medialist->content(), $text);
+ $medialist->readfilter();
+ $text = str_replace($medialist->fullmatch(), $medialist->generatecontent(), $text);
}
}
return $text;