diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2020-01-29 23:05:09 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2020-01-29 23:05:09 +0100 |
commit | 0259be325a83e200913b3c9acd6700057f2035d9 (patch) | |
tree | 367204023c4ccead808f7f9ae1c47ef19a76eb93 | |
parent | aaa5016ea6ec00137868fef0693e9ccdb2ca633d (diff) | |
download | wcms-0259be325a83e200913b3c9acd6700057f2035d9.tar.gz wcms-0259be325a83e200913b3c9acd6700057f2035d9.zip |
fix #22, fix #44
-rw-r--r-- | app/class/Model.php | 2 | ||||
-rw-r--r-- | app/class/Modelmedia.php | 8 | ||||
-rw-r--r-- | app/view/templates/home.php | 6 | ||||
-rw-r--r-- | assets/css/home.css | 7 |
4 files changed, 20 insertions, 3 deletions
diff --git a/app/class/Model.php b/app/class/Model.php index 40e3a2e..9c0d500 100644 --- a/app/class/Model.php +++ b/app/class/Model.php @@ -58,7 +58,7 @@ abstract class Model '' => 'other' ]; - const COLUMNS = ['id', 'title', 'description', 'tag', 'date', 'datemodif', 'datecreation', 'secure', 'authors', 'linkfrom', 'linkto', 'visitcount', 'affcount', 'editcount']; + const COLUMNS = ['id', 'favicon', 'title', 'description', 'tag', 'date', 'datemodif', 'datecreation', 'secure', 'authors', 'linkfrom', 'linkto', 'visitcount', 'affcount', 'editcount']; const TEXT_ELEMENTS = ['header', 'nav', 'main', 'aside', 'footer']; diff --git a/app/class/Modelmedia.php b/app/class/Modelmedia.php index a6a682b..61a2286 100644 --- a/app/class/Modelmedia.php +++ b/app/class/Modelmedia.php @@ -111,8 +111,12 @@ class Modelmedia extends Model public function listfavicon() { - $glob = Model::FAVICON_DIR . '*.png'; - $faviconlist = glob($glob); + $extensions = ['ico', 'png', 'jpg', 'jpeg']; + $faviconlist = []; + foreach ($extensions as $extension ) { + $glob = Model::FAVICON_DIR . '*.' . $extension; + $faviconlist = array_merge($faviconlist, glob($glob)); + } $faviconlist = array_map(function ($input){ return basename($input); }, $faviconlist); diff --git a/app/view/templates/home.php b/app/view/templates/home.php index fa9ef63..3ca4556 100644 --- a/app/view/templates/home.php +++ b/app/view/templates/home.php @@ -37,6 +37,9 @@ <thead> <tr> <?php if($user->issupereditor()) { ?><th id="checkall" class="hidephone">x</th> <?php } ?> + <?php if($columns['favicon']) { ?> + <th class="favicon"><a href="<?= $opt->sortbyorder('favicon') ?>">ico</a></th> + <?php } ?> <th class="id"><a href="<?= $opt->sortbyorder('id') ?>">id</a></th> <th>edit</th> <th>see</th> @@ -89,6 +92,9 @@ <?php foreach ($table2 as $item) { ?> <tr> <?php if($user->issupereditor()) { ?><td class="hidephone"><input type="checkbox" name="pagesid[]" value="<?= $item->id() ?>" id="id_<?= $item->id() ?>" form="multi"></td><?php } ?> + <?php if($columns['favicon']) { ?> + <td class="favicon"><img class="favicon" src="<?= Wcms\Model::faviconpath() . $item->favicon() ?>" alt="<?= $item->favicon() ?>" title="<?= $item->favicon() ?>"></td> + <?php } ?> <td class="id"><label title="<?= $item->title() ?>" for="id_<?= $item->id() ?>"><?= $item->id() ?></label></td> <td><?php if($user->issupereditor() || in_array($user->id(), $item->authors())) { ?><a href="<?= $this->upage('pageedit', $item->id()) ?>"><img src="<?= Wcms\Model::iconpath() ?>edit.png" class="icon"></a><?php } ?></td> <td><a href="<?= $this->upage('pageread/', $item->id()) ?>" target="_blank"><img src="<?= Wcms\Model::iconpath() ?>read.png" class="icon"></a></td> diff --git a/assets/css/home.css b/assets/css/home.css index dc8c933..fdf6e5b 100644 --- a/assets/css/home.css +++ b/assets/css/home.css @@ -153,6 +153,12 @@ table a.secure.public { } +table img.favicon { + height: 16px; + max-width: 32px; +} + + body { margin: 0; height: 100%; @@ -576,3 +582,4 @@ footer { + |