ZwiiCampus/module/workshop/view/index/index.php

110 lines
5.8 KiB
PHP
Raw Normal View History

2023-10-19 13:47:36 +02:00
<div class="row">
<?php foreach ($this->getData(['course']) as $courseId => $courseValue): ?>
<!-- Layout en colonnes -->
2023-10-22 11:36:26 +02:00
<div class="workshopContainer col<?php echo $this->getData(['module', $this->getUrl(0), 'config', 'layout']); ?>">
2023-10-19 11:41:54 +02:00
2023-10-19 13:47:36 +02:00
<!-- Affchage par bloc et bordure -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'template']) === true): ?>
<div class="block">
<h4>
2023-10-22 11:36:26 +02:00
<?php else: ?>
<p>
<?php endif; ?>
2023-10-19 11:41:54 +02:00
<!-- Insère le titre court dans tous les cas -->
2023-10-22 11:36:26 +02:00
<span class="workshopTitle">
<?php echo $courseValue['title']; ?>
</span>
2023-10-19 11:41:54 +02:00
2023-10-22 11:36:26 +02:00
<!-- Fin du bloc et bordure titre 4 -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'template']) === true): ?>
2023-10-19 13:47:36 +02:00
</h4>
2023-10-22 11:36:26 +02:00
<?php else: ?>
<p>
2023-10-19 13:47:36 +02:00
<?php endif; ?>
<!-- Description -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'description']) === true): ?>
2023-10-22 11:36:26 +02:00
<p>
<span class="workshopDescription">
2023-10-19 13:47:36 +02:00
<?php echo $courseValue['description']; ?>
2023-10-22 11:36:26 +02:00
</span>
</p>
2023-10-19 13:47:36 +02:00
<?php endif; ?>
<!-- Author -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'author']) === true): ?>
<p>
2023-10-22 11:36:26 +02:00
<span class="workshopAuthor">
<?php echo sprintf(helper::translate('Auteur : %s'), $this->signature($courseValue['author'])); ?>
</span>
2023-10-19 13:47:36 +02:00
</p>
<?php endif; ?>
<!-- Modalité d'ouverture -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'access']) === true): ?>
2023-10-22 11:36:26 +02:00
<div class="workshopAccessContainer">
<p>
<span class="workshopAccess">
<?php echo helper::translate('Disponibilité : ') . $module::$coursesAccess[$courseValue['access']]; ?>
</span>
<!--Les dates d'ouverture et de fermeture -->
<?php if ($courseValue['access'] === self::COURSE_ACCESS_DATE): ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'openingdate']) === true): ?>
<p>
<span class="workshopOpeningDate">
<?php echo sprintf(helper::translate('%s Ouvre le %s'), template::ico('calendar-empty'), helper::dateUTF8('%d %B %Y', $courseValue['openingDate'])); ?>
</span>
</p>
<?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'closingdate']) === true): ?>
<p>
<span class="workshopClosingDate">
<?php echo sprintf(helper::translate('%s Ferme le %s'), template::ico('calendar-empty'), helper::dateUTF8('%d %B %Y', $courseValue['closingDate'])); ?>
</span>
</p>
<?php endif; ?>
<?php endif; ?>
2023-10-22 11:36:26 +02:00
</p>
</div>
2023-10-19 13:47:36 +02:00
<?php endif; ?>
2023-10-19 15:40:24 +02:00
<!-- Modalité d'inscription -->
2023-10-22 11:36:26 +02:00
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'enrolment']) === true): ?>
2023-10-19 15:40:24 +02:00
<p>
2023-10-22 11:36:26 +02:00
<span class="workshopEnrolment">
<?php echo sprintf(helper::translate('Inscription : %s '), $module::$coursesEnrolment[$courseValue['enrolment']]); ?>
</span>
2023-10-19 15:40:24 +02:00
</p>
<?php endif; ?>
2023-10-19 22:48:57 +02:00
<!-- Lien accès au cours-->
<div class="row">
2023-10-22 11:36:26 +02:00
<div class="col6 workshopLinkContainer">
<?php if (
$courseValue['access'] === self::COURSE_ACCESS_OPEN
||
($courseValue['access'] === self::COURSE_ACCESS_DATE && time() >= $courseValue['openingDate'] && time() <= $courseValue['closingDate'])
): ?>
<span class="workshopSuscribe">
<a href="<?php echo helper::baseUrl(); ?>course/swap/<?php echo $courseId; ?>">
<?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'url']); ?>
</a>
</span>
<?php endif; ?>
</div>
<div class="col6 textAlignRight">
<!-- Lien désinscription-->
<?php if ($this->getData(['enrolment', $courseId, $this->getUser('id')])): ?>
<span class="workshopUnsuscribe">
<a href="<?php echo helper::baseUrl(); ?>course/unsuscribe/<?php echo $courseId; ?>">
<?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'unsuscribe']); ?>
</a>
</span>
<?php endif; ?>
</div>
2023-10-19 22:48:57 +02:00
</div>
2023-10-19 13:47:36 +02:00
<!-- Fin du bloc et bordure -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'template']) === true): ?>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>