show al categories

This commit is contained in:
Fred Tempez 2023-11-19 17:52:02 +01:00
parent b92944e8e3
commit 42a228a689

View File

@ -1,7 +1,10 @@
<?php $startRow = 0; ?>
<?php foreach ($this->getData(['course']) as $courseId => $courseValue): ?>
<!-- Filtre de catégorie -->
<?php if ($courseValue['category'] !== $this->getData(['module', $this->getUrl(0), 'config', 'category'])): ?>
<?php if (
$this->getData(['module', $this->getUrl(0), 'config', 'category']) !== 'all' &&
$courseValue['category'] !== $this->getData(['module', $this->getUrl(0), 'config', 'category'])
): ?>
<?php continue; ?>
<?php endif; ?>
<?php if ($startRow === 0): ?>
@ -63,39 +66,43 @@
<?php echo $module::$coursesEnrolment[$courseValue['enrolment']]; ?>
</span>
</p>
<?php if ($this->getData(['course', $courseId, 'limitEnrolment']) === true ):?>
<?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'enrolmentLimit']); ?>
<?php echo helper::dateUTF8(' %d %B %Y', $this->getData(['course', $courseId, 'limitEnrolmentDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'limitEnrolmentDate']), self::$i18nUI); ?>
<?php if ($this->getData(['course', $courseId, 'limitEnrolment']) === true): ?>
<p>
<span class="workshopEnrolmentLimit">
<?php echo $this->getData(['module', $this->getUrl(0), 'caption', 'enrolmentLimit']); ?>
<?php echo helper::dateUTF8(' %d %B %Y', $this->getData(['course', $courseId, 'limitEnrolmentDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'limitEnrolmentDate']), self::$i18nUI); ?>
</span>
</p>
<?php endif; ?>
<?php endif; ?>
<!-- Lien accès au contenu-->
<div class="row">
<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>
<!-- Lien accès au contenu-->
<div class="row">
<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>
<!-- Fin du bloc et bordure -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'template']) === true): ?>
<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>
</div>
<!-- Fin du bloc et bordure -->
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'template']) === true): ?>
</div>
<?php endif; ?>
</div>