alpha_full/admin/agencement/bandeau/bandeau.modale.php
2026-04-06 22:58:51 +02:00

250 lines
11 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// -----------------------------------------------------
// Etre admin
// -----------------------------------------------------
if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']=='O' ) {
$thePopup='';
$theAlt='';
$theImage='';
$changerLaLangue=1;
$FIN='NON';
// -----------------------------------------------------
// Post
// -----------------------------------------------------
if (isset($_POST['theAlt'])) {$theAlt=$_POST['theAlt'];}
if (isset($_POST['thePopup'])) {$thePopup=$_POST['thePopup'];}
if (isset($_POST['propager'])) {$propager=$_POST['propager']; }
if (isset($_GET['theImage'])) {$theImage=$_GET['theImage'];}
if (isset($_POST['theImage'])) {$theImage=$_POST['theImage'];}
if (isset($_GET['src'])) { $src=$_GET['src']; }
// -----------------------------------------------------
// Debug
// -----------------------------------------------------
if (isset($debug[1]) && $debug[1] == '1') {include ("bandeauDebug.php");}
if ($codeOpe=="majBandeauImg" || $codeOpe=="majGallerie") {
$uploadOk=1;
// -----------------------------------------------------
// Check du upload image
// -----------------------------------------------------
if (!empty($_FILES["fileToUpload"]["tmp_name"])) {
$target_dir = "../Design/_bandeau/";
$targetExtension =['jpeg', 'jpg', 'png', 'svg', 'bmp'];
$targetSize ='5242880'; //5 Mo
$largeurMax = 0;
$hauteurMax = 0;
$largeurMin = 0;
$hauteurMin = 0;
include ($includePathAdmin. "/_fonctions/uploadGenerique.php");
}
else if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de upload' => $theImage], '');}
// -----------------------------------------------------
// Req UPDATE bandeau image
// -----------------------------------------------------
if($propager!=1 && $uploadOk==1) {
include ("bandeauReqUpdate.php");
}
else {
// Requete up textes
include ("bandeauReqUpdate.php");
// Requete image all
include ("bandeauReqUpdatePropager.php");
//$propager=2; // voir REM ligne 74
}
//if ($erreurSQL!=1) include ($includePathAdmin. "/drapeaux/changementLg.php");
}
// -----------------------------------------------------
// Next langue
// -----------------------------------------------------
if ($codeOpe=="nextLg") {
include ($includePathAdmin. "/drapeaux/changementLg.php");
}
// -----------------------------------------------------
// Requete langueNav Select
// -----------------------------------------------------
include ("bandeauReqSelect.php");
// REM Si on avait saisi un alt ou popup précédement, il revient de la bdd, et ne beneficie pas de la nouvelle saisie qui maintenant est traduite
// donc on propage le alt et popup avec traduction, mais cela implique de propager l'image a chaque fois faute de mieux
// idealement il faudrait un propager image + un propager et traduire mesg
if($propager==1) {
if (isset($_POST['theAlt'])) {$theAlt=$_POST['theAlt'];}
if (isset($_POST['thePopup'])) {$thePopup=$_POST['thePopup'];}
}
// -----------------------------------------------------
// Debug
// -----------------------------------------------------
if (isset($debug[1]) && $debug[1] == '1') {include ("bandeauDebug.php");}
// -----------------------------------------------------
// Form
// -----------------------------------------------------
echo '<form name="bandeauModaleF" id="bandeauModaleF" method="POST" enctype="multipart/form-data" >';
// -----------------------------------------------------
// Zone form
// -----------------------------------------------------
echo '<div id="zoneFormModales" >';
// -----------------------------------------------------
// Champs cachés
// -----------------------------------------------------
echo '<input type="hidden" name="codeOpe" id="codeOpe" value="' .$codeOpe. '" >';
echo '<input type="hidden" name="lg" id="lg" value="' .$lg. '" >';
// -----------------------------------------------------
// Langue drapeaux
// -----------------------------------------------------
echo '<span>';
include ($includePathAdmin. "/drapeaux/drapeauxAff.php");
echo '</span>';
// -----------------------------------------------------
// Popup
// -----------------------------------------------------
echo '<div >';
$title="Entrez un texte pour l'info-bulle qui apparaîtra au survol de la souris";
$thePopup= gTranslate($thePopup, strtolower( substr ($_SESSION['lgCouranteCode'], 0, -1) ) ) ;
echo '<span title="' .$title. '">Info-bulle : </span>';
echo '<input type="text" style="width:50%;" class="inputWebmaster" name="thePopup" value="' .$thePopup. '" title="' .$title. '" />';
echo '</div>';
// -----------------------------------------------------
// Image
// -----------------------------------------------------
include ($includePathAdmin. '/_fonctions/fonction_imageCouleurDeFonds.php');
echo '<div style="text-align:center;" >';
// echo '<span title="Image">Image : </span>';
$theImage2=str_replace("./","../",$theImage);
// determiner la couleur de fonds
$isBright = isImageBright($theImage2);
$backgroundColor = $isBright ? 'grey' : 'white';
echo '<img style="background-color:' .$backgroundColor. '; max-width:60%; max-height:150px" src="' .$theImage2. '" valign="middle" title="' .$thePopup. '" alt="' .$theAlt. '" />&#160;';
// echo 'Chemin actuel :';
echo '<input type="text" class="inputWebmaster" style="width:65%" id="theImage" name="theImage" value="' .$theImage. '" title="Emplacement de l\'image"/>&#160;';
// echo '</div>';
echo '</div>';
// -----------------------------------------------------
// Gallerie
// -----------------------------------------------------
echo '<div style="display:block; width:100%; border:1px solid lightgrey; padding:0px; margin: auto;" >';
// -----------------------------------------------------
// Bouton parcourir
// -----------------------------------------------------
echo '<label for="fileToUpload" >';
echo '<span class="boutonsWebmaster" title="Cliquez ici pour parcourir les dossiers de votre ordinateur. " >';
echo '<i class="fad fa-download"></i>&#160;';
echo 'Parcourir...&#160;</span>';
echo '</label>';
echo '<input style="display:none;" type="file" name="fileToUpload" id="fileToUpload" >';
// Gallerie
echo '<span class="boutonsWebmaster" onClick="document.getElementById(\'iFr\').src =\'../Design/gallerie.php?scope=bandeau&siteDossier=' .$_SESSION['siteDossier']. '&server=' .$_SESSION['server']. '&src=Design&propager=' .$propager. '\';">🖼️ Images du site</span>';
echo '<span class="boutonsWebmaster" onClick="document.getElementById(\'iFr\').src =\'/include/biblio/gallerie.php?scope=bandeau&siteDossier=' .$_SESSION['siteDossier']. '&server=' .$_SESSION['server']. '&src=Biblio&propager=' .$propager. '\';">📚 Bibliothèque</span>';
if (isset( $src)) {
switch ($src) {
case 'Design':
$src=';../Design/gallerie.php?scope=bandeau&siteDossier=' .$_SESSION['siteDossier']. '&server=' .$_SESSION['server']. '&src=Design&propager=' .$propager;
break;
case 'Biblio':
default:
$src='/include/biblio/gallerie.php?scope=bandeau&siteDossier=' .$_SESSION['siteDossier']. '&server=' .$_SESSION['server']. '&src=Biblio&propager=' .$propager;
break;
}
echo '<iframe id="iFr" class="catalogIframe" src="' .$src. '" >';
echo '</iframe>';
}
echo '</div>';
// -----------------------------------------------------
// Modifier le style
// -----------------------------------------------------
echo '<div class="libChampsWebmaster" >';
$volet="Eléments d\'entête";
echo '<span onClick="window.location=\'./frmAdmin.php?affAdmin=3&theVoletCss=' .$volet. '&theNumCss=9\';" class="boutonsWebmaster" title="Cliquez pour changer l\'apparence de l\'image. " >';
echo '<i class="fad fa-feather" style="color:grey;"></i>&#160;';
echo 'Gérer le style de l\'image</span>';
echo '&#160;';
echo '&#160;';
echo '<span onClick="window.location=\'./frmAdmin.php?affAdmin=3&theVoletCss=Structure site&theNumCss=4\';" class="boutonsWebmaster" title="Cliquez pour changer le conteneur. " >';
echo '<i class="fad fa-feather" style="color:grey;"></i>&#160;';
echo 'Gérer le style du conteneur</span>';
echo '&#160;';
echo '</div>';
// -----------------------------------------------------
// Alt
// -----------------------------------------------------
echo '<div class="libChampsWebmaster" style="width:97%;" >';
$title="Entrez un texte pour remplacer l'image si celle-ci ne s'affichait pas";
echo '<span title="' .$title. '">Saisir un texte de remplacement de l\'image : </span>';
$theAlt= gTranslate($theAlt, strtolower( substr ($_SESSION['lgCouranteCode'], 0, -1) ) ) ;
echo '<input type="text" style="width:40%;" class="inputWebmaster" name="theAlt" id="theAlt" value="' .$theAlt. '" title="' .$title. '"/>';
echo '</div>';
echo '</div>'; // zoneFormModales
// -----------------------------------------------------
// Zone validate
// -----------------------------------------------------
echo '<div id="zoneValidateModales" >';
// -----------------------------------------------------
// Propager
// -----------------------------------------------------
echo '<span >Propager la bannière à toutes les langues :';
if($propager!=1) echo '<input onClick="propagation();" type="checkbox" name="propager" id="propager" value="2" title="Propager à toutes les langues" >';
else echo '<input onClick="propagation();" type="checkbox" checked name="propager" id="propager" value="1" title="Propager à toutes les langues" >';
echo '</span><br>';
// -----------------------------------------------------
// Bouton Valider
// -----------------------------------------------------
echo '<span class="boutonsWebmaster" onClick="majBandeauImg();" >';
echo '<i class="fad fa-check-circle"></i>&#160;';
echo'Valider pour ' .$_SESSION['lgCouranteLibelle'];
echo '</span>';
// -----------------------------------------------------
// Bouton next
// -----------------------------------------------------
echo '<div class="boutonsWebmaster" onClick="nextLg();" >';
echo '<i class="fad fa-right"></i>&#160;';
echo 'Langue suivante';
echo '</div>';
// -----------------------------------------------------
// Bouton Fin
// -----------------------------------------------------
echo '<span class="boutonsWebmaster" style="margin:7px;" onClick="window.location=\'siteActif\'" target="_parent" >';
echo '<i class="fad fa-chevron-circle-left"></i>&#160;';
echo 'Retour à l\'agencement';
echo '</span>';
echo '</div>';
echo '</form>';
}
else {
$confPath="../_conf";
include ("./adminInclude/redirectionAdmin.php");
}
?>