Nom de variables et alignements

This commit is contained in:
Fred Tempez 2021-03-30 17:52:16 +02:00
parent 08127b1fd5
commit 92bbafdafd
3 changed files with 33 additions and 35 deletions

View File

@ -52,7 +52,7 @@ class news extends common {
22 => '22 articles' 22 => '22 articles'
]; ];
// Nombre de colone par page // Nombre de colone par page
public static $ListeCol = [ public static $Columns = [
12 => '1 Colonne', 12 => '1 Colonne',
6 => '2 Colonnes', 6 => '2 Colonnes',
4 => '3 Colonnes', 4 => '3 Colonnes',
@ -161,7 +161,7 @@ class news extends common {
'feeds' => $this->getInput('newsConfigShowFeeds',helper::FILTER_BOOLEAN), '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), 'itemsperPage' => $this->getInput('newsConfigItemsperPage', helper::FILTER_INT,true),
'listeCol' => $this->getInput('newsConfigListeCol', helper::FILTER_INT,true) 'itemsperCol' => $this->getInput('newsConfigItemsperCol', helper::FILTER_INT,true)
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -320,7 +320,7 @@ class news extends common {
//$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'])); $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']));
// Nombre de colonnes // Nombre de colonnes
self::$nbrCol = $this->getData(['module', $this->getUrl(0),'config', 'listeCol']); self::$nbrCol = $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']);
// Liste des pages // Liste des pages
self::$pages = $pagination['pages']; self::$pages = $pagination['pages'];
// News en fonction de la pagination // News en fonction de la pagination

View File

@ -52,9 +52,9 @@
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('newsConfigListeCol', $module::$ListeCol, [ <?php echo template::select('newsConfigItemsperCol', $module::$Columns, [
'label' => 'Nombre de colonne', 'label' => 'Nombre de colonne',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'listeCol']), 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']),
'help' => 'Nombre de colonnes par page' 'help' => 'Nombre de colonnes par page'
]); ?> ]); ?>
</div> </div>

View File

@ -1,6 +1,5 @@
<?php if($module::$news): ?> <?php if($module::$news): ?>
<div class="row"> <div class="row">
<div class="col12">
<?php foreach($module::$news as $newsId => $news): ?> <?php foreach($module::$news as $newsId => $news): ?>
<div class="col<?php echo $module::$nbrCol ;?>" > <div class="col<?php echo $module::$nbrCol ;?>" >
<h1 class="newsTitle" id="<?php echo $newsId;?>"> <h1 class="newsTitle" id="<?php echo $newsId;?>">
@ -32,7 +31,6 @@
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
</div>
<?php echo $module::$pages; ?> <?php echo $module::$pages; ?>
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?> <?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<div id="rssFeed"> <div id="rssFeed">