From 43b05a92ba368c5993154d58f1deda3a22bb146e Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Sun, 10 Jun 2007 21:40:39 +0000 Subject: [PATCH] evacuation de toiles, et de la fonction bandeau_titre_boite2 en vieille def les differences de style entre boites sont traitees en css, pas en php --- dist/agenda.css | 7 ++-- dist/style_prive.html | 17 ++++++--- ecrire/exec/menu_navigation.php | 21 ++++------- ecrire/exec/messagerie.php | 7 ++-- ecrire/exec/statistiques_lang.php | 2 +- ecrire/inc/agenda.php | 18 ++++------ ecrire/inc/layer.php | 3 +- ecrire/inc/presentation.php | 54 +++++++++------------------- ecrire/inc/referencer_traduction.php | 5 ++- ecrire/inc/vieilles_defs.php | 23 +++++++++++- 10 files changed, 74 insertions(+), 83 deletions(-) diff --git a/dist/agenda.css b/dist/agenda.css index d1ead96dc2..489b4d885d 100644 --- a/dist/agenda.css +++ b/dist/agenda.css @@ -350,7 +350,8 @@ div.navigation-calendrier img { } /* agenda */ .bandeau_agenda { background:#ddd;} -.jour_dimanche { background:#eee;} -.jour_encours { background:#fff;} -.jour_gris { background:#eee;} +.jour_dimanche { background:#eee;color:#000;} +.jour_encours { background:#fff;color:#000;} +.jour_gris { background:#eee;color:#000;} +.jour_pris { background:#fff;color:#000;} .calendrier-cadreagenda { background:#eee;} \ No newline at end of file diff --git a/dist/style_prive.html b/dist/style_prive.html index cab0b59d12..f7b135e394 100644 --- a/dist/style_prive.html +++ b/dist/style_prive.html @@ -289,11 +289,16 @@ a.lien_sous:hover { color: #000; } - -div.bandeau_rubriques { +.cadre-bandeau-rubriques { background-color: #eee; border: 1px solid #555555; + z-index: 1; } +.cadre-bandeau-rubriques .titrem { background : #GET{foncee};} +.cadre-bandeau-rubriques .cadre_padding {padding:0px;} +.cadre-meme-rubriques { background:#eee;border:1px solid #444;} +.cadre-meme-rubriques .cadre_padding {padding:0px;} + a.bandeau_rub { display: block; font-size: 10px; @@ -1788,12 +1793,14 @@ td.message, a.message { .couleur_cumul {background:#666;} .couleur_nombre {background:#eee;} +.couleur_langue {background:#GET{foncee};} /* agenda */ .bandeau_agenda { background:#GET{claire};} -.jour_dimanche { background:#GET{claire};} -.jour_encours { background:#fff;} -.jour_gris { background:#eee;} +.jour_dimanche { background:#GET{claire};color:#fff;} +.jour_encours { background:#fff;color:#000;} +.jour_gris { background:#eee;color:#000;} +.jour_pris { background:#fff;color:#000;} .calendrier-cadreagenda { background:#GET{claire};} /* lang_raccourcis */ diff --git a/ecrire/exec/menu_navigation.php b/ecrire/exec/menu_navigation.php index 752920a716..3acd0aad7f 100644 --- a/ecrire/exec/menu_navigation.php +++ b/ecrire/exec/menu_navigation.php @@ -26,9 +26,7 @@ function exec_menu_navigation_dist() { if (spip_num_rows($vos_articles) > 0) { $t = _T('info_en_cours_validation'); - $gadget .= "<div> </div>" - . "<div class='bandeau_rubriques' style='z-index: 1;'>" - . bandeau_titre_boite2(afficher_plus(generer_url_ecrire('articles_page')) . '<b>' . $t . '</b>', "article-24.gif", 'toile_foncee', 'ligne_blanche') + $gadget .= debut_cadre('bandeau-rubriques',"article-24.gif",'',afficher_plus(generer_url_ecrire("articles_page")).$t) . "\n<div class='plan-articles'>\n"; while($row = spip_fetch_array($vos_articles)) { $id_article = $row['id_article']; @@ -37,31 +35,26 @@ function exec_menu_navigation_dist() { $gadget .= "<a class='$statut spip_xx-small' href='" . generer_url_ecrire("articles","id_article=$id_article") . "'>$titre</a>\n"; } $gadget .= "</div>"; - $gadget .= "</div>"; + $gadget .= fin_cadre('bandeau-rubriques'); } $vos_articles = spip_query("SELECT id_article, id_rubrique, titre, statut FROM spip_articles WHERE statut='prop' ORDER BY date DESC LIMIT 5"); if (spip_num_rows($vos_articles) > 0) { - $gadget .= "<div> </div>"; - $gadget .= "<div class='bandeau_rubriques' style='z-index: 1;'>"; - $gadget .= bandeau_titre_boite2(afficher_plus(generer_url_ecrire()) . '<b>' . _T('info_articles_proposes') . '</b>', "article-24.gif", 'toile_foncee', 'ligne_blanche'); + $gadget .= debut_cadre('bandeau-rubriques',"article-24.gif",'',afficher_plus(generer_url_ecrire())._T('info_articles_proposes')); $gadget .= "<div class='plan-articles'>"; while($row = spip_fetch_array($vos_articles)) { $id_article = $row['id_article']; $titre = sinon($row['titre'], _T('ecrire:info_sans_titre')); $statut = $row['statut']; - - $gadget .= "<a class='$statut spip_xx-small' href='" . generer_url_ecrire("articles","id_article=$id_article") . "'>$titre</a>"; + $gadget .= "<a class='$statut' href='" . generer_url_ecrire("articles","id_article=$id_article") . "'>$titre</a>"; } $gadget .= "</div>"; - $gadget .= "</div>"; + $gadget .= fin_cadre('bandeau-rubriques'); } $vos_articles = spip_query("SELECT * FROM spip_breves WHERE statut='prop' ORDER BY date_heure DESC LIMIT 5"); if (spip_num_rows($vos_articles) > 0) { - $gadget .= "<div> </div>"; - $gadget .= "<div class='bandeau_rubriques' style='z-index: 1;'>"; - $gadget .= bandeau_titre_boite2(afficher_plus(generer_url_ecrire("breves")).'<b>' . _T('info_breves_valider') . '</b>', "breve-24.gif", 'toile_foncee', 'ligne_blanche'); + $gadget .= debut_cadre('bandeau-rubriques',"breve-24.gif",'',afficher_plus(generer_url_ecrire("breves"))._T('info_breves_valider')); $gadget .= "<div class='plan-articles'>"; while($row = spip_fetch_array($vos_articles)) { $id_breve = $row['id_breve']; @@ -71,7 +64,7 @@ function exec_menu_navigation_dist() { $gadget .= "<a class='$statut spip_xx-small' href='" . generer_url_ecrire("breves_voir","id_breve=$id_breve") . "'>$titre</a>"; } $gadget .= "</div>"; - $gadget .= "</div>"; + $gadget .= fin_cadre('bandeau-rubriques'); } $result = spip_query("SELECT id_rubrique FROM spip_rubriques LIMIT 1"); diff --git a/ecrire/exec/messagerie.php b/ecrire/exec/messagerie.php index 9ac20dac51..9755ad7400 100644 --- a/ecrire/exec/messagerie.php +++ b/ecrire/exec/messagerie.php @@ -104,10 +104,7 @@ $result = spip_query("SELECT auteurs.id_auteur, auteurs.nom, COUNT(*) AS total F if (spip_num_rows($result) > 0) { echo "<div style='height: 12px;'></div>"; - echo "<div class='liste'>"; - - echo bandeau_titre_boite2('<b>' . _T('info_principaux_correspondants') . '</b>', "redacteurs-24.gif", 'toile_gris_sombre', 'ligne_blanche'); - + echo debut_cadre('liste',"redacteurs-24.gif",'',_T('info_principaux_correspondants')); echo "<table width='100%' cellpadding='0' cellspacing='0'>"; echo "<tr><td valign='top' style='width: 50%'>"; $count = 0; @@ -122,7 +119,7 @@ if (spip_num_rows($result) > 0) { if ($count == ceil(spip_num_rows($result)/2)) echo "</td><td valign='top' style='width: 50%' class='toile_gris_leger'>"; } echo "</td></tr></table>"; - echo "</div>"; + echo fin_cadre('liste'); } echo afficher_messages('<b>' . _T('info_pense_bete_ancien') . '</b>', '', "id_auteur=$connect_id_auteur AND statut='publie' AND type='pb' AND rv!='oui'", $messages_vus, false, false); diff --git a/ecrire/exec/statistiques_lang.php b/ecrire/exec/statistiques_lang.php index fa0dfaff18..e5f2a5f1f7 100644 --- a/ecrire/exec/statistiques_lang.php +++ b/ecrire/exec/statistiques_lang.php @@ -96,7 +96,7 @@ function exec_statistiques_lang_dist() echo "\n<table cellpadding='0' cellspacing='0' border='0' width='".($taille+5)."'>"; echo "\n<tr><td style='align:$spip_lang_right; background-color: #eeeeee; border: 1px solid #999999; white-space: nowrap;'>"; if ($visites_abs > 0) echo "<img src='" . _DIR_IMG_PACK . "rien.gif' width='$visites_abs' height='8' alt=' ' />"; - if ($visites>0) echo "<img src='" . _DIR_IMG_PACK . "rien.gif' class='toile_foncee' style='border: 0px;' width='$visites' height='8' alt=' ' />"; + if ($visites>0) echo "<img src='" . _DIR_IMG_PACK . "rien.gif' class='couleur_langue' style='border: 0px;' width='$visites' height='8' alt=' ' />"; echo "</td></tr></table>\n"; echo "</td>"; diff --git a/ecrire/inc/agenda.php b/ecrire/inc/agenda.php index 7cc8a6cb3e..46be086285 100644 --- a/ecrire/inc/agenda.php +++ b/ecrire/inc/agenda.php @@ -1134,21 +1134,17 @@ function http_calendrier_agenda_rv ($annee, $mois, $les_rv, $fclic, $couleur = "black"; } else { if ($j == $jour_today AND $cemois) { - $toile = test_espace_prive() ? 'toile_foncee' : 'toile_gris_sombre'; - $couleur = "white"; + $toile = 'jour_encours'; } else { if ($jour_semaine == 7) { - $toile = "toile_gris_fort"; - $couleur = 'white'; + $toile = "jour_dimanche"; } else { - $toile = 'toile_blanche'; - $couleur = "#aaaaaa"; - } - if (isset($les_rv[$j])) { - $toile = 'toile_blanche'; - $couleur = "black"; - $title = textebrut($les_rv[$j]['SUMMARY']); + $toile = 'jour_gris'; } + if (isset($les_rv[$j])) { + $toile = "jour_pris $toile"; + $title = textebrut($les_rv[$j]['SUMMARY']); + } } $class= 'calendrier-arial11 calendrier-agenda'; $type = ($semaine ? 'semaine' : 'jour') ; diff --git a/ecrire/inc/layer.php b/ecrire/inc/layer.php index 88f5889cdc..45b1951a38 100644 --- a/ecrire/inc/layer.php +++ b/ecrire/inc/layer.php @@ -70,14 +70,13 @@ function bouton_block_depliable($texte,$deplie,$ids=""){ $cible = "#$bouton_id + div.bloc_depliable"; } $extra_js = ""; - if ($a = extraire_balise($texte,'a')){ + if (($deplie!==-1) && ($a = extraire_balise($texte,'a'))){ $ar = inserer_attribut($a,'onclick','return false;',false); $texte = str_replace($a,$ar,$texte); $extra_js .= "\njQuery('#$bouton_id a').dblclick(function(){window.location.replace($(this).attr('href'));});"; } if ($deplie==='incertain') $extra_js .= "\nif (jQuery('$cible').is(':visible')) $('#$bouton_id').addClass('deplie').removeClass('replie');"; - //$extra_js .= "\njQuery('#$bouton_id').hover(function(){jQuery(this).addClass('hover');},function(){jQuery(this).removeClass('hover');});"; return "<div " .($bouton_id?"id='$bouton_id' ":"") diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index ac54596c63..50d431dd63 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -250,26 +250,6 @@ function fin_boite_info($return=false) { if ($return) return $r; else echo $r; } -// -// une autre boite -// -// http://doc.spip.org/@bandeau_titre_boite2 -function bandeau_titre_boite2($titre, $logo="", $fond="toile_blanche", $texte="ligne_noire") { - global $spip_lang_left, $spip_display, $browser_name; - - if (strlen($logo) > 0 AND $spip_display != 1 AND $spip_display != 4) { - $ie_style = ($browser_name == "MSIE") ? "height:1%" : ''; - - return "\n<div style='position: relative;$ie_style'>" - . "\n<div style='position: absolute; top: -12px; $spip_lang_left: 3px;'>" - . http_img_pack($logo, "", "") - . "</div>" - . "\n<div style='padding: 3px; padding-$spip_lang_left: 30px; border-bottom: 1px solid #444444;' class='verdana2 $fond $texte'>$titre</div>" - . "</div>"; - } else { - return "<h3 style='padding: 3px; border-bottom: 1px solid #444444; margin: 0px;' class='verdana2 $fond $texte'>$titre</h3>"; - } -} // // La boite des raccourcis @@ -1157,17 +1137,15 @@ function liste_articles_bloques() include_spip('inc/drapeau_edition'); $articles_ouverts = liste_drapeau_edition ($connect_id_auteur, 'article'); if (count($articles_ouverts)) { - $res .= "\n<div> </div>" - . "\n<div class='bandeau_rubriques' style='z-index: 1;'>" - . bandeau_titre_boite2('<b>' . _T('info_cours_edition') . '</b>', "article-24.gif", 'toile_foncee', 'ligne_blanche') - . "\n<div class='plan-articles-bloques'>"; - + $res .= + debut_cadre('bandeau-rubriques',"article-24.gif",'',_T('info_cours_edition')) + . "\n<div class='plan-articles-bloques'>"; foreach ($articles_ouverts as $row) { $ze_article = $row['id_article']; $ze_titre = $row['titre']; $statut = $row["statut"]; - $res .= "\n<div class='$statut spip_xx-small'>" + $res .= "\n<div class='$statut'>" . "\n<div style='float:right; '>" . debloquer_article($ze_article,_T('lien_liberer')) . "</div>" @@ -1178,15 +1156,11 @@ function liste_articles_bloques() } if (count($articles_ouverts) >= 4) { - $res .= "\n<div class='spip_x-small'>" - . "\n<div style='text-align:right; '>" + $res .= "\n<div style='text-align:right; '>" . debloquer_article('tous', _T('lien_liberer_tous')) - . "</div>" . "</div>"; } - - - $res .= "</div></div>"; + $res .= fin_cadre('bandeau-rubriques') . "</div>"; } } return $res; @@ -1328,23 +1302,27 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=NULL, $aj } $icone = $puce_rubrique . '<b>' . _T('info_meme_rubrique') . '</b>'; - + $bouton = bouton_block_depliable(_T('info_meme_rubrique'),true,'memerub'); - $retour = bandeau_titre_boite2($icone, 'article-24.gif', 'toile_blanche', 'ligne_noire') - . "\n<table class='spip_x-small' style='background-color: #e0e0e0;border: 0px; padding-left:4px; width: 100%;'>" - . $retour; + $retour = + debut_cadre('meme-rubriques',"article-24.gif",'',$bouton) + . debut_block_depliable(true,'memerub') + . "\n<table style='background-color: #e0e0e0;border: 0px; padding-left:4px; width: 100%;'>" + . $retour; if (_MODE_MEME_RUBRIQUE == 'oui') $retour .= (($limit <= 0) ? '' : "<tr><td colspan='3' style='text-align: center'>+ $limit</td></tr>"); - $retour .= "</table>"; + $retour .= "</table>" + . fin_block() + . fin_cadre('meme-rubriques'); if ($ajax) return $retour; // id utilise dans puce_statut_article return "\n<div> </div>" - . "\n<div id='imgstatut$idom$id_rubrique' class='bandeau_rubriques' style='z-index: 1;'>$retour</div>"; + . "\n<div id='imgstatut$idom$id_rubrique'>$retour</div>"; } // diff --git a/ecrire/inc/referencer_traduction.php b/ecrire/inc/referencer_traduction.php index 96213131b5..f4711cd379 100644 --- a/ecrire/inc/referencer_traduction.php +++ b/ecrire/inc/referencer_traduction.php @@ -74,10 +74,9 @@ function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_tr . $t . "</table>\n"; - $liste = "\n<div class='liste'>" - . bandeau_titre_boite2( '<b>' . _T('trad_article_traduction') . '</b>','', 'toile_blanche', 'ligne_noire') + $liste = debut_cadre('liste','','',_T('trad_article_traduction')) . $t - . "</div>"; + . fin_cadre('liste'); } else $liste = ''; // changer les globales de direction de langue diff --git a/ecrire/inc/vieilles_defs.php b/ecrire/inc/vieilles_defs.php index ff2216d54a..1cf9d4ee64 100644 --- a/ecrire/inc/vieilles_defs.php +++ b/ecrire/inc/vieilles_defs.php @@ -358,4 +358,25 @@ function extraire_tag($texte, $tag='a') { } */ -?> +// +// une autre boite +// +// http://doc.spip.org/@bandeau_titre_boite2 +function bandeau_titre_boite2($titre, $logo="", $fond="toile_blanche", $texte="ligne_noire") { + global $spip_lang_left, $spip_display, $browser_name; + + if (strlen($logo) > 0 AND $spip_display != 1 AND $spip_display != 4) { + $ie_style = ($browser_name == "MSIE") ? "height:1%" : ''; + + return "\n<div style='position: relative;$ie_style'>" + . "\n<div style='position: absolute; top: -12px; $spip_lang_left: 3px;'>" + . http_img_pack($logo, "", "") + . "</div>" + . "\n<div style='padding: 3px; padding-$spip_lang_left: 30px; border-bottom: 1px solid #444444;' class='verdana2 $fond $texte'>$titre</div>" + . "</div>"; + } else { + return "<h3 style='padding: 3px; border-bottom: 1px solid #444444; margin: 0px;' class='verdana2 $fond $texte'>$titre</h3>"; + } +} + +?> \ No newline at end of file -- GitLab