aboutsummaryrefslogtreecommitdiff
path: root/app/view
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-12-05 02:40:16 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-12-05 02:40:16 +0100
commitad3aed389f2e0d69802641f5a5b7c6add73f1ce5 (patch)
tree1e4abd614799be623a2ae696fa960d3fba93a5a6 /app/view
parentfc56b60be55b4340d647d2017fdeb24b81eb84b6 (diff)
downloadwcms-ad3aed389f2e0d69802641f5a5b7c6add73f1ce5.tar.gz
wcms-ad3aed389f2e0d69802641f5a5b7c6add73f1ce5.zip
templateoption
Diffstat (limited to 'app/view')
-rw-r--r--app/view/templates/admin.php12
-rw-r--r--app/view/templates/edit.php4
-rw-r--r--app/view/templates/editleftbar.php46
-rw-r--r--app/view/templates/editrightbar.php2
-rw-r--r--app/view/templates/home.php2
-rw-r--r--app/view/templates/layout.php7
6 files changed, 59 insertions, 14 deletions
diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php
index 7f94833..5edf262 100644
--- a/app/view/templates/admin.php
+++ b/app/view/templates/admin.php
@@ -73,6 +73,18 @@
<label for="globalcss">Edit global css that will apply to every pages</label>
<textarea name="globalcss" id="globalcss" cols="30" rows="10"><?= $globalcss ?></textarea>
+ <label for="defaultfavicon">Favicon</label>
+ <select name="defaultfavicon" id="defaultfavicon">
+ <option value="">--no favicon--</option>
+ <?php
+ foreach ($faviconlist as $favicon) {
+ ?>
+ <option value="<?= $favicon ?>" <?= Config::defaultfavicon() === $favicon ? 'selected' : '' ?>><?= $favicon ?></option>
+ <?php
+ }
+ ?>
+ </select>
+
<input type="submit" value="Update configuration">
</form>
diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php
index 18940ff..973317a 100644
--- a/app/view/templates/edit.php
+++ b/app/view/templates/edit.php
@@ -1,4 +1,4 @@
-<?php $this->layout('layout', ['title' => '✏ '.$art->title(), 'css' => $css . 'edit.css']) ?>
+<?php $this->layout('layout', ['title' => '✏ '.$art->title(), 'css' => $css . 'edit.css', 'favicon' => $art->favicon()]) ?>
@@ -18,7 +18,7 @@
<div id="workspace">
- <?php $this->insert('editleftbar', ['art' => $art, 'tablist' => $tablist, 'artlist' => $artlist, 'showleftpanel' => $showleftpanel]) ?>
+ <?php $this->insert('editleftbar', ['art' => $art, 'tablist' => $tablist, 'artlist' => $artlist, 'showleftpanel' => $showleftpanel, 'faviconlist' => $faviconlist]) ?>
<?php $this->insert('edittabs', ['tablist' => $tablist, 'opentab' => $art->interface(), 'templates' => $art->template()]) ?>
<?php $this->insert('editrightbar', ['art' => $art, 'artlist' => $artlist, 'showrightpanel' => $showrightpanel, 'templates' => $art->template(), 'tagartlist' => $tagartlist, 'lasteditedartlist' => $lasteditedartlist]) ?>
diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php
index 73468bf..09c13f9 100644
--- a/app/view/templates/editleftbar.php
+++ b/app/view/templates/editleftbar.php
@@ -25,9 +25,8 @@
</fieldset>
</details>
<details open>
- <summary>Advanced</summary>
+ <summary>Tempalte</summary>
<fieldset>
- <h3>Template options</h3>
<label for="templatebody">BODY template</label>
<select name="templatebody" id="templatebody">
<option value="" <?= empty($art->templatebody()) ? 'selected' : '' ?>>--no template--</option>
@@ -57,16 +56,20 @@
if(!empty($art->templatecss())) {
?>
<div class="subtemplate">
- <input type="checkbox" name="iquickcss" id="iquickcss">
+ <input type="checkbox" name="ireccursivecss" id="ireccursivecss" <?= $art->template()['cssreccursive'] === true ? 'checked' : '' ?>>
+ <label for="ireccursivecss">Reccursive template</label>
+ </div>
+ <div class="subtemplate">
+ <input type="checkbox" name="iquickcss" id="iquickcss" <?= $art->template()['cssquickcss'] === true ? 'checked' : '' ?>>
<label for="iquickcss">Quickcss</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="iexternalcss" id="iexternalcss">
+ <input type="checkbox" name="iexternalcss" id="iexternalcss" <?= $art->template()['externalcss'] === true ? 'checked' : '' ?>>
<label for="iexternalcss">External CSS</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="iicon" id="iicon">
- <label for="iicon">Page Icon</label>
+ <input type="checkbox" name="ifavicon" id="ifavicon" <?= $art->template()['cssfavicon'] === true ? 'checked' : '' ?>>
+ <label for="ifavicon">Favicon</label>
</div>
<?php
}
@@ -93,9 +96,34 @@
</fieldset>
</details>
- <details id="editcss" open>
- <summary>Quick CSS</summary>
-
+ <details id="advanced" open>
+ <summary>Advanced</summary>
+
+ <fieldset>
+
+ <?php
+
+ ?>
+
+ <label for="favicon">Favicon</label>
+ <select name="favicon" id="favicon">
+ <?php
+ if(!empty($art->templatecss()) && $art->template()['cssfavicon']) {
+ ?>
+ <option value="<?= $art->favicon() ?>">--using template favicon--</option>
+ <?php
+ } else {
+ echo '<option value="">--no favicon--</option>';
+ foreach ($faviconlist as $favicon) {
+ ?>
+ <option value="<?= $favicon ?>" <?= $art->favicon() === $favicon ? 'selected' : '' ?>><?= $favicon ?></option>
+ <?php
+ }
+ }
+ ?>
+ </select>
+ </fieldset>
+
</details>
<details>
<summary>Help</summary>
diff --git a/app/view/templates/editrightbar.php b/app/view/templates/editrightbar.php
index 26976e8..80a0b02 100644
--- a/app/view/templates/editrightbar.php
+++ b/app/view/templates/editrightbar.php
@@ -52,7 +52,7 @@
<ul>
<?php
foreach ($templates as $template => $id) {
- if(!empty($id)) {
+ if(!empty($id) && !is_bool($id)) {
?>
<li><?= $template ?> : <?= $id ?> <a href="<?= $this->uart('artedit', $id) ?>">✎</a></li>
<?php
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
index 24e378b..a83361d 100644
--- a/app/view/templates/home.php
+++ b/app/view/templates/home.php
@@ -1,4 +1,4 @@
-<?php $this->layout('layout', ['title' => 'home', 'css' => $css . 'home.css']) ?>
+<?php $this->layout('layout', ['title' => 'home', 'css' => $css . 'home.css', 'favicon' => '']) ?>
diff --git a/app/view/templates/layout.php b/app/view/templates/layout.php
index 4131350..e0b2e1c 100644
--- a/app/view/templates/layout.php
+++ b/app/view/templates/layout.php
@@ -4,7 +4,12 @@
<meta charset="utf8" />
<meta name="viewport" content="width=device-width" />
- <link rel="shortcut icon" href="./media/logo.png" type="image/x-icon">
+ <?php if(!empty($favicon)) {
+ ?>
+ <link rel="shortcut icon" href="<?= Model::faviconpath() . $favicon ?>" type="image/x-icon">
+ <?php } elseif(!empty(Config::defaultfavicon())) { ?>
+ <link rel="shortcut icon" href="<?= Model::faviconpath() . Config::defaultfavicon() ?>" type="image/x-icon">
+ <?php } ?>
<title><?= $title ?></title>
<link rel="stylesheet" href="<?= $css ?>">