2022-03-06 13:35:21 +01:00
|
|
|
<?php
|
|
|
|
// Lexique
|
|
|
|
$text = [];
|
|
|
|
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
|
|
|
switch ($val) {
|
|
|
|
case 'fr' :
|
|
|
|
$text[0] = 'lire la suite';
|
|
|
|
$text[1] = 'Aucune news.';
|
|
|
|
$text[2] = ' Editer';
|
|
|
|
break;
|
|
|
|
case 'en' :
|
|
|
|
$text[0] = 'read more';
|
2022-03-18 07:50:13 +01:00
|
|
|
$text[1] = 'No news.';
|
2022-03-06 13:35:21 +01:00
|
|
|
$text[2] = ' Edit';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
?>
|
2022-01-31 09:10:49 +01:00
|
|
|
<?php if($module::$news): ?>
|
|
|
|
<div class="row">
|
|
|
|
<?php foreach($module::$news as $newsId => $news): ?>
|
|
|
|
<div class="col<?php echo $module::$nbrCol ;?>" >
|
|
|
|
<div class="newsFrame">
|
|
|
|
<h2 class="newsTitle" id="<?php echo $newsId;?>">
|
|
|
|
<?php echo '<a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?>
|
|
|
|
</h2>
|
|
|
|
<div class="newsContent">
|
|
|
|
<?php echo $news['content']; ?>
|
|
|
|
<?php if ( $this->getData(['module', $this->getUrl(0), 'config', 'height']) !== -1
|
|
|
|
&& strlen($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'content'])) >= $this->getData(['module', $this->getUrl(0), 'config', 'height'])):?>
|
2022-03-06 13:35:21 +01:00
|
|
|
<?php echo ' ... <a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">'.$text[0].'</span></a>'; ?>
|
2022-01-31 09:10:49 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
<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('DELTA_USER_PASSWORD')
|
|
|
|
AND
|
|
|
|
( // Propriétaire
|
|
|
|
( $this->getUser('group') === self::GROUP_ADMIN )
|
|
|
|
)
|
|
|
|
): ?>
|
|
|
|
<a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId . '/' . $_SESSION['csrf'];?>">
|
2022-03-06 13:35:21 +01:00
|
|
|
<?php echo template::ico('pencil'); echo $text[2]; ?>
|
2022-01-31 09:10:49 +01:00
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
<?php echo $module::$pages; ?>
|
|
|
|
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
|
|
|
|
<div id="rssFeed">
|
|
|
|
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" target="_blank">
|
|
|
|
<img src='module/news/ressource/feed-icon-16.gif' />
|
|
|
|
<?php
|
|
|
|
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
|
|
|
|
?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php else: ?>
|
2022-03-06 13:35:21 +01:00
|
|
|
<?php echo template::speech($text[1]); ?>
|
2022-01-31 09:10:49 +01:00
|
|
|
<?php endif; ?>
|