diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-01-30 03:32:31 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-01-30 03:32:31 +0100 |
commit | 27f1fb9c19fa2c2fd28863809ccc6ba526499c0d (patch) | |
tree | 5dbbc75a29a4b160db3042c41367d81e0285c70e | |
parent | eab190e895124ef643c2b0574c84f3424857eeac (diff) | |
download | wcms-27f1fb9c19fa2c2fd28863809ccc6ba526499c0d.tar.gz wcms-27f1fb9c19fa2c2fd28863809ccc6ba526499c0d.zip |
thumbnail can be changed in multi edit
-rw-r--r-- | app/class/Controllerhome.php | 2 | ||||
-rw-r--r-- | app/view/templates/editleftbar.php | 38 | ||||
-rw-r--r-- | app/view/templates/edittopbar.php | 2 | ||||
-rw-r--r-- | app/view/templates/home.php | 2 | ||||
-rw-r--r-- | app/view/templates/homemenu.php | 12 |
5 files changed, 24 insertions, 32 deletions
diff --git a/app/class/Controllerhome.php b/app/class/Controllerhome.php index d102930..02d6c9d 100644 --- a/app/class/Controllerhome.php +++ b/app/class/Controllerhome.php @@ -36,7 +36,7 @@ class Controllerhome extends Controllerpage $columns = $this->modelhome->setcolumns($this->user->columns()); - $vars = ['user' => $this->user, 'table2' => $table2, 'opt' => $this->opt, 'columns' => $columns, 'faviconlist' => $this->mediamanager->listfavicon(), 'editorlist' => $this->usermanager->getlisterbylevel(2, '>='), 'colors' => $colors]; + $vars = ['user' => $this->user, 'table2' => $table2, 'opt' => $this->opt, 'columns' => $columns, 'faviconlist' => $this->mediamanager->listfavicon(), 'thumbnaillist' => $this->mediamanager->listthumbnail(), 'editorlist' => $this->usermanager->getlisterbylevel(2, '>='), 'colors' => $colors]; $vars['footer'] = ['version' => getversion(), 'total' => count($table), 'database' => Config::pagetable()]; if (isset($_POST['query']) && $this->user->iseditor()) { diff --git a/app/view/templates/editleftbar.php b/app/view/templates/editleftbar.php index cf30624..3004351 100644 --- a/app/view/templates/editleftbar.php +++ b/app/view/templates/editleftbar.php @@ -52,7 +52,9 @@ <option value="<?= $page->thumbnail() ?>">--using template thumbnail--</option> <?php } else { - echo '<option value="">--no thumbnail--</option>'; + 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> @@ -97,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"> @@ -109,10 +116,6 @@ } ?> </select> - - <?php - if(!empty($page->templatecss())) { - ?> <div class="subtemplate"> <input type="checkbox" name="templateoptions[]" id="oreccursivecss" value="reccursivecss" <?= in_array('reccursivecss', $page->templateoptions()) ? 'checked' : '' ?>> @@ -126,20 +129,7 @@ <input type="checkbox" name="templateoptions[]" id="ofavicon" value="favicon" <?= in_array('favicon', $page->templateoptions()) ? 'checked' : '' ?>> <label for="ofavicon">Favicon</label> </div> - <div class="subtemplate"> - <input type="checkbox" name="templateoptions[]" id="othumbnail" value="thumbnail" <?= in_array('thumbnail', $page->templateoptions()) ? 'checked' : '' ?>> - <label for="othumbnail">Thumbnail</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> @@ -155,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> diff --git a/app/view/templates/edittopbar.php b/app/view/templates/edittopbar.php index 5aa13ba..2eefd0f 100644 --- a/app/view/templates/edittopbar.php +++ b/app/view/templates/edittopbar.php @@ -2,7 +2,7 @@ - <form action="<?= $this->upage('pageupdate', $page->id()) ?>" method="post" id="update" enctype="multippage/form-data"> + <form action="<?= $this->upage('pageupdate', $page->id()) ?>" method="post" id="update"> <div id="editmenu"> diff --git a/app/view/templates/home.php b/app/view/templates/home.php index 3ca4556..fafd87b 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -16,7 +16,7 @@ <?php $optlist = $optlist ?? null; - $this->insert('homemenu', ['user' => $user, 'opt' => $opt, 'optlist' => $optlist, 'pagelist' => $pagelist, 'faviconlist' => $faviconlist, 'editorlist' => $editorlist, 'colors' => $colors]); + $this->insert('homemenu', ['user' => $user, 'opt' => $opt, 'optlist' => $optlist, 'pagelist' => $pagelist, 'faviconlist' => $faviconlist, 'thumbnaillist' => $thumbnaillist, 'editorlist' => $editorlist, 'colors' => $colors]); ?> diff --git a/app/view/templates/homemenu.php b/app/view/templates/homemenu.php index 51a58e9..e437a4e 100644 --- a/app/view/templates/homemenu.php +++ b/app/view/templates/homemenu.php @@ -76,7 +76,7 @@ </select> <label for="setlevel">Privacy level</label> </br> - <strong>Favicon</strong> + <strong>Images</strong> </br> <select name="datas[favicon]" id="favicon"> <option value="" disabled selected>--set favicon--</option> @@ -88,6 +88,16 @@ </select> <label for="favicon">Favicon</label> </br> + <select name="datas[thumbnail]" id="thumbnail"> + <option value="" disabled selected>--set thumbnail--</option> + <?php + foreach ($thumbnaillist as $thumbnail) { + echo '<option value ="' . $thumbnail . '">' . $thumbnail . '</option>'; + } + ?> + </select> + <label for="favicon">Thumnail</label> + </br> <strong>Templates</strong> </br> <select name="datas[templatebody]" id="templatebody"> |