79 lines
3.8 KiB
PHP
Executable File
79 lines
3.8 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
echo '<script type="text/javascript" src="./agencement/preview/preview.js" ></script>';
|
|
|
|
echo '<div>';
|
|
// Debug
|
|
if (isset($debug[1]) && $debug[1] == '1') $debugMsg .= monDebug(1, ['theIdPage' => $theIdPage, 'theIdItem' =>$theIdItem, 'numeroMenuPrpal' =>$numeroMenuPrpal],'pagesPreview.php');
|
|
|
|
if ($theIdPage!='') {
|
|
include ("./agencement/blocDroit/pages/page/reqPage/pageReqSelect.php");
|
|
include ("./agencement/blocDroit/pages/items/reqItem/itemReqListeSelect.php"); // pour voir si il en existe au moins 1
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Select
|
|
// -----------------------------------------------------
|
|
$title="Les contenus selectionnés sont encadrés en orange";
|
|
echo '<div class="libChampsWebmaster" title="' .$title. '" style="margin: 1px; padding:7px; border:1px solid #daeff8" >Sélectionnez un contenu de la page : ';
|
|
|
|
// echo '<select class="selectWbm" name="theIdItem2" id="theIdItem2" onChange="window.top.location.href=\'./frmAdmin.php?affAdmin=' .$affAdmin. '&textesAffSection=' .$textesAffSection. '&idLanguenav=' .$idLanguenav. '&nomCss=' .$nomCss. '&agencementOnglet=4&numeroMenuPrpal=' .$numeroMenuPrpal. '&numeroSousMenu=' .$numeroSousMenu. '&theVoletCss=' .$theVoletCss. '&theNumCss=' .$theNumCss. '&theIdItem=\' + this.value + \'&previewObject=' .$previewObject. '&theIdPage=' .$theIdPage. '&theIdItem=' .$theIdItem.'\'" >';
|
|
|
|
echo '<select class="selectWbm" id="selectIdItem" onChange="itemSelect(this.value);" >';
|
|
for ($i=0; $i < count($tabIdItem); $i++) {
|
|
if ($theIdItem==$tabIdItem[$i]) {
|
|
echo '<option value="' .$tabIdItem[$i]. '" selected>' .$tabNomItem[$i]. '</option>';
|
|
// echo '<option value="' .$tabIdItem[$i]. '" selected>' .$tabNomItem[$i]. ' (' .$tabIdItem[$i]. ')'.'</option>';
|
|
}
|
|
else {
|
|
echo '<option value="' .$tabIdItem[$i]. '" >' .$tabNomItem[$i]. ' (' .$tabIdItem[$i]. ')'.'</option>';
|
|
}
|
|
}
|
|
echo '</select>';
|
|
$nbI=count($tabIdItem);
|
|
|
|
echo '<input type="hidden" id="nbI" value="' .$nbI. '" />';
|
|
echo ' Il y a ' .$nbI. ' contenu(s) dans la page';
|
|
echo '</div>';
|
|
|
|
// -----------------------------------------------------
|
|
// Page preview
|
|
// -----------------------------------------------------
|
|
echo '<div id="framePreview" style=" text-align:center; margin:5px;" >';
|
|
// include ("../blocDroit/pages/page/reqPage/pageReqSelect.php");
|
|
$theChemin=".";
|
|
$theFinalFic = $theChemin .$theEmplacement .$theFicPage;
|
|
|
|
// Debug
|
|
if (isset($debug[1]) && $debug[1] == '1' ) {
|
|
$debugMsg .= monDebug (1, ['theIdPage= ' => $theIdPage, 'theChemin' =>$theChemin, 'theEmplacement' =>$theEmplacement, 'theFicPage' => $theFicPage, 'theFinalFic' =>$theFinalFic ],'');
|
|
}
|
|
if (file_exists( $theFinalFic )) {
|
|
if (file_get_contents($theFinalFic) === false) {
|
|
if (isset($debug[1]) && $debug[1] == '1' ) $debugMsg .= monDebug (1, ['recup du fichier non possible (file_get_contents)' =>$theFinalFic ],'');
|
|
}
|
|
else {
|
|
// include($theFinalFic);
|
|
|
|
$lire = file_get_contents($theFinalFic);
|
|
$lire = str_replace('$nomFicAppelant = basename(__FILE__)', '', $lire);
|
|
$lire = str_replace('<?php', '', $lire);
|
|
$lire = str_replace('?>', '', $lire);
|
|
$lire = str_replace('echo ', '', $lire);
|
|
$lire = str_replace(';' , '', $lire);
|
|
|
|
$lire = str_replace('\'', '', $lire);
|
|
$lire = str_replace('./', '../', $lire);
|
|
|
|
if (isset($debug[1]) && $debug[1] == '1' ) $debugMsg .= ' | Lire= ' .$lire;
|
|
}
|
|
}
|
|
else {
|
|
if (isset($debug[1]) && $debug[1] == '1' ) $debugMsg .= monDebug (1, ['Attention ! emplacement invalide' =>$theFinalFic],'');
|
|
$admMsg .= 'Attention ! emplacement invalide : '.$theFinalFic;
|
|
}
|
|
if (!empty($lire)) echo $lire;
|
|
echo '</div>';
|
|
echo '</div>';
|
|
echo '<script type="text/javascript"> encadreItem(\''.$theIdItem.'\'); </script>';
|
|
?>
|