aboutsummaryrefslogtreecommitdiff
path: root/app/class
diff options
context:
space:
mode:
Diffstat (limited to 'app/class')
-rw-r--r--app/class/controllerhome.php14
-rw-r--r--app/class/element.php6
-rw-r--r--app/class/modelrender.php4
-rw-r--r--app/class/routes.php1
4 files changed, 19 insertions, 6 deletions
diff --git a/app/class/controllerhome.php b/app/class/controllerhome.php
index 5a6d839..afbde7a 100644
--- a/app/class/controllerhome.php
+++ b/app/class/controllerhome.php
@@ -1,6 +1,6 @@
<?php
-class Controllerhome extends Controller
+class Controllerhome extends Controllerart
{
/** @var Modelhome */
protected $modelhome;
@@ -78,6 +78,18 @@ class Controllerhome extends Controller
}
}
+ public function renderall()
+ {
+ if($this->user->iseditor()) {
+ $pagelist = $this->modelhome->getlister();
+ foreach ($pagelist as $page) {
+ $this->renderart($page);
+ $this->artmanager->update($page);
+ }
+ }
+ $this->routedirect('home');
+ }
+
diff --git a/app/class/element.php b/app/class/element.php
index 1a801e4..824a0b6 100644
--- a/app/class/element.php
+++ b/app/class/element.php
@@ -72,18 +72,18 @@ class Element
$value = $optionmatch[3];
} else {
$read = '<h2>Rendering error :</h2><p>Paramaters must have a value like : <strong><code>/' . $key . '=__value__</code></strong> for parameter : <strong><code>' . $key . '</code></strong></p>';
- throw new Exception($read);
+ //throw new Exception($read);
}
$method = 'set' . $key;
if (in_array($key, self::OPTIONS)) {
if (!$this->$method($value)) {
$read = '<h2>Rendering error :</h2><p>Invalid value input : <strong><code>' . $value . '</code></strong> for parameter : <strong><code>' . $key . '</code></strong></p>';
- throw new Exception($read);
+ //throw new Exception($read);
}
} else {
$read = '<h2>Rendering error :</h2><p>Parameter name : <strong><code>' . $optionmatch[1] . '</code></strong> does not exist<p>';
- throw new Exception($read);
+ //throw new Exception($read);
}
}
}
diff --git a/app/class/modelrender.php b/app/class/modelrender.php
index 3d8f25f..3736888 100644
--- a/app/class/modelrender.php
+++ b/app/class/modelrender.php
@@ -127,7 +127,7 @@ class Modelrender extends Modelart
}
} else {
$read = '<h2>Rendering error :</h2><p>The page <strong><code>' . $source . '</code></strong>, called in <strong><code>'. $element->fullmatch() . '</code></strong>, does not exist yet.</p>';
- throw new Exception($read);
+ //throw new Exception($read);
}
} else {
@@ -298,7 +298,7 @@ class Modelrender extends Modelart
{
$text = preg_replace('%(src|href)="([\w-_]+(\/([\w-_])+)*\.[a-z0-9]{1,5})"%', '$1="' . Model::mediapath() . '$2" target="_blank" class="media"', $text);
if (!is_string($text)) {
- throw new Exception('Rendering error -> media module');
+ //throw new Exception('Rendering error -> media module');
}
return $text;
}
diff --git a/app/class/routes.php b/app/class/routes.php
index 16aede2..c0b686b 100644
--- a/app/class/routes.php
+++ b/app/class/routes.php
@@ -17,6 +17,7 @@ class Routes
['GET', '/', 'Controllerhome#desktop', 'home'],
['POST', '/', 'Controllerhome#desktop', 'homequery'],
['POST', '/columns', 'Controllerhome#columns', 'homecolumns'],
+ ['POST', '/renderall', 'Controllerhome#renderall', 'homerenderall'],
['POST', '/upload', 'Controllerart#upload', 'artupload'],
['POST', '/!co', 'Controllerconnect#log', 'log'],
['GET', '/!co', 'Controllerconnect#connect', 'connect'],