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'
];
// Nombre de colone par page
public static $ListeCol = [
public static $Columns = [
12 => '1 Colonne',
6 => '2 Colonnes',
4 => '3 Colonnes',
@ -161,7 +161,7 @@ class news extends common {
'feeds' => $this->getInput('newsConfigShowFeeds',helper::FILTER_BOOLEAN),
'feedsLabel' => $this->getInput('newsConfigFeedslabel',helper::FILTER_STRING_SHORT),
'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
$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(['module', $this->getUrl(0),'config', 'itemsperPage']));
// 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
self::$pages = $pagination['pages'];
// News en fonction de la pagination

View File

@ -52,9 +52,9 @@
]); ?>
</div>
<div class="col4">
<?php echo template::select('newsConfigListeCol', $module::$ListeCol, [
<?php echo template::select('newsConfigItemsperCol', $module::$Columns, [
'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'
]); ?>
</div>

View File

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