90 lines
3.5 KiB
PHP
Executable File
90 lines
3.5 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
|
|
if (!isset($isPreview)) $isPreview=0;
|
|
if (isset($debug[1]) && $debug[1] == '1') { $debugMsg .= monDebug(1, ['theIdItem' => $theIdItem, ' isPreview' => $isPreview], '03-generationItemsPage.php');}
|
|
|
|
// -----------------------------------------------------
|
|
// Gérer le lien
|
|
// -----------------------------------------------------
|
|
|
|
if (!empty($theLien2) && $theLien2!='-') {
|
|
if (substr($theLien2,0,2)!="./" && substr($theLien2,1,7)!="Https://") {
|
|
$theLien2=str_replace('../',$server. '/',$theLien2);
|
|
}
|
|
if ($isPreview==1) { $itemPage .="<a href=\"" .$theLien2. "\" target=\"_blank\" ><div id=\"$theIdItem2\" onClick=\"itemSelect(" .$theIdItem2. ");\" "; }
|
|
else { $itemPage .='<a href="' .$theLien2. '" target="_blank" ><div id="' .$theIdItem. '" '; }
|
|
}
|
|
else {
|
|
if ($isPreview==1) $itemPage .="<div id=\"$theIdItem2\" onClick=\"itemSelect(" .$theIdItem2. ");\" ";
|
|
else $itemPage .='<div id="' .$theIdItem2. '" ';
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Gérer la classe
|
|
// -----------------------------------------------------
|
|
if (!empty($theClasse2) && $theClasse2!='aucun' && $theClasse2!='-') {
|
|
$theClasse2=trim($theClasse2);
|
|
if (substr($theClasse2,0,1)=="#") {
|
|
$theClasse2=substr($theClasse2,1,strlen($theClasse2) );
|
|
$itemPage .=' id="' .$theClasse2. '"';
|
|
}
|
|
else {$itemPage .=' class="' .$theClasse2. '"';}
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Gérer le style
|
|
// -----------------------------------------------------
|
|
if (!empty($theStyle2) && $theStyle2!='' && $theStyle2!='-' ) {$itemPage .=' style="' .$theStyle2. '"';}
|
|
|
|
// -----------------------------------------------------
|
|
// Fermer la div
|
|
// -----------------------------------------------------
|
|
$itemPage .='>';
|
|
|
|
// -----------------------------------------------------
|
|
// Gérer le type
|
|
// -----------------------------------------------------
|
|
if (isset($theType2)) {
|
|
switch ($theType2) {
|
|
case 'text':
|
|
if (!empty($theMsg)) $theMsg2=addslashes($theMsg2);
|
|
$itemPage .=($theMsg2) ;
|
|
break;
|
|
|
|
case 'video':
|
|
$itemPage .='<video width="320" height="240" id="bgAudio" controlsList="nodownload" class="bgAudio" controls preload="auto" src="' .$theFichier2. '" type="video/mp4" ></video>';
|
|
break;
|
|
|
|
case 'audio':
|
|
$itemPage .='<audio id="bgAudio" controlsList="nodownload" class="bgAudio" controls preload="auto" src="' .$theFichier2. '" type="audio/mp3" ></audio>';
|
|
break;
|
|
|
|
case 'img':
|
|
if (isset($debug[1]) && $debug[1] == '1') { $debugMsg .= monDebug(1, ['image' => $theFichier2], '');}
|
|
$itemPage .='<img src="' .$theFichier2. '"';
|
|
if (!empty($theStyle2) && $theStyle2!='' && $theStyle2!='-' ) {$itemPage .=' style="' .$theStyle2. ' ;max-width: 100%;"';}
|
|
if (!empty($theClasse2 && $theClasse2!='aucun' && $theClasse2!='-') ) {
|
|
if (substr($theClasse2,0,1)=="#") {
|
|
$theClasse2=substr($theClasse2,1,strlen($theClasse2) );
|
|
$itemPage .=' id="' .$theClasse2. '"';
|
|
}
|
|
else {
|
|
$itemPage .=' class="' .$theClasse2. '"';
|
|
}
|
|
}
|
|
$itemPage .=' />';
|
|
break;
|
|
|
|
case 'page':
|
|
$itemPage .='<iframe src="' .$theLien2. '"></iframe>';
|
|
break;
|
|
}
|
|
}
|
|
else {
|
|
if (isset($debug[1]) && $debug[1] == '1') { $debugMsg .= monDebug(1, ['theType2 no match' => ''], '');}
|
|
}
|
|
$itemPage .="</div>";
|
|
if (!empty($theLien2) && $theLien2!='-')
|
|
{$itemPage .='</a>';}
|
|
?>
|