From 08127b1fd53d44cda34d28dc0bce31583446534a Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 30 Mar 2021 17:39:15 +0200 Subject: [PATCH] Init --- module/news/news.php | 30 +++++++++++++--- module/news/view/config/config.php | 20 +++++++++++ module/news/view/index/index.css | 23 +++++++++++- module/news/view/index/index.php | 58 +++++++++++++++--------------- 4 files changed, 96 insertions(+), 35 deletions(-) diff --git a/module/news/news.php b/module/news/news.php index b3896b31..dd6b11d4 100755 --- a/module/news/news.php +++ b/module/news/news.php @@ -15,7 +15,7 @@ class news extends common { - const VERSION = '2.3'; + const VERSION = '2.4'; const REALNAME = 'Actualités'; const DELETE = true; const UPDATE = '0.0'; @@ -42,7 +42,24 @@ class news extends common { ]; public static $users = []; - + + // Nombre d'objets par page + public static $ItemsList = [ + 4 => '4 articles', + 8 => '8 articles', + 12 => '12 articles', + 16 => '16 articles', + 22 => '22 articles' + ]; + // Nombre de colone par page + public static $ListeCol = [ + 12 => '1 Colonne', + 6 => '2 Colonnes', + 4 => '3 Colonnes', + 2 => '4 Colonnes' + ]; + public static $nbrCol = 1; + /** * Flux RSS */ @@ -142,7 +159,9 @@ class news extends common { if($this->isPost()) { $this->setData(['module', $this->getUrl(0), 'config',[ 'feeds' => $this->getInput('newsConfigShowFeeds',helper::FILTER_BOOLEAN), - 'feedsLabel' => $this->getInput('newsConfigFeedslabel',helper::FILTER_STRING_SHORT) + 'feedsLabel' => $this->getInput('newsConfigFeedslabel',helper::FILTER_STRING_SHORT), + 'itemsperPage' => $this->getInput('newsConfigItemsperPage', helper::FILTER_INT,true), + 'listeCol' => $this->getInput('newsConfigListeCol', helper::FILTER_INT,true) ]]); // Valeurs en sortie $this->addOutput([ @@ -298,7 +317,10 @@ class news extends common { } } // Pagination - $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','itemsperPage'])); + //$pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','itemsperPage'])); + $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])); + // Nombre de colonnes + self::$nbrCol = $this->getData(['module', $this->getUrl(0),'config', 'listeCol']); // Liste des pages self::$pages = $pagination['pages']; // News en fonction de la pagination diff --git a/module/news/view/config/config.php b/module/news/view/config/config.php index 73929b9d..f1bb9975 100755 --- a/module/news/view/config/config.php +++ b/module/news/view/config/config.php @@ -39,7 +39,27 @@ + + +
+

Nombre de news par page

+
+
+ 'News par page', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']), + 'help' => 'Nombre de news par page' + ]); ?>
+
+ 'Nombre de colonne', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'listeCol']), + 'help' => 'Nombre de colonnes par page' + ]); ?> +
+
+
diff --git a/module/news/view/index/index.css b/module/news/view/index/index.css index 48553448..44d41f70 100755 --- a/module/news/view/index/index.css +++ b/module/news/view/index/index.css @@ -12,7 +12,7 @@ * @link http://zwiicms.fr/ */ -/* + /* * Module news */ @@ -44,4 +44,25 @@ #rssFeed p { display: inline; vertical-align: top; +} +@media (min-width: 769px) +{ + .col2 {width: 20%;} + .col3 {width: 24%;} + .col4 {width: 32%;} + .col6 {width: 49%;} + .col12 {width: 100%;} +} + +@media (max-width: 768px) +{ + .col2 {width: 49%;} + .col3 {width: 49%;} + .col4 {width: 49%;} +} +@media (max-width: 480px) +{ + .col2 {width: 100%;} + .col3 {width: 100%;} + .col4 {width: 100%;} } \ No newline at end of file diff --git a/module/news/view/index/index.php b/module/news/view/index/index.php index 084b370f..9d99ded0 100755 --- a/module/news/view/index/index.php +++ b/module/news/view/index/index.php @@ -2,36 +2,34 @@
$news): ?> -
-
-

- -

-
- -
-
- - - - - - getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND - ( // Propriétaire - ( $this->getUser('group') === self::GROUP_ADMIN ) - ) - ): ?> - - Editer - - -
+
+

+ +

+
+
-
+
+ + + - + + getUser('password') === $this->getInput('ZWII_USER_PASSWORD') + AND + ( // Propriétaire + ( $this->getUser('group') === self::GROUP_ADMIN ) + ) + ): ?> + + Editer + + +
+
@@ -40,7 +38,7 @@