diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-02-06 18:07:53 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-02-06 18:07:53 +0100 |
commit | 08a26d4d6fbd45cdc136b60d0fb30f53ac4fd2f7 (patch) | |
tree | 209ac84720836e39c6c96f131b5049e7ad6096b2 /app/view/templates/editleftbar.php | |
parent | de939de88e1ed166d827616e3d17a22fe549202a (diff) | |
parent | 9d3f97870810e739041eccad234d47308747cb1f (diff) | |
download | wcms-08a26d4d6fbd45cdc136b60d0fb30f53ac4fd2f7.tar.gz wcms-08a26d4d6fbd45cdc136b60d0fb30f53ac4fd2f7.zip |
Merge branch 'better-admin'
Diffstat (limited to 'app/view/templates/editleftbar.php')
-rw-r--r-- | app/view/templates/editleftbar.php | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php index 8302090..3004351 100644 --- a/app/view/templates/editleftbar.php +++ b/app/view/templates/editleftbar.php @@ -43,11 +43,34 @@ ?> </select> - <div id="thumbnail"> - <label for="thumbnail">Thumbnail</label> - <input type="file" id="thumbnail" name="thumbnail" accept=".jpg, .JPG, .jpeg, .JPEG"> - <img src="<?= Wcms\Model::thumbnailpath() ?><?= $page->id() ?>.jpg" alt="no-thumbnail"> + + <label for="thumbnail">Thumbnail</label> + <select name="thumbnail" id="thumbnail"> + <?php + if(!empty($page->templatebody()) && $page->template()['thumbnail']) { + ?> + <option value="<?= $page->thumbnail() ?>">--using template thumbnail--</option> + <?php + } else { + if(!file_exists(Wcms\Model::thumbnailpath() . $page->thumbnail())) { + echo '<option value="">--no thumbnail--</option>'; + } + foreach ($thumbnaillist as $thumbnail) { + ?> + <option value="<?= $thumbnail ?>" <?= $page->thumbnail() === $thumbnail ? 'selected' : '' ?>><?= $thumbnail ?></option> + <?php + } + } + ?> + </select> + + <?php if(!empty($page->thumbnail())) { ?> + <div id="showthumbnail"> + <img src="<?= Wcms\Model::thumbnailpath() . $page->thumbnail() ?>"> </div> + <?php } ?> + + @@ -76,6 +99,11 @@ ?> </select> + <div class="subtemplate"> + <input type="checkbox" name="templateoptions[]" id="othumbnail" value="thumbnail" <?= in_array('thumbnail', $page->templateoptions()) ? 'checked' : '' ?>> + <label for="othumbnail">Thumbnail</label> + </div> + <label for="templatecss">CSS template</label> <select name="templatecss" id="templatecss"> @@ -88,20 +116,12 @@ } ?> </select> - - <?php - if(!empty($page->templatecss())) { - ?> <div class="subtemplate"> <input type="checkbox" name="templateoptions[]" id="oreccursivecss" value="reccursivecss" <?= in_array('reccursivecss', $page->templateoptions()) ? 'checked' : '' ?>> <label for="oreccursivecss">Reccursive template</label> </div> <div class="subtemplate"> - <input type="checkbox" name="templateoptions[]" id="oquickcss" value="quickcss" <?= in_array('quickcss', $page->templateoptions()) ? 'checked' : '' ?>> - <label for="oquickcss">Quickcss</label> - </div> - <div class="subtemplate"> <input type="checkbox" name="templateoptions[]" id="oexternalcss" value="externalcss" <?= in_array('externalcss', $page->templateoptions()) ? 'checked' : '' ?>> <label for="oexternalcss">External CSS</label> </div> @@ -109,16 +129,7 @@ <input type="checkbox" name="templateoptions[]" id="ofavicon" value="favicon" <?= in_array('favicon', $page->templateoptions()) ? 'checked' : '' ?>> <label for="ofavicon">Favicon</label> </div> - <?php - } else { - foreach($page->templateoptions() as $option) { - if($option != 'externaljavascript') { - echo '<input type="hidden" name="templateoptions[]" value="'.$option.'">'; - } - } - } - - ?> + <label for="templatejavascript">Javascript template</label> @@ -134,20 +145,12 @@ </select> - <?php - if(!empty($page->templatejavascript())) { - ?> + <div class="subtemplate"> <input type="checkbox" name="templateoptions[]" value="externaljavascript" id="oexternaljs" <?= in_array('externaljavascript', $page->templateoptions()) ? 'checked' : '' ?>> <label for="oexternaljs">external js</label> </div> - <?php } else { - if(in_array('externaljavascript', $page->templateoptions())) { - echo '<input type="hidden" name="templateoptions[]" value="externaljavascript">'; - } - - } ?> </fieldset> |