aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-12-13 00:43:47 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-12-13 00:43:47 +0100
commitfbe5d2beb2bcc7035edc19eb0343f0ee662ba5af (patch)
treef66188b95d3ad1dc0cbdaa99334acddb8d9b84a0 /app/view/templates
parent0842a9b17c0b25e2f1f5eca9f15e79cfb293b4a1 (diff)
downloadwcms-fbe5d2beb2bcc7035edc19eb0343f0ee662ba5af.tar.gz
wcms-fbe5d2beb2bcc7035edc19eb0343f0ee662ba5af.zip
templateoptions
Diffstat (limited to 'app/view/templates')
-rw-r--r--app/view/templates/admin.php4
-rw-r--r--app/view/templates/edit.php4
-rw-r--r--app/view/templates/edithelp.php2
-rw-r--r--app/view/templates/editleftbar.php111
-rw-r--r--app/view/templates/font.php4
-rw-r--r--app/view/templates/home.php4
-rw-r--r--app/view/templates/info.php16
-rw-r--r--app/view/templates/media.php8
8 files changed, 104 insertions, 49 deletions
diff --git a/app/view/templates/admin.php b/app/view/templates/admin.php
index 8de9bb1..66c7a33 100644
--- a/app/view/templates/admin.php
+++ b/app/view/templates/admin.php
@@ -8,7 +8,7 @@
<?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'admin']) ?>
-<section class="admin">
+<main class="admin">
<h1>Administration</h1>
@@ -94,7 +94,7 @@
-</section>
+</main>
</body>
<?php $this->stop('page') ?> \ No newline at end of file
diff --git a/app/view/templates/edit.php b/app/view/templates/edit.php
index 4b2fa77..32de517 100644
--- a/app/view/templates/edit.php
+++ b/app/view/templates/edit.php
@@ -8,7 +8,7 @@
<style>.tabs textarea{font-size: <?= Config::fontsize() ?>px}</style>
<body>
-<section class="editor">
+<main class="editor">
<!-- <?php $this->insert('navart', ['user' => $user, 'art' => $art, 'artexist' => $artexist]) ?> -->
@@ -26,7 +26,7 @@
</form>
-</section>
+</main>
</body>
<?php $this->stop('page') ?> \ No newline at end of file
diff --git a/app/view/templates/edithelp.php b/app/view/templates/edithelp.php
index fee94c7..d01f3aa 100644
--- a/app/view/templates/edithelp.php
+++ b/app/view/templates/edithelp.php
@@ -5,7 +5,7 @@
<pre><span class="i">ALT + X</span> : update</pre>
<pre><span class="i">ALT + C</span> : display</pre>
<h3>Markdown</h3>
- <p>The html section use <a href="https://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown encoding</a>. Actualy, W is using Michel Fortin's <a href="https://michelf.ca/projects/php-markdown/extra/" target="_blank">Markdown Extra</a>.</p>
+ <p>The html main use <a href="https://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown encoding</a>. Actualy, W is using Michel Fortin's <a href="https://michelf.ca/projects/php-markdown/extra/" target="_blank">Markdown Extra</a>.</p>
<h3>Links</h3>
<pre>[text](=<span class="i">article_id</span>)</pre>
<p>where article_id is the article's id you want to point to.</p>
diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php
index ff08bfc..fd39ba7 100644
--- a/app/view/templates/editleftbar.php
+++ b/app/view/templates/editleftbar.php
@@ -22,9 +22,38 @@
<input type="date" name="pdate" value="<?= $art->date('pdate') ?>" id="date">
<label for="time">Time</label>
<input type="time" name="ptime" value="<?= $art->date('ptime') ?>" id="time">
+
+ <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 open>
+
+
+
+
+
+
+
+ <details <?= !empty($art->templatebody()) || !empty($art->templatecss()) || !empty($art->templatejavascript()) ? 'open' : '' ?>>
<summary>Tempalte</summary>
<fieldset>
<label for="templatebody">BODY template</label>
@@ -35,7 +64,7 @@
?>
<option value="<?= $template ?>" <?= $art->templatebody() === $template ? 'selected' : '' ?>><?= $template ?></option>
<?php
- }
+ }
?>
</select>
@@ -55,25 +84,32 @@
<?php
if(!empty($art->templatecss())) {
?>
+
<div class="subtemplate">
- <input type="checkbox" name="templateoptions['reccursivecss']" id="oreccursivecss" <?= $art->template()['cssreccursive'] === true ? 'checked' : '' ?>>
+ <input type="checkbox" name="templateoptions[]" id="oreccursivecss" value="reccursivecss" <?= in_array('reccursivecss', $art->templateoptions()) ? 'checked' : '' ?>>
<label for="oreccursivecss">Reccursive template</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="templateoptions['quickcss']" id="oquickcss" <?= $art->template()['cssquickcss'] === true ? 'checked' : '' ?>>
+ <input type="checkbox" name="templateoptions[]" id="oquickcss" value="quickcss" <?= in_array('quickcss', $art->templateoptions()) ? 'checked' : '' ?>>
<label for="oquickcss">Quickcss</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="templateoptions['externalcss']" id="oexternalcss" <?= $art->template()['externalcss'] === true ? 'checked' : '' ?>>
- <label for="pexternalcss">External CSS</label>
+ <input type="checkbox" name="templateoptions[]" id="oexternalcss" value="externalcss" <?= in_array('externalcss', $art->templateoptions()) ? 'checked' : '' ?>>
+ <label for="oexternalcss">External CSS</label>
</div>
<div class="subtemplate">
- <input type="checkbox" name="templateoptions['favicon']" id="ofavicon" <?= $art->template()['cssfavicon'] === true ? 'checked' : '' ?>>
+ <input type="checkbox" name="templateoptions[]" id="ofavicon" value="favicon" <?= in_array('favicon', $art->templateoptions()) ? 'checked' : '' ?>>
<label for="ofavicon">Favicon</label>
</div>
<?php
+ } else {
+ foreach($art->templateoptions() as $option) {
+ if($option != 'externalsavascript') {
+ echo '<input type="hidden" name="templateoptions[]" value="'.$option.'">';
+ }
+ }
}
-
+
?>
@@ -88,41 +124,60 @@
}
?>
</select>
+
+
+ <?php
+ if(!empty($art->templatejavascript())) {
+ ?>
<div class="subtemplate">
- <input type="checkbox" name="iexternaljs" id="iexternaljs">
- <label for="iexternaljs">external js</label>
+ <input type="checkbox" name="templateoptions[]" value="externaljavascript" id="oexternaljs" <?= in_array('externaljavascript', $art->templateoptions()) ? 'checked' : '' ?>>
+ <label for="oexternaljs">external js</label>
</div>
+ <?php } else {
+ if(in_array('externaljavascript', $art->templateoptions())) {
+ echo '<input type="hidden" name="templateoptions[]" value="externaljavascript">';
+ }
+
+ } ?>
+
</fieldset>
</details>
- <details id="advanced" open>
+ <details id="advanced" <?= !empty($art->externalcss()) || !empty($art->externalscript()) ? 'open' : '' ?>>
<summary>Advanced</summary>
- <fieldset>
- <?php
+
+
+ <fieldset id="external">
+ <label for="externalcss">External CSS</label>
+ <input type="text" name="externalcss[]" id="externalcss" placeholder="add external adress">
+ <?php
+ foreach ($art->externalcss() as $css) {
+ ?>
+ <div class="checkexternal">
+ <input type="checkbox" name="externalcss[]" id="<?= $css ?>" value="<?= $css ?>" checked>
+ <label for="<?= $css ?>" title="<?= $css ?>"><?= $css ?></label>
+ </div>
+ <?php
+ }
?>
- <label for="favicon">Favicon</label>
- <select name="favicon" id="favicon">
+ <label for="externalscript">External script</label>
+ <input type="text" name="externalscript[]" id="externalscript" placeholder="add external adress">
<?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
+ foreach ($art->externalscript() as $script) {
+ ?>
+ <div class="checkexternal">
+ <input type="checkbox" name="externalscript[]" id="<?= $script ?>" value="<?= $script ?>" checked>
+ <label for="<?= $script ?>" title="<?= $script ?>"><?= $script ?></label>
+ </div>
+ <?php
}
- }
?>
- </select>
- </fieldset>
+ </fieldset>
</details>
<details>
diff --git a/app/view/templates/font.php b/app/view/templates/font.php
index 90614a9..3de0dce 100644
--- a/app/view/templates/font.php
+++ b/app/view/templates/font.php
@@ -8,7 +8,7 @@
<?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'font']) ?>
-<section class="font">
+<main class="font">
<h1>Fonts</h1>
@@ -55,7 +55,7 @@ foreach ($fontlist as $font ) {
?>
</table>
-</section>
+</main>
</body>
<?php $this->stop('page') ?> \ No newline at end of file
diff --git a/app/view/templates/home.php b/app/view/templates/home.php
index 9aa3d13..a69882d 100644
--- a/app/view/templates/home.php
+++ b/app/view/templates/home.php
@@ -12,7 +12,7 @@
<?php if($user->iseditor()) { ?>
-<section class="home">
+<main class="home">
@@ -102,7 +102,7 @@
</form>
</div>
</div>
-</section>
+</main>
<?php } ?>
diff --git a/app/view/templates/info.php b/app/view/templates/info.php
index 4634995..4da3819 100644
--- a/app/view/templates/info.php
+++ b/app/view/templates/info.php
@@ -8,7 +8,7 @@
<?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'info']) ?>
-<section class="info">
+<main class="info">
<h1>Info</h1>
@@ -138,7 +138,7 @@
<li>header</li>
<li>nav</li>
<li>aside</li>
-<li>section</li>
+<li>main</li>
<li>footer</li>
</ul>
@@ -267,7 +267,7 @@ You can use any of them, only one or all at the same time, as you prefer.
<p>As it is too long adding all media of a folder one by one, you can just print the content of an entire folder using this method.</p>
<blockquote>
-%MEDIA:<i>__repository__</i>
+%MEDIA:<i>__directory__</i>
</blockquote>
<p>Just point to the good directory inside the media folder. This will output html list, creating image elements, audio players, video players, or just basic link, depending on the media type.</p>
@@ -295,7 +295,7 @@ You can use any of them, only one or all at the same time, as you prefer.
%ASIDE%
</br>
</br>
-%SECTION%
+%MAIN%
</blockquote>
<p>Will output :</p>
@@ -309,12 +309,12 @@ __the content of your aside__
&lt;/aside&gt;
</br>
</br>
-&lt;section class="<i>page_id</i>"&gt;
+&lt;main class="<i>page_id</i>"&gt;
</br>
-__the content of your section__
+__the content of your main__
</br>
-&lt;/section&gt;
+&lt;/main&gt;
</blockquote>
@@ -357,7 +357,7 @@ __content of this page html element__
</article>
-</section>
+</main>
</body>
<?php $this->stop('page') ?> \ No newline at end of file
diff --git a/app/view/templates/media.php b/app/view/templates/media.php
index 2078d79..706a160 100644
--- a/app/view/templates/media.php
+++ b/app/view/templates/media.php
@@ -8,7 +8,7 @@
<?php $this->insert('backtopbar', ['user' => $user, 'tab' => 'media']) ?>
-<section class="media">
+<main class="media">
<div id="tree">
@@ -28,7 +28,7 @@ function treecount(array $dir, string $dirname, int $deepness, string $path, str
$folder = '├─📁' . $dirname;
}
echo '<tr>';
- echo '<td><a href="?path=' . $path . '">' . str_repeat(' ‎ ‎', $deepness) . $folder . '</a></td>';
+ echo '<td><a href="?path=' . $path . '">' . str_repeat('&nbsp;&nbsp;', $deepness) . $folder . '</a></td>';
echo '<td>' . $dir['dirfilecount'] . '</td>';
echo '</tr>';
foreach ($dir as $key => $value) {
@@ -78,7 +78,7 @@ foreach ($medialist as $media) {
<tr>
<td><a href="<?= $media->getfullpath() ?>" target="_blank"><?= $media->id() ?></a></td>
<td><?= $media->extension() ?></td>
- <td><?= $media->type() == 'image' ? 'image <span class="thumbnail">👁<img src="' . $media->getfullpath() . '"></span>' : $media->type() ?></td>
+ <td><?= $media->type() == 'image' ? '<span class="thumbnail">image 👁<img src="' . $media->getfullpath() . '"></span>' : $media->type() ?></td>
<td><?= readablesize($media->size()) ?></td>
<td><?= $media->width() ?></td>
<td><?= $media->height() ?></td>
@@ -110,7 +110,7 @@ foreach ($medialist as $media) {
</div>
-</section>
+</main>
</body>
<?php $this->stop('page') ?> \ No newline at end of file