aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-01-29 23:05:09 +0100
committervincent-peugnet <v.peugnet@free.fr>2020-01-29 23:05:09 +0100
commit0259be325a83e200913b3c9acd6700057f2035d9 (patch)
tree367204023c4ccead808f7f9ae1c47ef19a76eb93 /app
parentaaa5016ea6ec00137868fef0693e9ccdb2ca633d (diff)
downloadwcms-0259be325a83e200913b3c9acd6700057f2035d9.tar.gz
wcms-0259be325a83e200913b3c9acd6700057f2035d9.zip
fix #22, fix #44
Diffstat (limited to 'app')
-rw-r--r--app/class/Model.php2
-rw-r--r--app/class/Modelmedia.php8
-rw-r--r--app/view/templates/home.php6
3 files changed, 13 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>