news bouton léger d'édition

This commit is contained in:
Fred Tempez 2021-03-18 14:30:34 +01:00
parent cca005fb06
commit 00e6005983

View File

@ -2,21 +2,36 @@
<div class="row">
<div class="col12">
<?php foreach($module::$news as $newsId => $news): ?>
<h1 class="newsTitle" id="<?php echo $newsId;?>">
<?php echo $news['title']; ?>
</h1>
<div class="newsContent">
<?php echo $news['content']; ?>
<div class="row ">
<div class="col12">
<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 $this->getData(['user', $news['userId'], 'firstname']) . ' ' . $this->getData(['user', $news['userId'], 'lastname']); ?>
<!-- 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>
</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 $this->getData(['user', $news['userId'], 'firstname']) . ' ' . $this->getData(['user', $news['userId'], 'lastname']); ?>
</div>
<div class="clearBoth"></div>
<hr />
<?php endforeach; ?>
</div>
</div>