Skip to content
Extraits de code Groupes Projets
Valider 2f0d5de7 rédigé par esj's avatar esj
Parcourir les fichiers

unification de l'envoi du <head>..</head> pour faciliter les surcharges

parent 8dead5d2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -13,11 +13,10 @@ ...@@ -13,11 +13,10 @@
include ("inc.php3"); include ("inc.php3");
echo debut_entete(""); echo debut_entete(""), envoi_link("",""), "\n</head>\n";
envoi_link("","");
// Fin des entetes echo "<body $attributes_body
echo "\n</head>\n"; onLoad=\"setActiveStyleSheet('invisible');$browser_verifForm$onLoad\">";
debut_body();
if ($spip_ecran == "large") { if ($spip_ecran == "large") {
$nb_col = 4; $nb_col = 4;
......
...@@ -137,6 +137,9 @@ $couleur_claire = $couleurs_spip[$choix_couleur]['couleur_claire']; ...@@ -137,6 +137,9 @@ $couleur_claire = $couleurs_spip[$choix_couleur]['couleur_claire'];
$couleur_lien = $couleurs_spip[$choix_couleur]['couleur_lien']; $couleur_lien = $couleurs_spip[$choix_couleur]['couleur_lien'];
$couleur_lien_off = $couleurs_spip[$choix_couleur]['couleur_lien_off']; $couleur_lien_off = $couleurs_spip[$choix_couleur]['couleur_lien_off'];
$attributes_body = "text='#000000' bgcolor='#f8f7f3' link='$couleur_lien' vlink='$couleur_lien_off' alink='$couleur_lien_off' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' frameborder='0'" .
($spip_lang_rtl ? " dir='rtl'" : "");
// //
// Gestion de version // Gestion de version
// //
......
...@@ -20,6 +20,7 @@ charger_generer_url(); ...@@ -20,6 +20,7 @@ charger_generer_url();
function calendrier_dist($type, $css="") function calendrier_dist($type, $css="")
{ {
global $attributes_body, $browser_verifForm;
$date = date("Y-m-d", time()); $date = date("Y-m-d", time());
if ($type == 'semaine') { if ($type == 'semaine') {
...@@ -40,12 +41,13 @@ function calendrier_dist($type, $css="") ...@@ -40,12 +41,13 @@ function calendrier_dist($type, $css="")
if (!$nom_site_spip) $nom_site_spip="SPIP"; if (!$nom_site_spip) $nom_site_spip="SPIP";
// envoi des en-tetes, du doctype et du <head><title... // envoi des en-tetes, du doctype et du <head><title...
echo debut_entete("[$nom_site_spip] " . textebrut(typo($titre))); echo debut_entete("[$nom_site_spip] " . textebrut(typo($titre))),
envoi_link($nom_site_spip); envoi_link($nom_site_spip);
if ($css) if ($css)
echo '<link rel="stylesheet" href="', addslashes($css), '" type="text/css">', "\n"; echo '<link rel="stylesheet" href="', addslashes($css), '" type="text/css" />', "\n";
echo "\n</head>\n"; echo "\n</head>\n";
debut_body(); echo "<body $attributes_body
onLoad=\"setActiveStyleSheet('invisible');$browser_verifForm$onLoad\">";
init_body("redacteurs", "calendrier"); init_body("redacteurs", "calendrier");
echo "<div>&nbsp;</div>" ; echo "<div>&nbsp;</div>" ;
echo http_calendrier_init('', $type); echo http_calendrier_init('', $type);
...@@ -308,7 +310,7 @@ function http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$ ...@@ -308,7 +310,7 @@ function http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$
$mois_en_cours = date("m",$nom); $mois_en_cours = date("m",$nom);
$annee_en_cours = date("Y",$nom); $annee_en_cours = date("Y",$nom);
$amj = date("Y",$nom) . $mois_en_cours . $jour; $amj = date("Y",$nom) . $mois_en_cours . $jour;
$couleur_lien = "black"; $couleur_texte = "black";
$couleur_fond = ""; $couleur_fond = "";
if ($jour_semaine == 0) $couleur_fond = $couleur_claire; if ($jour_semaine == 0) $couleur_fond = $couleur_claire;
...@@ -320,7 +322,7 @@ function http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$ ...@@ -320,7 +322,7 @@ function http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$
} }
if ($amj == $today) { if ($amj == $today) {
$couleur_lien = "red"; $couleur_texte = "red";
$couleur_fond = "white"; $couleur_fond = "white";
} }
$res = ''; $res = '';
...@@ -342,7 +344,7 @@ function http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$ ...@@ -342,7 +344,7 @@ function http_calendrier_mois_sept($annee, $mois, $premier_jour, $dernier_jour,$
(!_DIR_RESTREINT ? (!_DIR_RESTREINT ?
(http_href(calendrier_args_date($script,$annee_en_cours, $mois_en_cours, $jour, "jour", $ancre), (http_href(calendrier_args_date($script,$annee_en_cours, $mois_en_cours, $jour, "jour", $ancre),
$jour, $jour,
$jour, "color: $couleur_lien",'calendrier-helvetica16') . $jour, "color: $couleur_texte",'calendrier-helvetica16') .
http_calendrier_ics_message($annee_en_cours, $mois_en_cours, $jour, false)): http_calendrier_ics_message($annee_en_cours, $mois_en_cours, $jour, false)):
http_calendrier_mois_clics($annee_en_cours, $mois_en_cours, $jour, $script, $ancre)) . http_calendrier_mois_clics($annee_en_cours, $mois_en_cours, $jour, $script, $ancre)) .
$res . $res .
......
...@@ -169,4 +169,10 @@ onclick='storeCaret(this);' ...@@ -169,4 +169,10 @@ onclick='storeCaret(this);'
onkeyup='storeCaret(this);' onkeyup='storeCaret(this);'
ondbclick='storeCaret(this);'"); ondbclick='storeCaret(this);'");
// Hack pour forcer largeur des formo/forml sous Mozilla >= 1.7
// meme principe que le behavior win_width.htc pour MSIE
$GLOBALS['browser_verifForm'] = (eregi("mozilla", $browser_name) AND $browser_rev >= 1.7) ? "verifForm();" : "";
?> ?>
...@@ -1851,6 +1851,7 @@ function bouton($titre,$lien) { ...@@ -1851,6 +1851,7 @@ function bouton($titre,$lien) {
function debut_html($titre = "", $rubrique="") { function debut_html($titre = "", $rubrique="") {
global $attributes_body, $browser_verifForm;
$nom_site_spip = entites_html(textebrut(typo(lire_meta("nom_site")))); $nom_site_spip = entites_html(textebrut(typo(lire_meta("nom_site"))));
if (!$nom_site_spip) $nom_site_spip="SPIP"; if (!$nom_site_spip) $nom_site_spip="SPIP";
$titre = textebrut(typo($titre)); $titre = textebrut(typo($titre));
...@@ -1859,34 +1860,11 @@ function debut_html($titre = "", $rubrique="") { ...@@ -1859,34 +1860,11 @@ function debut_html($titre = "", $rubrique="") {
echo debut_entete("[$nom_site_spip] $titre"); echo debut_entete("[$nom_site_spip] $titre");
if (strpos($rubrique, 'script>')) if (strpos($rubrique, 'script>'))
echo $rubrique, "\n"; echo $rubrique, "\n";
envoi_link($nom_site_spip, $rubrique); echo envoi_link($nom_site_spip, $rubrique);
// Fin des entetes // Fin des entetes
echo "\n</head>\n"; echo "\n</head>\n";
debut_body(); echo "<body $attributes_body
} onLoad=\"setActiveStyleSheet('invisible');$browser_verifForm\">";
//
// Presentation de l'interface privee, debut du HTML
//
function debut_body($onLoad="")
{
global $couleur_lien, $couleur_lien_off;
global $mode, $spip_lang_rtl;
global $browser_name, $browser_rev;
echo "<body text='#000000' bgcolor='#f8f7f3' link='$couleur_lien' vlink='$couleur_lien_off' alink='$couleur_lien_off' topmargin='0' leftmargin='0' marginwidth='0' marginheight='0' frameborder='0'";
if ($spip_lang_rtl)
echo " dir='rtl'";
//if ($mode == "wysiwyg") echo " onLoad='debut_editor();'";
echo " onLoad=\"setActiveStyleSheet('invisible'); ";
// Hack pour forcer largeur des formo/forml sous Mozilla >= 1.7
// meme principe que le behavior win_width.htc pour MSIE
if (eregi("mozilla", $browser_name) AND $browser_rev >= 1.7)
echo "verifForm();";
echo "$onLoad\">";
} }
function envoi_link($nom_site_spip, $rubrique="") function envoi_link($nom_site_spip, $rubrique="")
...@@ -1894,79 +1872,72 @@ function envoi_link($nom_site_spip, $rubrique="") ...@@ -1894,79 +1872,72 @@ function envoi_link($nom_site_spip, $rubrique="")
global $connect_statut, $connect_toutes_rubriques, $spip_display; global $connect_statut, $connect_toutes_rubriques, $spip_display;
global $couleur_foncee, $couleur_claire; global $couleur_foncee, $couleur_claire;
$adresse_site=lire_meta("adresse_site"); $adresse_site=lire_meta("adresse_site");
if ($spip_display != 4) {
echo "<link rel='alternate' type='application/rss+xml' title='".addslashes($nom_site_spip)."' href='$adresse_site/backend.php3' />";
$activer_breves=lire_meta("activer_breves");
if ($activer_breves != "non")
echo "<link rel='alternate' type='application/rss+xml' title='".addslashes($nom_site_spip)." ("._T("info_breves_03").")' href='$adresse_site/backend-breves.php3' />";
}
echo "\n",'<link rel="stylesheet" type="text/css" href="', _DIR_RESTREINT; $res = "";
$link = new Link('spip_style.php3'); if ($spip_display != 4) {
$link->addVar('couleur_claire', $couleur_claire); $res .= "<link rel='alternate' type='application/rss+xml' title='".addslashes($nom_site_spip)."' href='$adresse_site/backend.php3' >\n";
$link->addVar('couleur_foncee', $couleur_foncee); if (lire_meta("activer_breves") != "non")
$link->addVar('left', $GLOBALS['spip_lang_left']); $res .= "\n<link rel='alternate' type='application/rss+xml' title='".addslashes($nom_site_spip)." ("._T("info_breves_03").")' href='$adresse_site/backend-breves.php3' >\n";
echo $link->getUrl()."\">\n"; }
// Supprime pour l'instant: pas de creation mathml return $res .
// < script type="text/javascript" src="../mathmlinHTML.js"></script> '<link rel="stylesheet" type="text/css" href="' .
// Supprime pour l'instant: pas de detection des plugin _DIR_RESTREINT .
// < script type="text/javascript" src="js_detectplugins.js"></script> 'spip_style.php3?couleur_claire=' .
urlencode($couleur_claire) .
debut_javascript($connect_statut == "0minirezo" AND $connect_toutes_rubriques, (lire_meta("activer_statistiques") != 'non')); '&amp;couleur_foncee=' .
urlencode($couleur_foncee) .
'&amp;left=' .
$GLOBALS['spip_lang_left'] .
"\" >\n" .
debut_javascript($connect_statut == "0minirezo" AND $connect_toutes_rubriques, (lire_meta("activer_statistiques") != 'non')) .
// CSS calendrier // CSS calendrier
echo '<link rel="stylesheet" href="', _DIR_RESTREINT, 'calendrier.css" type="text/css">', "\n"; '<link rel="stylesheet" href="' . _DIR_RESTREINT . 'calendrier.css" type="text/css">' . "\n" .
// CSS imprimante (masque des trucs, a completer) // CSS imprimante (masque des trucs, a completer)
echo '<link rel="stylesheet" href="', _DIR_RESTREINT, 'spip_style_print.css" type="text/css" media="print">', "\n"; '<link rel="stylesheet" href="' . _DIR_RESTREINT . 'spip_style_print.css" type="text/css" media="print">' . "\n" .
// CSS "visible au chargement", hack necessaire pour garder un depliement // CSS "visible au chargement", hack necessaire pour garder un depliement
// sympathique meme sans javascript (on exagere ?) // sympathique meme sans javascript (on exagere ?)
// Pour l'explication voir http://www.alistapart.com/articles/alternate/ // Pour l'explication voir http://www.alistapart.com/articles/alternate/
echo '<link rel="alternate stylesheet" href="', _DIR_RESTREINT, 'spip_style_invisible.css" type="text/css" title="invisible" />', "\n", '<link rel="alternate stylesheet" href="' . _DIR_RESTREINT . 'spip_style_invisible.css" type="text/css" title="invisible" >' . "\n" .
'<link rel="stylesheet" href="', _DIR_RESTREINT, 'spip_style_visible.css" type="text/css" title="visible" />', "\n"; '<link rel="stylesheet" href="' . _DIR_RESTREINT . 'spip_style_visible.css" type="text/css" title="visible" >' . "\n" .
// favicon.ico // favicon.ico
echo '<link rel="shortcut icon" href="', _DIR_IMG_PACK, 'favicon.ico" />', "\n"; '<link rel="shortcut icon" href="' . _DIR_IMG_PACK . 'favicon.ico" >' . "\n";
} }
function debut_javascript($admin, $stat) function debut_javascript($admin, $stat)
{ {
global $spip_lang_left; global $spip_lang_left, $browser_name, $browser_version;
global $browser_name, $browser_version; include_ecrire("inc_charsets.php3");
// envoi le fichier JS de config si browser ok. return
echo $GLOBALS['browser_layer']; // envoi le fichier JS de config si browser ok.
?> $GLOBALS['browser_layer'] .
<script type='text/javascript'><!-- "<script type='text/javascript'><!--" .
var admin = <?php echo ($admin ? 1 : 0) ?>; "\nvar admin = " . ($admin ? 1 : 0) .
var stat = <?php echo ($stat ? 1 : 0) ?>; "\nvar stat = " . ($stat ? 1 : 0) .
var largeur_icone = <?php echo largeur_icone_bandeau_principal(_T('icone_a_suivre')); ?>; "\nvar largeur_icone = " .
var bug_offsetwidth = <?php largeur_icone_bandeau_principal(_T('icone_a_suivre')) .
"\nvar bug_offsetwidth = " .
// uniquement affichage ltr: bug Mozilla dans offsetWidth quand ecran inverse! // uniquement affichage ltr: bug Mozilla dans offsetWidth quand ecran inverse!
echo ((($spip_lang_left == "left") && ((($spip_lang_left == "left") &&
(($browser_name != "MSIE") || (($browser_name != "MSIE") ||
($browser_version >= 6))) ? 1 : 0) ?> ; ($browser_version >= 6))) ? 1 : 0) .
"\nvar confirm_changer_statut = '" .
var confirm_changer_statut = '<?php include_ecrire("inc_charsets.php3"); echo unicode_to_javascript(addslashes(html2unicode(_T("confirm_changer_statut")))); ?>'; unicode_to_javascript(addslashes(html2unicode(_T("confirm_changer_statut")))) .
"';\n" .
<?php
# tester la capacite ajax si ce n'est pas deja fait # tester la capacite ajax si ce n'est pas deja fait
if (!$GLOBALS['_COOKIE']['spip_accepte_ajax']) { (($GLOBALS['_COOKIE']['spip_accepte_ajax']) ? "" : (
?> " if (a = createXmlHttp()) {
if (a = createXmlHttp()) { a.open('GET', 'ajax_page.php?fonction=test_ajax', true) .
a.open('GET', 'ajax_page.php?fonction=test_ajax', true);
a.send(null); a.send(null);
} }")) .
<?php
}
?>
//--></script> "\n//--></script>" .
<?php http_script('',_DIR_RESTREINT . 'presentation.js');
echo http_script('',_DIR_RESTREINT . 'presentation.js');
} }
// Fonctions onglets // Fonctions onglets
...@@ -2363,16 +2334,23 @@ function afficher_javascript ($html) { ...@@ -2363,16 +2334,23 @@ function afficher_javascript ($html) {
document.write(\"" . addslashes(strtr($html, "\n\r", " "))."\")"); document.write(\"" . addslashes(strtr($html, "\n\r", " "))."\")");
} }
//
// Presentation de l'interface privee, debut du HTML
//
function debut_page($titre = "", $rubrique = "asuivre", $sous_rubrique = "asuivre", $onLoad = "") { function debut_page($titre = "", $rubrique = "asuivre", $sous_rubrique = "asuivre", $onLoad = "") {
global $attributes_body, $browser_verifForm;
$nom_site_spip = entites_html(textebrut(typo(lire_meta("nom_site")))); $nom_site_spip = entites_html(textebrut(typo(lire_meta("nom_site"))));
if (!$nom_site_spip) $nom_site_spip="SPIP"; if (!$nom_site_spip) $nom_site_spip="SPIP";
// envoi des en-tetes, du doctype et du <head><title... // envoi des en-tetes, du doctype et du <head><title...
echo debut_entete("[$nom_site_spip] " . textebrut(typo($titre))); echo debut_entete("[$nom_site_spip] " . textebrut(typo($titre))),
envoi_link($nom_site_spip, $rubrique); envoi_link($nom_site_spip, $rubrique),
echo "\n</head>\n"; "\n</head>\n",
debut_body($onLoad); "<body $attributes_body
onLoad=\"setActiveStyleSheet('invisible');$browser_verifForm$onLoad\">";
init_body($rubrique, $sous_rubrique); init_body($rubrique, $sous_rubrique);
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter