forked from ZwiiCMS-Team/ZwiiCMS
[9.2.22] vignette album optimisation
This commit is contained in:
parent
a720fe2611
commit
6db5707da8
@ -180,11 +180,9 @@ class gallery extends common {
|
|||||||
// Photo de la page de garde de l'album
|
// Photo de la page de garde de l'album
|
||||||
$homePictures = [];
|
$homePictures = [];
|
||||||
foreach((array) $this->getInput('homePicture', null) as $file => $homePicture) {
|
foreach((array) $this->getInput('homePicture', null) as $file => $homePicture) {
|
||||||
$homePictures[$file] = $file;
|
// null : pas de variable définie (compatibilité) ou choix non effectif
|
||||||
|
$homePictures[$file] = $file === 0 ? null : helper::filter($file, helper::FILTER_STRING_SHORT) ;
|
||||||
}
|
}
|
||||||
// Pas de sélection, retourne NULL plutôt que 0
|
|
||||||
// Permet de traiter aussi le cas où l'image d'album n'est pas définie.
|
|
||||||
$homePictures[$file] = $homePictures[$file] === 0 ? NULL : $homePictures[$file];
|
|
||||||
$this->setData(['module', $this->getUrl(0), $galleryId, [
|
$this->setData(['module', $this->getUrl(0), $galleryId, [
|
||||||
'config' => [
|
'config' => [
|
||||||
'name' => $this->getInput('galleryEditName', helper::FILTER_STRING_SHORT, true),
|
'name' => $this->getInput('galleryEditName', helper::FILTER_STRING_SHORT, true),
|
||||||
|
@ -6,11 +6,12 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
|
<?php var_dump($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']));?>
|
||||||
<a
|
<a
|
||||||
href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>"
|
href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>"
|
||||||
class="galleryPicture"
|
class="galleryPicture"
|
||||||
style="background-image:url('<?php
|
style="background-image:url('<?php
|
||||||
if ($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']) === NULL ) {
|
if ($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']) === null ) {
|
||||||
echo helper::baseUrl(false) . $module::$firstPictures[$galleryId];
|
echo helper::baseUrl(false) . $module::$firstPictures[$galleryId];
|
||||||
} else {
|
} else {
|
||||||
echo helper::baseUrl(false) . $this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'directory']) . '/' . $this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']);
|
echo helper::baseUrl(false) . $this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'directory']) . '/' . $this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'homePicture']);
|
||||||
|
Loading…
Reference in New Issue
Block a user