73 lines
3.4 KiB
PHP
Executable File
73 lines
3.4 KiB
PHP
Executable File
<?php
|
|
|
|
// -----------------------------------------------------
|
|
// Recup des valeurs generiques
|
|
// -----------------------------------------------------
|
|
$globalBgColor='';
|
|
$globalFontColor='';
|
|
$themeBgColor='';
|
|
$themeFontColor='';
|
|
|
|
if ($themeDesign!="-----------" && $themeDesign!="") {
|
|
$reqSelect="SELECT bgColor,fontColor FROM `design` WHERE description='Global' AND idTheme=" .$_SESSION['idTheme']. " ;";
|
|
$result='';
|
|
$resConn='';
|
|
// Debug
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['reqSelect 1 ' => $reqSelect], 'coulGeneReqSelectDesign.php');}
|
|
$resConn=$idPdo->query($reqSelect) ;
|
|
$i=0;
|
|
while ($result=$resConn->fetch(PDO::FETCH_BOTH)) {
|
|
$globalBgColor=$result['bgColor'];
|
|
$globalFontColor=$result['fontColor'];
|
|
if (isset($globalBgColor)) {
|
|
$test=strpos($globalBgColor,'gradient' );
|
|
if ($test === false ) {$test=strpos($globalBgColor,'linear');}
|
|
if ($test === false ) {$test=strpos($globalBgColor,'transparent');}
|
|
if ($test === false ) {$test=strpos($globalBgColor,'inherit');}
|
|
}
|
|
if (substr($globalBgColor, 0,1)!="#" && strlen($globalBgColor)> 1 && $test === false ) $globalBgColor="#" .$globalBgColor;
|
|
if (isset($globalFontColor)) {
|
|
$test=strpos($globalFontColor,'gradient');
|
|
if (substr($globalFontColor, 0,1)!="#" && strlen($globalFontColor)> 1 && $test === false && $globalFontColor !="inherit") $globalFontColor="#" .$globalFontColor;
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['globalBgColor' => $globalBgColor,'globalFontColor' => $globalFontColor], '');}
|
|
}
|
|
$i++;
|
|
} //while
|
|
|
|
$result='';
|
|
$resConn='';
|
|
$reqSelect2="SELECT bgColor,fontColor FROM `design` WHERE description ='" .$themeDesign. "' AND idTheme=" .$_SESSION['idTheme']. " ;";
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['reqSelect 2' => $reqSelect2], '');}
|
|
$resConn=$idPdo->query($reqSelect2) ;
|
|
$i=0;
|
|
while ($result=$resConn->fetch(PDO::FETCH_BOTH)) {
|
|
$themeBgColor=$result['bgColor'];
|
|
$themeFontColor=$result['fontColor'];
|
|
$test=strpos($themeBgColor,'gradient');
|
|
$test=strpos($themeBgColor,'inherit');
|
|
if (substr($themeBgColor, 0,1)!="#" && strlen($themeBgColor)> 1 && $test === false ) $themeBgColor="#" .$themeBgColor;
|
|
|
|
$test=strpos($themeFontColor,'gradient');
|
|
$test=strpos($themeFontColor,'inherit');
|
|
if (substr($themeFontColor, 0,1)!="#" && strlen($themeFontColor)> 1 && $test === false) $themeFontColor="#" .$themeFontColor;
|
|
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['themeBgColor' => $themeBgColor,'themeFontColor' => $themeFontColor], '');}
|
|
|
|
$i++;
|
|
} //while
|
|
$_SESSION['globalBgColor']=$globalBgColor;
|
|
$_SESSION['globalFontColor']=$globalFontColor;
|
|
$_SESSION['themeBgColor']=$themeBgColor;
|
|
$_SESSION['themeFontColor']=$themeFontColor;
|
|
}
|
|
else {
|
|
// -----------------------------------------------------
|
|
// Recup des valeurs generiques
|
|
// -----------------------------------------------------
|
|
// $globalBgColor=$_SESSION['globalBgColor'];
|
|
// $globalFontColor=$_SESSION['globalFontColor'];
|
|
// $themeBgColor=$_SESSION['themeBgColor'];
|
|
// $themeFontColor=$_SESSION['themeFontColor'];
|
|
if (isset($debug[1]) && $debug[1] == '1') { $debugMsg .= monDebug(1, ['themeDesign vide =' => $theVoletCss], 'coulGeneReqSelectDesign.php');}
|
|
}
|
|
?>
|