aboutsummaryrefslogtreecommitdiff
path: root/app/class/Modelrender.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-04-28 20:18:17 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-04-28 20:24:52 +0200
commit9090550d241f9f7b3246b24bfd323bd988add749 (patch)
tree2c2de66510533da53848dd876a9ab392471b38b8 /app/class/Modelrender.php
parent98514a4e0037aa0879e45bbad660aeda8837c624 (diff)
downloadwcms-9090550d241f9f7b3246b24bfd323bd988add749.tar.gz
wcms-9090550d241f9f7b3246b24bfd323bd988add749.zip
listen to brother Stan and clean some things
Diffstat (limited to 'app/class/Modelrender.php')
-rw-r--r--app/class/Modelrender.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/class/Modelrender.php b/app/class/Modelrender.php
index 4722057..fd8531a 100644
--- a/app/class/Modelrender.php
+++ b/app/class/Modelrender.php
@@ -17,8 +17,6 @@ class Modelrender extends Modelpage
protected $internallinkblank = '';
protected $externallinkblank = '';
- public const RENDER_VERBOSE = 1;
-
public function __construct(\AltoRouter $router)
{
parent::__construct();
@@ -162,7 +160,7 @@ class Modelrender extends Modelpage
if ($source !== $this->page->id()) {
$subcontent = $this->getpageelement($source, $type);
if ($subcontent !== false) {
- if (empty($subcontent && self::RENDER_VERBOSE > 0)) {
+ if (empty($subcontent)) {
$message = 'The ' . strtoupper($type) . ' from page "' . $source . '" is currently empty !';
$subcontent = "\n<!-- ' . $message . ' -->\n";
}
@@ -216,12 +214,12 @@ class Modelrender extends Modelpage
public function writetemplates()
{
- if (array_key_exists('css', $this->page->template('array'))) {
- $tempaltecsspage = $this->get($this->page->template('array')['css']);
+ if (array_key_exists('css', $this->page->template())) {
+ $tempaltecsspage = $this->get($this->page->template()['css']);
file_put_contents(Model::RENDER_DIR . $tempaltecsspage->id() . '.css', $tempaltecsspage->css());
}
- if (array_key_exists('javascript', $this->page->template('array'))) {
- $templatejspage = $this->get($this->page->template('array')['javascript']);
+ if (array_key_exists('javascript', $this->page->template())) {
+ $templatejspage = $this->get($this->page->template()['javascript']);
file_put_contents(Model::RENDER_DIR . $templatejspage->id() . '.js', $templatejspage->javascript());
}
}
@@ -547,7 +545,7 @@ class Modelrender extends Modelpage
if (!empty($matches)) {
foreach ($matches as $match) {
- $medialist = new Medialist($match);
+ $medialist = new Mediaopt($match);
$medialist->readoptions();
$text = str_replace($medialist->fullmatch(), $medialist->generatecontent(), $text);
}