Méthode initialisation
This commit is contained in:
parent
485407f405
commit
2b22e0ddb6
@ -17,9 +17,8 @@
|
|||||||
class geogallery extends common
|
class geogallery extends common
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const VERSION = '0.4';
|
||||||
const VERSION = '0.3';
|
const REALNAME = 'Géogalerie';
|
||||||
const REALNAME = 'Géo galerie';
|
|
||||||
const DATADIRECTORY = self::DATA_DIR . 'geogallery/';
|
const DATADIRECTORY = self::DATA_DIR . 'geogallery/';
|
||||||
|
|
||||||
const SORT_ASC = 'SORT_ASC';
|
const SORT_ASC = 'SORT_ASC';
|
||||||
@ -338,14 +337,8 @@ class geogallery extends common
|
|||||||
|
|
||||||
// Liste des galeries
|
// Liste des galeries
|
||||||
if (is_null($this->getData(['module', $this->getUrl(0), 'content']))) {
|
if (is_null($this->getData(['module', $this->getUrl(0), 'content']))) {
|
||||||
// Valeurs en sortie
|
$this->setData(['module', $this->getUrl(0), 'content', []]);
|
||||||
$this->addOutput([
|
} elseif (!empty($locations)) {
|
||||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
|
||||||
'notification' => helper::translate('Paramétres'),
|
|
||||||
'state' => true
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
$galleries = array_keys($this->getData(['module', $this->getUrl(0), 'content']));
|
$galleries = array_keys($this->getData(['module', $this->getUrl(0), 'content']));
|
||||||
foreach ($galleries as $key => $gallery) {
|
foreach ($galleries as $key => $gallery) {
|
||||||
$directory = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'directory']);
|
$directory = $this->getData(['module', $this->getUrl(0), 'content', $gallery, 'config', 'directory']);
|
||||||
@ -431,8 +424,6 @@ class geogallery extends common
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affichage du template
|
|
||||||
if (self::$galleries) {
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'showBarEditButton' => true,
|
'showBarEditButton' => true,
|
||||||
@ -442,7 +433,6 @@ class geogallery extends common
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Fonction pour convertir les coordonnées GPS au format décimal
|
// Fonction pour convertir les coordonnées GPS au format décimal
|
||||||
|
@ -19,7 +19,7 @@ class geolocation extends common
|
|||||||
|
|
||||||
|
|
||||||
const VERSION = '0.1';
|
const VERSION = '0.1';
|
||||||
const REALNAME = 'Géo Evénements';
|
const REALNAME = 'GéoLocalisation';
|
||||||
const DATADIRECTORY = self::DATA_DIR . 'geolocation/';
|
const DATADIRECTORY = self::DATA_DIR . 'geolocation/';
|
||||||
|
|
||||||
const SORT_ASC = 'SORT_ASC';
|
const SORT_ASC = 'SORT_ASC';
|
||||||
@ -224,13 +224,8 @@ class geolocation extends common
|
|||||||
|
|
||||||
// Affichage du template si les données sont disponibles sinon redirection vers la configuration
|
// Affichage du template si les données sont disponibles sinon redirection vers la configuration
|
||||||
if (is_null($locations)) {
|
if (is_null($locations)) {
|
||||||
// Valeurs en sortie
|
$this->setData(['module', $this->getUrl(0), 'content', []]);
|
||||||
$this->addOutput([
|
} elseif (!empty($locations)) {
|
||||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/add',
|
|
||||||
'notification' => helper::translate('Paramétres'),
|
|
||||||
'state' => true
|
|
||||||
]);
|
|
||||||
} else {
|
|
||||||
// Lecture des données
|
// Lecture des données
|
||||||
foreach ($locations as $locationsId => $datas) {
|
foreach ($locations as $locationsId => $datas) {
|
||||||
self::$locations[] = $datas;
|
self::$locations[] = $datas;
|
||||||
@ -272,11 +267,9 @@ class geolocation extends common
|
|||||||
'long' => $centerLong,
|
'long' => $centerLong,
|
||||||
'zoom' => $zoomLevel
|
'zoom' => $zoomLevel
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'showBarEditButton' => true,
|
'showBarEditButton' => true,
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::textarea('locationAddDescription', [
|
<?php echo template::textarea('locationAddDescription', [
|
||||||
'label' => 'Description',
|
'label' => 'Description',
|
||||||
'class' => 'editorWysiwyg'
|
'class' => 'editorWysiwygComment'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<?php echo template::textarea('locationEditDescription', [
|
<?php echo template::textarea('locationEditDescription', [
|
||||||
'label' => 'Description',
|
'label' => 'Description',
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'description']),
|
'value' => $this->getData(['module', $this->getUrl(0), 'content', $this->getUrl(2), 'description']),
|
||||||
'class' => 'editorWysiwyg'
|
'class' => 'editorWysiwyComment'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php if ($module::$locations): ?>
|
<?php if ($module::$locations): ?>
|
||||||
<div id="map"></div>
|
<div id="map"></div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php echo template::speech('PAs d\'événement à afficher'); ?>
|
<?php echo template::speech('Rien à afficher'); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
Loading…
Reference in New Issue
Block a user