alpha_full/admin/maint/constr/construction.modale.php
2026-04-06 22:58:51 +02:00

246 lines
12 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// -----------------------------------------------------
// Etre admin
// -----------------------------------------------------
if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']=='O' ) {
// -----------------------------------------------------
// Init
// -----------------------------------------------------
$theAlt='';
$thePopup='';
$theMsg='';
$propager='';
$afficher=0;
if (empty($tableLangueCode) or $refresh=='Oui') { include ($includePath. "/req/03-init.langueActives.php"); }include ($includePath. "/req/03-init.langueActives.php");
// -----------------------------------------------------
// Post
// -----------------------------------------------------
if (isset($_POST['theAlt'])) {$theAlt=$_POST['theAlt'];}
if (isset($_POST['thePopup'])) {$thePopup=$_POST['thePopup'];}
if (isset($_GET['theImage'])) {$theImage=$_GET['theImage'];}
if (!empty($_POST['theImage'])) {$theImage=$_POST['theImage'];}
if (!empty($_POST['theMsg'])) {$theMsg=$_POST['theMsg'];}
if (isset($_POST['propager'])) {$propager=$_POST['propager']; $_SESSION['propager']=$propager; }
if (isset($_POST['afficher'])) {$afficher=$_POST['afficher']; }
if ($codeOpe=='valider' || $codeOpe=='majGallerie') {
$uploadOk=1;
// -----------------------------------------------------
// upload
// -----------------------------------------------------
if (!empty($_FILES["fileToUpload"]["tmp_name"])) {
$target_dir = "../Design/_constr/";
$targetExtension =['jpeg', 'jpg', 'png', 'bmp', 'svg' ];
$targetSize ='5242880'; //5 Mo
$largeurMax = 0;
$hauteurMax = 0;
$largeurMin = 0;
$hauteurMin = 0;
include ($includePathAdmin. "/_fonctions/uploadGenerique.php");
}
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de upload' => $theImage], 'construction.modale=.php');}
// -----------------------------------------------------
// req UPDATE
// -----------------------------------------------------
if($uploadOk==1) {
include ("constrReqUpdate.php");
}
}
// -----------------------------------------------------
// Requete langueNav Select
// -----------------------------------------------------
include ("constrReqSelect.php");
// -----------------------------------------------------
// Debug
// -----------------------------------------------------
if (isset($debug[1]) && $debug[1] == '1' ) {include ("constr.debug.php");}
// -----------------------------------------------------
// Form
// -----------------------------------------------------
echo '<form name="constrF" id="constrF" method="POST" enctype="multipart/form-data" >';
echo '<div id="zoneFormModales" >';
// -----------------------------------------------------
// Langue drapeaux
// -----------------------------------------------------
echo '<span>';
include ($includePathAdmin. "/drapeaux/drapeauxAff.php");
echo '</span>';
// -----------------------------------------------------
// Champs cachés
// -----------------------------------------------------
echo '<input type="hidden" name="codeOpe" id="codeOpe" value="' .$codeOpe. '" >';
echo '<input type="hidden" name="lg" id="lg" value="' .$lg. '" >';
// -----------------------------------------------------
// Afficher
// -----------------------------------------------------
echo '<span class="libChampsWebmaster">Afficher le message suivant : ';
if($afficher==1) $checked="checked"; else $checked="";
echo '<input onClick="valider();" type="checkbox" '.$checked.' name="afficher" value="1" title="Afficher un message" >';
echo '</span>';
// -----------------------------------------------------
// Message
// -----------------------------------------------------
echo '<div class="libChampsWebmaster" >';
$title="Entrez un texte pour le message";
echo '<span title="' .$title. '">Message : </span>';
$theMsg= gTranslate($theMsg, strtolower( substr ($_SESSION['lgCouranteCode'], 0, -1) ) ) ;
echo '<textarea style="resize:both; overflow:visible; white-space:normal; width:95%; min-height:100px;" class="inputWebmaster" name="theMsg" value="' .$theMsg. '" title="' .$title. '" >' .$theMsg. '</textarea>';
echo '</div>';
// -----------------------------------------------------
// Infobulle
// -----------------------------------------------------
echo '<div class="libChampsWebmaster" >';
$title="Entrez un texte pour l'info-bulle qui apparaîtra au survol de la souris sur l'image";
echo '<span title="' .$title. '">Info-bulle : </span>';
$thePopup= gTranslate($thePopup, strtolower( substr ($_SESSION['lgCouranteCode'], 0, -1) ) ) ;
echo '<input type="text" style="width:250px;" class="inputWebmaster" name="thePopup" value="' .$thePopup. '" title="' .$title. '" />';
echo '</div>';
// -----------------------------------------------------
// Propager
// -----------------------------------------------------
echo '<span class="libChampsWebmaster">Propager à toutes les langues :';
if($propager!=1) echo '<input onClick="propagation(\''.$_SESSION['lgCouranteLibelle'].'\');" type="checkbox" name="propager" id="propager" value="2" title="Propager à toutes les langues" >';
else echo '<input onClick="propagation(\''.$_SESSION['lgCouranteLibelle'].'\');" type="checkbox" checked name="propager" id="propager" value="1" title="Propager à toutes les langues" >';
echo '</span>';
// -----------------------------------------------------
// Image
// -----------------------------------------------------
echo '<div class="libChampsWebmaster" >';
echo '<span>Image : </span>';
$trouve=0;
$test=strtolower(substr($theImage,-3));
if ($test=='bmp' || $test=='jpg' || $test=='peg' || $test=='png' ) $trouve=1;
if ($trouve==1)
echo '<img class="inputWebmaster" style="max-width:50px;" src=".' .$theImage. '" valign="middle" title="' .$thePopup. '" alt="' .$theAlt. '" />';
else
echo '<span class="' .$theImage. ' inputWebmaster" valign="middle" title="' .$thePopup. '" alt="' .$theAlt. '" ></span>';
// -----------------------------------------------------
// Chemin + parcourir
// -----------------------------------------------------
echo '<br>';
echo '<span>';
echo '&#160;Chemin actuel : </span>';
echo '<input type="text" style="width:45%;" class="inputWebmaster" id="theImage" name="theImage" value="' .$theImage. '" title="Emplacement de l\'image"/>&#160;';
// -----------------------------------------------------
// Choisir un fichier
// -----------------------------------------------------
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;';
echo '</label>';
echo '<input style="display:none;" type="file" name="fileToUpload" id="fileToUpload" >';
echo '</span>';
echo '</div>';
// -----------------------------------------------------
// Alt
// -----------------------------------------------------
echo '<div class="libChampsWebmaster" >';
$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" class="inputWebmaster" name="theAlt" id="theAlt" value="' .$theAlt. '" title="' .$title. '" >';
echo '</div>';
// -----------------------------------------------------
// Gallerie
// -----------------------------------------------------
echo '<div style="display:block; width:100%; border:1px solid lightgrey; padding:0px; margin: auto;"><span class="libChampsWebmaster" >Bibliothèques : </span>';
echo '<span class="boutonsWebmaster" onClick="document.getElementById(\'iFr\').src =\'../Design/gallerie.php?scope=maint&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=maint&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=maint&siteDossier=' .$_SESSION['siteDossier']. '&server=' .$_SESSION['server']. '&src=Design&propager=' .$propager;
break;
case 'Biblio':
default:
$src='/include/biblio/gallerie.php?scope=maint&siteDossier=' .$_SESSION['siteDossier']. '&server=' .$_SESSION['server']. '&src=Biblio&propager=' .$propager;
break;
}
echo '<iframe id="iFr" class="catalogIframe" src="' .$src. '" >';
echo '</iframe>';
}
echo '</div>';
echo '</div>';
// -----------------------------------------------------
// Zone validate
// -----------------------------------------------------
echo '<div id="zoneValidateModales" style="display:flex; flex-wrap:wrap; height:auto;" class="flexToColumn" >';
// -----------------------------------------------------
// Bouton modifier le style
// -----------------------------------------------------
$volet="Eléments d\'entête";
if (!empty($volet)) $volet=addslashes ($volet);
echo '<span class="boutonsWebmaster" onClick="window.location=\'./frmAdmin.php?affAdmin=3&theVoletCss=' .$volet. '&theNumCss=3\';" 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';
echo '</span>';
// -----------------------------------------------------
// Aller dans le contenu
// -----------------------------------------------------
echo '<span class="boutonsWebmaster" onClick="window.location=\'./frmAdmin.php?affAdmin=4&textesAffSection=2&sectionAff=section315\'" >';
echo '<i class="fad fa-edit"></i>';
echo 'Aller dans le contenu correspondant';
echo '</span>';
// -----------------------------------------------------
// Bouton valider
// -----------------------------------------------------
echo '<span class="boutonsWebmaster" onClick="valider();" >';
echo '<i class="fad fa-check-circle"></i>&#160;';
echo '<span id="btnV"> Valider pour ' .$_SESSION['lgCouranteLibelle'].'</span>';
echo '</span>';
// -----------------------------------------------------
// Bouton next
// echo '<span class="boutonsWebmaster" onClick="nextLg();" >';
// echo '<i class="fad fa-right"></i>&#160;';
// echo 'Langue suivante';
// echo '</span>';
// -----------------------------------------------------
// Bouton retour
// -----------------------------------------------------
echo '<span class="boutonsWebmaster" onClick="window.location=\'./frmAdmin.php?affAdmin=13\'" target="_top" >';
echo '<i class="fad fa-chevron-circle-left"></i>&#160;';
echo 'Retour';
echo '</span>';
echo '</div>'; //zoneValidateModales
echo '</form>';
}
else {
$confPath="../_conf";
include ("./adminInclude/redirectionAdmin.php");
}
?>