Merge branch '11307-dev' into dev

This commit is contained in:
fredtempez 2022-03-22 16:57:21 +01:00
commit b1dabba247
5 changed files with 15 additions and 9 deletions

View File

@ -11,7 +11,7 @@
## Version 11.3.06 ## Version 11.3.06
### Corrections : ### Corrections :
- Bug d'affichage des blocs de présentation. - Bug d'affichage des blocs de présentation dans la configuration du site.
- Double déclaration d'une fonte locale. - Double déclaration d'une fonte locale.
### Améliorations : ### Améliorations :
- Sauvegarde des fontes avec le thème. - Sauvegarde des fontes avec le thème.

View File

@ -42,6 +42,8 @@ class gallery extends common {
public static $thumbs = []; public static $thumbs = [];
public static $config = [];
public static $actions = [ public static $actions = [
'config' => self::GROUP_MODERATOR, 'config' => self::GROUP_MODERATOR,
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR,
@ -600,7 +602,6 @@ class gallery extends common {
// Mise à jour des données de module // Mise à jour des données de module
$this->update(); $this->update();
// Une seule galerie, bifurquer sur celle-ci // Une seule galerie, bifurquer sur celle-ci
$gallery = count($this->getData(['module', $this->getUrl(0), 'content'])) === 1 $gallery = count($this->getData(['module', $this->getUrl(0), 'content'])) === 1
? array_key_first($this->getData(['module', $this->getUrl(0), 'content'])) ? array_key_first($this->getData(['module', $this->getUrl(0), 'content']))
@ -618,6 +619,10 @@ class gallery extends common {
else { else {
// Images de la galerie // Images de la galerie
$directory = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'directory']); $directory = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'directory']);
// Définir les options
self::$config['homePicture'] = $this->getData(['module',$this->getUrl(0),'content', $gallery,'config','homePicture']);
self::$config['fullScreen'] = $this->getData(['module',$this->getUrl(0),'content', $gallery,'config','fullScreen']) === true ? 'fullScreen' : '';
self::$config['mono'] = count($this->getData(['module', $this->getUrl(0), 'content'])) === 1;
if(is_dir($directory)) { if(is_dir($directory)) {
$iterator = new DirectoryIterator($directory); $iterator = new DirectoryIterator($directory);
foreach($iterator as $fileInfos) { foreach($iterator as $fileInfos) {
@ -634,6 +639,7 @@ class gallery extends common {
self::$thumbs[$directory . '/' . $fileInfos->getFilename()] = file_exists( str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename())) self::$thumbs[$directory . '/' . $fileInfos->getFilename()] = file_exists( str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))
? str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()) ? str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename())
: str_replace('source','thumb',$directory) . '/' . strtolower($fileInfos->getFilename()); : str_replace('source','thumb',$directory) . '/' . strtolower($fileInfos->getFilename());
} }
} }
// Tri des images par ordre alphabétique // Tri des images par ordre alphabétique

View File

@ -25,8 +25,7 @@ var b = new SimpleLightbox('.galleryGalleryPicture', {
$( document ).ready(function() { $( document ).ready(function() {
// Démarre en mode plein écran // Démarre en mode plein écran
var fullscreen = <?php echo json_encode($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'config', 'fullScreen'])); ?>; if ( $("#pictureContainer").hasClass("fullScreen") ) {
if ( fullscreen === true) {
$('a#homePicture')[0].click(); $('a#homePicture')[0].click();
} }
}); });

View File

@ -1,3 +1,5 @@
<?php if ( $module::$config['mono'] !== true): ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('galleryGalleryBack', [ <?php echo template::button('galleryGalleryBack', [
@ -8,13 +10,13 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row galleryRow"> <?php endif; ?>
<div id="pictureContainer" class="row galleryRow <?php echo ($module::$config['fullScreen']);?> ">
<?php foreach($module::$pictures as $picture => $legend): ?> <?php foreach($module::$pictures as $picture => $legend): ?>
<div class="colPicture"> <div class="colPicture">
<a <a
href="<?php echo helper::baseUrl(false) . $picture; ?>" href="<?php echo helper::baseUrl(false) . $picture; ?>"
<?php if ( $picture === $this->getdata(['module',$this->getUrl(0),'content',$this->getUrl(1),'config','homePicture']) ) { <?php if ( strpos($picture, $module::$config['homePicture']) > 1) { echo 'id="homePicture"'; } ?>
echo 'id="homePicture"'; } ?>
class="galleryGalleryPicture" class="galleryGalleryPicture"
style="background-image:url('<?php echo helper::baseUrl(false) . $module::$thumbs[$picture]; ?>')" style="background-image:url('<?php echo helper::baseUrl(false) . $module::$thumbs[$picture]; ?>')"
data-caption="<?php echo $legend; ?>" data-caption="<?php echo $legend; ?>"

View File

@ -1,7 +1,6 @@
<?php if($module::$galleries): ?> <?php if($module::$galleries): ?>
<div class="row galleryRow"> <div class="row galleryRow">
<?php foreach($module::$galleries as $galleryId => $gallery): ?> <?php foreach($module::$galleries as $galleryId => $gallery): ?>
<div class="colPicture" div="pos<?php echo $gallery['config']['position']; ?>" > <div class="colPicture" div="pos<?php echo $gallery['config']['position']; ?>" >
<a <a
href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>" href="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/<?php echo $galleryId; ?>"