aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--app/view/templates/homemenu.php11
-rw-r--r--assets/css/home.css3
-rw-r--r--composer.json2
7 files changed, 29 insertions, 12 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'],
diff --git a/app/view/templates/homemenu.php b/app/view/templates/homemenu.php
index 2dd486c..f81933f 100644
--- a/app/view/templates/homemenu.php
+++ b/app/view/templates/homemenu.php
@@ -41,9 +41,14 @@
</form>
</details>
- <span>
- <a href="">Render All</a>
- </span>
+ <details class="hidephone">
+ <summary>Actions</summary>
+ <form action="<?= $this->url('homerenderall') ?>" method="post">
+ Render all pages
+ </br>
+ <input type="submit" value="renderall">
+ </form>
+ </details>
</aside> \ No newline at end of file
diff --git a/assets/css/home.css b/assets/css/home.css
index d1d58e8..a953c47 100644
--- a/assets/css/home.css
+++ b/assets/css/home.css
@@ -27,7 +27,7 @@ aside.home {
aside.home details, aside.home span {
- width: 30%;
+ width: 100%;
}
@@ -111,7 +111,6 @@ tr:hover {
background-color: #7b97b9;
width: 100%;
padding: 3px 0.5%;
- border-bottom: solid 1px dimgrey;
}
#topbar form {
diff --git a/composer.json b/composer.json
index f607921..355d0c7 100644
--- a/composer.json
+++ b/composer.json
@@ -1,7 +1,7 @@
{
"name": "w-cms",
"description": "point'n think",
- "version": "1.4.5",
+ "version": "1.4.6",
"require": {
"michelf/php-markdown": "^1.8",
"league/plates": "3.*",