Merge branch 'dev' into 12-dev
This commit is contained in:
commit
77e3a54158
@ -2952,8 +2952,7 @@ class core extends common {
|
|||||||
'style' => file_get_contents($stylePath)
|
'style' => file_get_contents($stylePath)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if ($output['style'] &&
|
if ($output['style']) {
|
||||||
file_exists($output['style'])) {
|
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'style' => $this->output['style'] . file_get_contents($output['style'])
|
'style' => $this->output['style'] . file_get_contents($output['style'])
|
||||||
]);
|
]);
|
||||||
|
@ -603,10 +603,14 @@ 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
|
||||||
|
$gallery = count($this->getData(['module', $this->getUrl(0), 'content'])) === 1
|
||||||
|
? array_key_first($this->getData(['module', $this->getUrl(0), 'content']))
|
||||||
|
: $this->getUrl(1);
|
||||||
// Images d'une galerie
|
// Images d'une galerie
|
||||||
if($this->getUrl(1)) {
|
if($gallery) {
|
||||||
// La galerie n'existe pas
|
// La galerie n'existe pas
|
||||||
if($this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(1)]) === null) {
|
if($this->getData(['module', $this->getUrl(0), 'content', $gallery]) === null) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'access' => false
|
'access' => false
|
||||||
@ -615,13 +619,13 @@ class gallery extends common {
|
|||||||
// La galerie existe
|
// La galerie existe
|
||||||
else {
|
else {
|
||||||
// Images de la galerie
|
// Images de la galerie
|
||||||
$directory = $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(1), 'config', 'directory']);
|
$directory = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'directory']);
|
||||||
if(is_dir($directory)) {
|
if(is_dir($directory)) {
|
||||||
$iterator = new DirectoryIterator($directory);
|
$iterator = new DirectoryIterator($directory);
|
||||||
foreach($iterator as $fileInfos) {
|
foreach($iterator as $fileInfos) {
|
||||||
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
|
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
|
||||||
self::$pictures[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(1), 'legend', str_replace('.','',$fileInfos->getFilename())]);
|
self::$pictures[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'legend', str_replace('.','',$fileInfos->getFilename())]);
|
||||||
$picturesSort[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(1), 'positions', str_replace('.','',$fileInfos->getFilename())]);
|
$picturesSort[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'positions', str_replace('.','',$fileInfos->getFilename())]);
|
||||||
// Créer la miniature si manquante
|
// Créer la miniature si manquante
|
||||||
if (!file_exists( str_replace('source','thumb',$fileInfos->getPath()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))) {
|
if (!file_exists( str_replace('source','thumb',$fileInfos->getPath()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))) {
|
||||||
$this->makeThumb($fileInfos->getPathname(),
|
$this->makeThumb($fileInfos->getPathname(),
|
||||||
@ -635,7 +639,7 @@ class gallery extends common {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Tri des images par ordre alphabétique
|
// Tri des images par ordre alphabétique
|
||||||
switch ($this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(1), 'config', 'sort'])) {
|
switch ($this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'sort'])) {
|
||||||
case self::SORT_HAND:
|
case self::SORT_HAND:
|
||||||
asort($picturesSort);
|
asort($picturesSort);
|
||||||
if ($picturesSort) {
|
if ($picturesSort) {
|
||||||
@ -659,7 +663,7 @@ class gallery extends common {
|
|||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'showBarEditButton' => true,
|
'showBarEditButton' => true,
|
||||||
'title' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(1), 'config', 'name']),
|
'title' => $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'name']),
|
||||||
'view' => 'gallery',
|
'view' => 'gallery',
|
||||||
'style' => $this->getData(['module', $this->getUrl(0), 'theme', 'style'])
|
'style' => $this->getData(['module', $this->getUrl(0), 'theme', 'style'])
|
||||||
]);
|
]);
|
||||||
@ -724,7 +728,9 @@ class gallery extends common {
|
|||||||
'showBarEditButton' => true,
|
'showBarEditButton' => true,
|
||||||
'showPageContent' => true,
|
'showPageContent' => true,
|
||||||
'view' => 'index',
|
'view' => 'index',
|
||||||
'style' => $this->getData(['module', $this->getUrl(0), 'theme', 'style'])
|
'style' => file_exists($this->getData(['module', $this->getUrl(0), 'theme', 'style']))
|
||||||
|
? $this->getData(['module', $this->getUrl(0), 'theme', 'style'])
|
||||||
|
: ''
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user