Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3836 → Rev 3837

/trunk/widget/modules/photo/squelettes/popup.tpl.html
264,9 → 264,10
</div>
<div id="info-img-galerie" class="carousel col-lg-8 col-12" data-ride="carousel" data-interval="false">
<div class="carousel-inner h-100 w-100">
<?php for($index = $start; $index < ($start + $max_photo); $index++) :?>
<?php $urls = array_keys($infos_images); ?>
<?php for($index = 0; $index < count($urls); $index++):?>
<div id="img-cadre-<?php echo $index; ?>" class="carousel-item">
<img id="illustration-<?php echo $index;?>" class="d-block align-middle" src="<?php echo $urls[$index];?>" alt="" data-width="<?php echo $infos_images[$urls[$index]]['width'];?>" data-height="<?php echo $infos_images[$urls[$index]]['height'];?>">
<img id="illustration-<?php echo $index;?>" class="d-block align-middle" src="<?php echo $urls[$index];?>" alt="" data-width="<?php echo $infos_image[$urls[$index]]['width'];?>" data-height="<?php echo $infos_image[$urls[$index]]['height'];?>">
</div>
<?php endfor; ?>
<a id="precedent" class="carousel-control-prev carousel-control" href="#info-img-galerie" role="button" data-slide="prev">
294,11 → 295,12
<script type="text/Javascript">
//<![CDATA[
var widgetProp = {
'keys':[<?php echo '"'.implode($keys, '","').'"'; ?>],
'urlWidget' : "<?php echo $url_widget; ?>",
'urls' : [<?php echo '"'.implode($urls, '","').'"'; ?>],
'infos_images' : <?php echo json_encode($infos_images); ?>,
'indexImage' : <?php echo $start ;?>,
'infosImages' : <?php echo json_encode($infos_images); ?>,
'urlImage' : "<?php echo $url_image; ?>",
'indexPremiereImage' : <?php echo array_search($url_image, $urls); ?>,
'tailleMax' : 580,
'popupUrl' : "<?php echo $popup_url; ?>",
'urlBaseTelechargement' : "<?php echo $url_base_telechargement; ?>",
/trunk/widget/modules/photo/squelettes/js/WidgetPhotoPopup.js
2,10 → 2,10
if( this.valOk( proprietes ) ) {
this.urlWidget = proprietes.urlWidget;
this.urls = proprietes.urls;
this.infos_images = proprietes.infos_images;
this.indexPremiereImage = proprietes.indexImage;
this.infosImages = proprietes.infosImages;
this.urlImage = proprietes.urlImage;
this.indexPremiereImage = proprietes.indexPremiereImage;
this.indexImage = this.indexPremiereImage;
this.urlImage = proprietes.urlImage;
this.tailleMax = proprietes.tailleMax;
this.popupUrl = proprietes.popupUrl;
this.urlBaseTelechargement = proprietes.urlBaseTelechargement;
19,17 → 19,11
 
WidgetPhotoPopup.prototype.initTpl = function() {
this.redimensionnerGalerie();
if( this.valOk( this.urlImage, false, 'null' ) ) {
$( '#info-img-galerie' ).find( '.active' ).removeClass( 'active' );
$( '#img-cadre-' + this.indexImage + ',#indicateur-img-' + this.indexImage ).addClass( 'active' );
 
this.indexImage = this.indexPremiereImage + this.urls.indexOf( this.urlImage );
console.log(this.indexImage);
this.mettreAJourPopup();
 
$( '#info-img-galerie' ).find( '.active' ).removeClass( 'active' );
$( '#img-cadre-' + this.indexImage + ',#indicateur-img-' + this.indexImage ).addClass( 'active' );
 
this.mettreAJourPopup();
}
 
this.redimentionnerModaleCarousel();
};
 
53,7 → 47,7
};
 
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
this.item = this.infos_images[this.urls[this.indexImage]];
this.item = this.infosImages[this.urls[this.indexImage]];
this.titreImage = this.item['titre'];
this.urlLienEflore = this.item['lien'];
this.idImage = this.item['id_photo'];
220,16 → 214,15
};
 
WidgetPhotoPopup.prototype.defilerImage = function( sens ) {
let indexDerniereImage = this.indexPremiereImage + this.urls.length;
if ( 'suivant' === sens ) {
this.indexImage++ ;
if( this.indexImage >= indexDerniereImage ) {
if( this.indexImage >= this.urls.length ) {
this.indexImage = 0;
}
} else if ( 'precedent' === sens ) {
this.indexImage--;
if( this.indexImage <= 0 ) {
this.indexImage = indexDerniereImage -1;
this.indexImage = this.urls.length -1;
}
}
// @TODO: Modifier l'attr content de 'meta[property=og:image]' et y mettre l'url de l'image
/trunk/widget/modules/photo/Photo.php
139,10 → 139,8
session_start();
 
$galerie_id = $_GET['galerie_id'];
 
$widget['donnees']['url_image'] = $_GET['url_image'];
$widget['donnees']['infos_images'] = $_SESSION[$galerie_id]['infos_images'];
$widget['donnees']['urls'] = $_SESSION[$galerie_id]['urls'];
$widget['donnees']['url_widget'] = $this->url_widget;
$widget['donnees']['url_css'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], 'modules/photo/squelettes/css/');
$widget['donnees']['url_js'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], 'modules/photo/squelettes/js/');
188,8 → 186,6
 
 
private function executerPhoto() {
session_start();
 
$widget = null;
 
$this->parametres['start'] = $this->parametres['start'] ?? self::START_DEFAUT;
254,7 → 250,7
$widget['donnees']['icone_rss'] = $icone_rss;
$widget['donnees']['champ_recherche'] = $champ_recherche;
$widget['donnees']['start'] = $start;
$widget['donnees'] ['limit'] = $limit;
$widget['donnees']['limit'] = $limit;
$widget['donnees']['utilise_fancybox'] = $utilise_fancybox;
$widget['donnees']['prod'] = ($this->config['parametres']['modeServeur'] === 'prod');
 
262,8 → 258,12
$galerie_id = md5(http_build_query($_GET));
$widget['donnees']['galerie_id'] = $galerie_id;
 
foreach ($tableau['images'] as $image) {
if ($num == $max_photo) {
session_start();
$_SESSION[$galerie_id]['max_photo'] = $max_photo;
$_SESSION[$galerie_id]['start'] = $start;
 
foreach ($tableau['images'] as $key => $image) {
if ($key == $max_photo) {
break;
}
$item = $image;
278,7 → 278,7
$item['id_photo_formate'] = sprintf('%09d', $image['id_photo']);
$item['urlProfil'] = sprintf($this->config['photo']['tbProfilUrlTpl'], $image['utilisateur']['id_utilisateur'] );
// Ajout aux items et si première photo à extra
if ($num == 0) {
if ($key == 0) {
$widget['donnees']['extra'] = $item;
 
}
288,9 → 288,7
$image_size = getimagesize($url_galerie_popup);
$item['width'] = $image_size[0];
$item['height'] = $image_size[1];
$_SESSION[$galerie_id]['urls'][] = $url_galerie_popup;
$_SESSION[$galerie_id]['max_photo'] = $max_photo;
$_SESSION[$galerie_id]['start'] = $start;
 
$_SESSION[$galerie_id]['infos_images'][$url_galerie_popup] = $item;
}
 
316,7 → 314,7
'tag',
'non_standard',
'indesirable',
'pn_smartphone_anonyme',
//on dégage smartfone anonyme PN
'recherche',
'date',
'motcle',