Browse Source

mise à jour des fonctions

master
pierrekuhn87 4 months ago
parent
commit
6b16d0e4af
  1. 14
      inc/spipr_educ_gestion_margin.php

14
inc/spipr_educ_gestion_margin.php

@ -1,7 +1,7 @@
<?php
// Ajout de margin pour les layout des largeurs sup�rieures � 1200px
// Ajout de margin pour les layout des largeurs supérieures à 1200px
function spipr_educ_gestion_margin_1200($layout) {
$tab = array(
$tab = array(
'7' => '@media (min-width: 1200px) { #aside { margin-left:-1140px; } #extra { width:210px; margin-left:-240px; } #content { margin-left:330px; } .header .spip_logos {margin-left:30px;} .header .spip_logos {margin-left:30px;} .footer {padding-left:30px;padding-right:30px;} } ',
'8' => '@media (min-width: 1200px) { #extra { margin-left:-1140px; width:210px; } #aside { margin-left:-300px; } #content { margin-left:270px; } .header .spip_logos {margin-left:30px;} .header .spip_logos {margin-left:30px;} .footer {padding-left:30px;padding-right:30px;} } ',
'9' => '@media (min-width: 1200px) { #extra { width:210px; margin-left:-240px; } #aside { margin-left:-540px; } #content { margin-left:30px; } .header .spip_logos {margin-left:30px;} .header .spip_logos {margin-left:30px;} .footer {padding-left:30px;padding-right:30px;} } ',
@ -14,11 +14,13 @@ function spipr_educ_gestion_margin_1200($layout) {
'36' => '@media (min-width: 1200px) { #extra { width:770px; margin-left:30px; } #aside { width:310px; margin-right:30px; } #content { margin-left:30px; } .header .spip_logos {margin-left:30px;} .header .spip_logos {margin-left:30px;} .footer {padding-left:30px;padding-right:30px;} } ',
'37' => '@media (min-width: 1200px) { #extra { width:1110px; margin-right:30px; margin-left:30px; } #aside { width:310px; margin-right:30px; } #content { margin-left:30px; } .header .spip_logos {margin-left:30px;} .header .spip_logos {margin-left:20px;} .footer {padding-left:30px;padding-right:30px;} } ',
'38' => '@media (min-width: 1200px) { #extra { width:1110px; margin-right:30px; margin-left:30px; } #aside { width:310px; margin-left:30px; } #content { margin-left:30px; margin-right:30px; } .header .spip_logos {margin-left:30px;} .header .spip_logos {margin-left:20px;} .footer {padding-left:30px;padding-right:30px;} } ',
'39' => '@media (min-width: 1200px) { #content {width:1140px; margin-left:30px; margin-right:30px;} #aside {width:550px; margin-left:30px;} #extra {width:550px; margin-right:30px;} #footer{padding-left:30px;padding-right:30px;} .header .spip_logos {margin-left:30px;} }',
'40' => '@media (min-width: 1200px) { #content {width:1140px; margin-left:30px; margin-right:30px;} #aside {width:550px; margin-right:30px;} #extra {width:550px; margin-left:30px;} #footer{padding-left:30px;padding-right:30px;} .header .spip_logos {margin-left:30px;} }',
);
return $tab[$layout];
}
function spipr_educ_gestion_margin_980_1199($layout) {
$tab = array(
$tab = array(
'7' => '@media (min-width: 980px) and (max-width: 1199px) { #aside { margin-left:-920px; } #extra { width:180px; margin-left:-200px; } #content { margin-left:260px; } .header .spip_logos {margin-left:20px;} .footer {padding-left:20px;padding-right:20px;} }',
'8' => '@media (min-width: 980px) and (max-width: 1199px) { #extra { margin-left:-920px; width:180px; } #aside { margin-left:-240px; } #content { margin-left:220px; } .header .spip_logos {margin-left:20px;} .footer {padding-left:20px;padding-right:20px;} }',
'9' => '@media (min-width: 980px) and (max-width: 1199px) { #extra { width:180px; margin-left:-200px; } #aside { margin-left:-440px; } #content { margin-left:20px; } .header .spip_logos {margin-left:20px;} .footer {padding-left:20px;padding-right:20px;} }',
@ -31,6 +33,8 @@ function spipr_educ_gestion_margin_980_1199($layout) {
'36' => '@media (min-width: 980px) and (max-width: 1199px) { #extra { width:620px; margin-right:20px; } #aside { width:250px; margin-left:20px; } #content { margin-right:20px; } .header .spip_logos {margin-left:20px;} .footer {padding-left:20px;padding-right:20px;} }',
'37' => '@media (min-width: 980px) and (max-width: 1199px) { #extra { width:900px; margin-right:20px; margin-left:20px; } #aside { width:250px; margin-right:20px; } #content { margin-left:20px; } .header .spip_logos {margin-left:20px;} .footer {padding-left:20px;padding-right:20px;} }',
'38' => '@media (min-width: 980px) and (max-width: 1199px) { #extra { width:900px; margin-right:20px; margin-left:20px; } #aside { width:250px; margin-left:20px; } #content { margin-right:20px; } .header .spip_logos {margin-left:20px;} .footer {padding-left:20px;padding-right:20px;} }',
'39' => '@media (min-width: 980px) { #content {width:940px; margin-left:20px; margin-right:20px;} #aside {width:470px; margin-left:20px;} #extra {width:470px; margin-right:20px;} #footer{padding-left:20px;padding-right:20px;} .header .spip_logos {margin-left:20px;} }',
'40' => '@media (min-width: 980px) { #content {width:940px; margin-left:20px; margin-right:20px;} #aside {width:470px; margin-right:20px;} #extra {width:470px; margin-left:20px;} #footer{padding-left:20px;padding-right:20px;} .header .spip_logos {margin-left:20px;} }',
);
return $tab[$layout];
}
@ -71,22 +75,18 @@ function spipr_educ_gestion_margin() {
// Tout d'abord en largeur >= 1200px
$test_layout = sql_getfetsel('parametre1','spip_spipr_educ',"nom='layout_1200' AND nom_sauvegarde='en_cours_d_utilisation_SPIPr'");
if (!$test_layout) {$test_layout=9;}
spip_log($test_layout, 'test');
$retour.=spipr_educ_gestion_margin_1200($test_layout);
// Ensuite entre 980px et 1199px
$test_layout2 = sql_getfetsel('parametre1','spip_spipr_educ',"nom='layout_grand' AND nom_sauvegarde='en_cours_d_utilisation_SPIPr'");
if (!$test_layout2) {$test_layout2=33;}
spip_log($test_layout, 'test');
$retour.=' '.spipr_educ_gestion_margin_980_1199($test_layout2);
// Entre 768px et 979px
$test_layout3 = sql_getfetsel('parametre1','spip_spipr_educ',"nom='layout_moyen' AND nom_sauvegarde='en_cours_d_utilisation_SPIPr'");
if (!$test_layout3) {$test_layout3=33;}
spip_log($test_layout, 'test');
$retour.=' '.spipr_educ_gestion_margin_768_979($test_layout3);
// Entre 451px et 767px
$test_layout4 = sql_getfetsel('parametre1','spip_spipr_educ',"nom='layout_petit' AND nom_sauvegarde='en_cours_d_utilisation_SPIPr'");
if (!$test_layout4) {$test_layout4=27;}
spip_log($test_layout, 'test');
$retour.=' '.spipr_educ_gestion_margin_451_767($test_layout4);
// Enfin largeur <= 450px
$retour.=' '.spipr_educ_gestion_margin_450();

Loading…
Cancel
Save