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,37 +1,35 @@
<?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;?>">
<?php echo $news['title']; ?>
</h1>
<div class="newsContent">
<?php echo $news['content']; ?>
</div>
<div class="newsSignature">
<i class="far fa-calendar-alt"></i>
<?php echo mb_detect_encoding(strftime('%d %B %Y', $news['publishedOn']), 'UTF-8', true)
? strftime('%d %B %Y', $news['publishedOn'])
: utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
- <?php echo $news['userId']; ?>
<!-- Bloc edition -->
<?php if (
<?php foreach($module::$news as $newsId => $news): ?>
<div class="col<?php echo $module::$nbrCol ;?>" >
<h1 class="newsTitle" id="<?php echo $newsId;?>">
<?php echo $news['title']; ?>
</h1>
<div class="newsContent">
<?php echo $news['content']; ?>
</div>
<div class="newsSignature">
<i class="far fa-calendar-alt"></i>
<?php echo mb_detect_encoding(strftime('%d %B %Y', $news['publishedOn']), 'UTF-8', true)
? strftime('%d %B %Y', $news['publishedOn'])
: utf8_encode(strftime('%d %B %Y', $news['publishedOn'])); ?>
- <?php echo $news['userId']; ?>
<!-- Bloc edition -->
<?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND
( // Propriétaire
( $this->getUser('group') === self::GROUP_ADMIN )
)
): ?>
<a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId . '/' . $_SESSION['csrf'];?>">
<?php echo template::ico('pencil');?> Editer
</a>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND
( // Propriétaire
( $this->getUser('group') === self::GROUP_ADMIN )
)
): ?>
<a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId . '/' . $_SESSION['csrf'];?>">
<?php echo template::ico('pencil');?> Editer
</a>
<?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<?php echo $module::$pages; ?>
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>