Application compatible Bootstrap Module de Check
Bonjour,
Je reviens vers vous suite à quelques interrogations sur mon module de Check.
Pour information j'ai choisi le module par défaut avec un layout xml.
J'appelle la page par le lien suivant
Code:
<link rel="stylesheet" href="index.php?:nav=css::style">
dans le layout bootstrap.
Mon code en mode procédural était le suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| <?php
header("Content-type: text/css; charset: UTF-8");
global $findme;
$findme = "<font face='Arial'>Global status : <font color=\"#00FF00\">OK</font>";
?>
<?php
# PLATEFORME SOFT PRODBACKUP
$lienssoftprodbackup = array(
'softprodbackupe1'=>'../index-prod-backup-01-soft-fr.html',
'softprodbackupo2'=>'../index-prod-backup-02-soft-fr.html',
);
foreach ($lienssoftprodbackup as $key => $value) {
switch ($key) {
case 'softprodbackupe1' :
if (file_exists($value)) {
$index = file_get_contents($value);
$pos = stripos($index, $findme);
if ($pos === false) {
$linkColorTabSOFTprodbackup = "#FFCECE";
$linkColorsoftprodbackupe1 = "#FFCECE";
}
else {
$linkColorsoftprodbackupe1 = "";
}
} else {$linkColorsoftprodbackupe1 = "#EEF093";}
break ;
case 'softprodbackupo2' :
if (file_exists($value)) {
$index = file_get_contents($value);
$pos = stripos($index, $findme);
if ($pos === false) {
$linkColorTabSOFTprodbackup = "#FFCECE";
$linkColorsoftprodbackupo2 = "#FFCECE";
}
else {
$linkColorsoftprodbackupo2 = "";
}
} else {$linkColorsoftprodbackupo2 = "#EEF093";}
break ;
}
}
?>
.text-tab-color .tabsoftprodbackup a {background-color: <?php echo $linkColorTabSOFTprodbackup; ?>;}
.softprodbackupe1 a {background-color: <?php echo $linkColorsoftprodbackupe1; ?>;}
.softprodbackupo2 a {background-color: <?php echo $linkColorsoftprodbackupo2; ?>;} |
Questions ?
Je souhaiterai définir la constante mais je ne sais pas dans quelle classe la positionnée ?
http://php.net/manual/fr/language.oop5.constants.php
Ensuite pour le chargement des fichiers, faut mettre le code dans le contrôleur ?
Sinon voici le début du code dans la vue.
Attention les yeux :o) c'est juste pour valider certains processes (remontées des variables(requêtes), boucles et le chargement du fichier css -> vue).
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <?php
header("Content-type: text/css; charset: UTF-8");
global $findme;
$findme = "<font face='Arial'>Global status : <font color=\"#00FF00\">OK</font>";
?>
<?php if($this->tListeAncre):?>
<?php foreach($this->tListeAncre as $oListeAncre):?>
<?php echo "<?php" ?>
$liens<?php echo $oListeAncre->ancretab ?> = array(
<?php foreach($this->tListeCss as $oListeCss):?><?php if($oListeCss->choixonglet_id==$oListeAncre->onglet_id):?>
'<?php echo $oListeCss->diagclass ?>'=>'../<?php echo $oListeCss->urlFile ?>',
<?php endif;?>
<?php endforeach;?>
);
foreach ($liens<?php echo $oListeAncre->ancretab ?> as $key => $value) {
switch ($key) {
<?php foreach($this->tListeCss as $oListeCss):?><?php if($oListeCss->choixonglet_id==$oListeAncre->onglet_id):?>
case '<?php echo $oListeCss->diagclass ?>' :
if (file_exists($value)) {
$index = file_get_contents($value);
$pos = stripos($index, $findme);
if ($pos === false) {
$linkColorTab<?php echo $oListeCss->ancretab ?> = "#FFCECE";
$linkColor<?php echo $oListeCss->diagclass ?> = "#FFCECE";
}
else {
$linkColor<?php echo $oListeCss->diagclass ?> = "";
}
} else {$linkColor<?php echo $oListeCss->diagclass ?> = "#EEF093";}
break ;
<?php endif;?>
<?php endforeach;?>
}
}
?>
<?php foreach($this->tListeCss as $oListeCss):?><?php if($oListeCss->choixonglet_id==$oListeAncre->onglet_id):?>
.text-tab-color .tab<?php echo $oListeAncre->ancretab ?> a {background-color: #FFCECE;}
.<?php echo $oListeCss->diagclass ?> a {background-color: #FFCECE;}
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
<?php else:?>
<tr>
<td colspan="4">Aucune ligne CSS</td>
</tr>
<?php endif;?> |