ZwiiCMS/module/gallery/view/index/index.php

31 lines
1.2 KiB
PHP
Raw Normal View History

2018-04-02 08:29:19 +02:00
<?php if($module::$galleries): ?>
<?php $i = 1; ?>
<?php $galleriesNb = count($module::$galleries); ?>
<?php foreach($module::$galleries as $galleryId => $gallery): ?>
<?php if($i % 2 === 1): ?>
<div class="row">
2020-02-22 22:18:49 +01:00
<?php endif; ?>
2018-04-02 08:29:19 +02:00
<div class="col6">
2020-02-23 12:08:14 +01:00
<?php var_dump($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']));?>
2018-04-02 08:29:19 +02:00
<a
href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>"
class="galleryPicture"
2020-02-22 22:18:49 +01:00
style="background-image:url('<?php
2020-02-23 12:08:14 +01:00
if ($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']) === null ) {
2020-02-22 22:18:49 +01:00
echo helper::baseUrl(false) . $module::$firstPictures[$galleryId];
} else {
echo helper::baseUrl(false) . $this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'directory']) . '/' . $this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']);
}
?>')"
2018-04-02 08:29:19 +02:00
>
<div class="galleryName"><?php echo $gallery['config']['name']; ?></div>
</a>
</div>
<?php if($i % 2 === 0 OR $i === $galleriesNb): ?>
</div>
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
<?php else: ?>
<?php echo template::speech('Aucune galerie.'); ?>
<?php endif; ?>