2019-02-22 22:38:06 +01:00
|
|
|
<div class="blogDate">
|
|
|
|
<i class="far fa-calendar-alt"></i>
|
|
|
|
<?php echo utf8_encode(strftime('- %d %B %Y', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
|
|
|
|
à <?php echo utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'hidePicture']) == false) {
|
2019-03-22 18:43:10 +01:00
|
|
|
// echo '<div id="blogArticlePicture" style="background-image:url(' . helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']) . ');"></div>';
|
|
|
|
echo '<div id="blogArticlePicture"><img id="blogArticlePicture" src="' . helper::baseUrl(false) . 'site/file/source/' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']) . '"></div>';
|
2019-02-22 22:38:06 +01:00
|
|
|
} ?>
|
|
|
|
|
2018-04-02 08:29:19 +02:00
|
|
|
<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'content']); ?>
|
2018-11-13 18:33:22 +01:00
|
|
|
<!-- <h4 class="textAlignRight"> -->
|
|
|
|
<p class="signature">
|
|
|
|
<?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'firstname']); ?>
|
|
|
|
<?php echo $this->getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'lastname']); ?>
|
|
|
|
<!-- </h4> -->
|
|
|
|
</p>
|
|
|
|
|
2018-04-02 08:29:19 +02:00
|
|
|
<div class="clearBoth"></div>
|
2019-02-22 22:44:10 +01:00
|
|
|
<h3 id="comment">
|
2018-04-02 08:29:19 +02:00
|
|
|
<?php $commentsNb = count($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment'])); ?>
|
|
|
|
<?php echo $commentsNb . ' ' . ($commentsNb > 1 ? 'commentaires' : 'commentaire'); ?>
|
2019-02-22 22:44:10 +01:00
|
|
|
</h3>
|
2018-04-02 08:29:19 +02:00
|
|
|
<?php if($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'closeComment'])): ?>
|
|
|
|
<p>Les commentaires sont fermés pour cet article.</p>
|
|
|
|
<?php else: ?>
|
|
|
|
<?php echo template::formOpen('blogArticleForm'); ?>
|
|
|
|
<?php echo template::text('blogArticleCommentShow', [
|
|
|
|
'placeholder' => 'Rédiger un commentaire...',
|
|
|
|
'readonly' => true
|
|
|
|
]); ?>
|
|
|
|
<div id="blogArticleCommentWrapper" class="displayNone">
|
|
|
|
<?php if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?>
|
|
|
|
<?php echo template::text('blogArticleUserName', [
|
|
|
|
'label' => 'Nom',
|
|
|
|
'readonly' => true,
|
|
|
|
'value' => $this->getUser('firstname') . ' ' . $this->getUser('lastname')
|
|
|
|
]); ?>
|
|
|
|
<?php echo template::hidden('blogArticleUserId', [
|
|
|
|
'value' => $this->getUser('id')
|
|
|
|
]); ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col9">
|
|
|
|
<?php echo template::text('blogArticleAuthor', [
|
|
|
|
'label' => 'Nom'
|
|
|
|
]); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col1 textAlignCenter verticalAlignBottom">
|
|
|
|
<div id="blogArticleOr">Ou</div>
|
|
|
|
</div>
|
|
|
|
<div class="col2 verticalAlignBottom">
|
|
|
|
<?php echo template::button('blogArticleLogin', [
|
|
|
|
'href' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '__comment',
|
|
|
|
'value' => 'Connexion'
|
|
|
|
]); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php echo template::textarea('blogArticleContent', [
|
|
|
|
'label' => 'Commentaire',
|
|
|
|
'maxlength' => '500'
|
|
|
|
]); ?>
|
|
|
|
<?php if($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col4">
|
|
|
|
<?php echo template::capcha('blogArticleCapcha'); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col2 offset8">
|
|
|
|
<?php echo template::button('blogArticleCommentHide', [
|
|
|
|
'class' => 'buttonGrey',
|
|
|
|
'value' => 'Annuler'
|
|
|
|
]); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col2">
|
|
|
|
<?php echo template::submit('blogArticleSubmit', [
|
|
|
|
'value' => 'Envoyer',
|
|
|
|
'ico' => ''
|
|
|
|
]); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php echo template::formClose(); ?>
|
|
|
|
<?php endif;?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col12">
|
|
|
|
<?php foreach($module::$comments as $commentId => $comment): ?>
|
|
|
|
<div class="block">
|
|
|
|
<h4>
|
|
|
|
<?php if($comment['userId']): ?>
|
|
|
|
<?php echo $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']); ?>
|
|
|
|
<?php else: ?>
|
|
|
|
<?php echo $comment['author']; ?>
|
|
|
|
<?php endif; ?>
|
2018-11-13 18:33:22 +01:00
|
|
|
le <?php echo strftime('%d %B %Y à %H:%M', $comment['createdOn']); ?>
|
2018-04-02 08:29:19 +02:00
|
|
|
</h4>
|
|
|
|
<?php echo $comment['content']; ?>
|
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-08 16:52:44 +02:00
|
|
|
<?php if($this->getUser('group') >= self::GROUP_ADMIN): ?>
|
2018-08-30 09:36:59 +02:00
|
|
|
<div class="row">
|
2018-09-08 16:52:44 +02:00
|
|
|
<div class="col2">
|
|
|
|
<?php echo template::button('blogBack', [
|
|
|
|
'class' => 'buttonGrey',
|
|
|
|
'href' => helper::baseUrl() . $this->getUrl(0),
|
|
|
|
'ico' => 'left',
|
|
|
|
'value' => 'Retour'
|
|
|
|
]); ?>
|
|
|
|
</div>
|
2018-11-13 18:33:22 +01:00
|
|
|
<div class="col2 offset8">
|
2018-09-08 16:52:44 +02:00
|
|
|
<?php echo template::button('blogEdit', [
|
2018-11-13 18:33:22 +01:00
|
|
|
'class' => 'buttonBlue',
|
2019-01-16 19:25:09 +01:00
|
|
|
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1) . '/' . $_SESSION['csrf'],
|
2018-09-08 16:56:14 +02:00
|
|
|
'value' => 'Editer'
|
2018-09-08 16:52:44 +02:00
|
|
|
]); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php else: ?>
|
|
|
|
<div class="row">
|
2018-08-30 09:36:59 +02:00
|
|
|
<div class="col2">
|
|
|
|
<?php echo template::button('blogBack', [
|
|
|
|
'class' => 'buttonGrey',
|
|
|
|
'href' => helper::baseUrl() . $this->getUrl(0),
|
|
|
|
'ico' => 'left',
|
|
|
|
'value' => 'Retour'
|
2018-11-13 18:33:22 +01:00
|
|
|
]); ?>
|
2018-08-30 09:36:59 +02:00
|
|
|
</div>
|
2018-09-08 16:52:44 +02:00
|
|
|
<div class="col10">
|
2018-08-30 09:36:59 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-08 16:52:44 +02:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php echo $module::$pages; ?>
|