From 0fffb74730b83e0eff3238f8c429b38a00ff29d8 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Mon, 30 Oct 2006 11:45:50 +0000 Subject: [PATCH] =?UTF-8?q?Meilleur=20d=C3=A9coupage=20de=20forum=5Fenvoi?= =?UTF-8?q?=20pour=20les=20surcharges.=20Plus=20qq=20modifs=20pour=20le=20?= =?UTF-8?q?rendre=20totalement=20conforme=20XHTML=201.0=20transitionnal.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/exec/forum_envoi.php | 107 +++++++++++++++++++---------------- ecrire/inc/gadgets.php | 10 +++- ecrire/inc/presentation.php | 51 ++++------------- ecrire/inc/vieilles_defs.php | 27 +++++++++ 4 files changed, 106 insertions(+), 89 deletions(-) diff --git a/ecrire/exec/forum_envoi.php b/ecrire/exec/forum_envoi.php index c1e5a4a082..af7e78a404 100644 --- a/ecrire/exec/forum_envoi.php +++ b/ecrire/exec/forum_envoi.php @@ -116,45 +116,77 @@ function forum_envoi( $objet = 'id_forum'; $titre = 'titre'; $id = 0; - $titre_page = $titre_message ? $titre_message : _T('texte_nouveau_message'); $num = ''; } + $titre_page = $titre_message + ? $titre_message + : ($id_message ? _T('texte_nouveau_message') + : _T('info_forum_interne')); + if ($num) { $q = spip_query("SELECT $titre AS titre FROM spip_$table WHERE $objet=$id"); $q = spip_fetch_array($q); - $titre_page = $q['titre']; $num = "<br />(" . str_replace(':','',strtolower($num)) . $id - . ", " - ._T('info_forum_interne') . ')'; + . ')<br />' + . $titre_page; + $titre_page = $q['titre']; } - if ($id_message) debut_page(_T('titre_page_forum_envoi'), "accueil", "messagerie"); - else debut_page(_T('titre_page_forum_envoi'), "accueil"); + debut_page($titre_page, "accueil", $id_message ? "messagerie" : "accueil"); debut_gauche(); debut_droite(); gros_titre($titre_page . $num); + if ($modif_forum == "oui") { + $corps = forum_envoi_entete($parent, $titre_parent, $texte, $titre_message, $nom_site, $url_site); + $parent = ''; + } else $corps = ''; + + $corps .= debut_cadre_formulaire(($statut == 'privac') ? "" : 'background-color: #dddddd;', true) + . forum_envoi_formulaire($id, $objet, $script, $statut, $texte, $titre_page, $nom_site, $url_site) + . "<div align='right'><input class='fondo' type='submit' value='" + . _T('bouton_voir_message') + . "' /></div>" + . fin_cadre_formulaire(true); + + $cat = intval($id) . '/' + . intval($id_parent) . '/' + . $statut . '/' + . $script . '/' + . $objet; + + echo $parent, + "\n<div> </div>" + . redirige_action_auteur('editer_forum',$cat, $script, "$objet=$id", $corps, "") + . "<a id='formulaire'></a>" + . fin_page(); +} + +function forum_envoi_formulaire($id, $objet, $script, $statut, $texte, $titre_page, $nom_site, $url_site) +{ + global $options; + if ($statut == "prive") $logo = "forum-interne-24.gif"; else if ($statut == "privadm") $logo = "forum-admin-24.gif"; else if ($statut == "privrac") $logo = "forum-interne-24.gif"; else $logo = "forum-public-24.gif"; - $corps = "\n<table border='0' cellpadding='0' cellspacing='0' background='' width='100%'><tr><td>" + return "\n<table border='0' cellpadding='0' cellspacing='0' width='100%'><tr><td>" . icone(_T('icone_retour'), generer_url_ecrire($script, "$objet=$id"), $logo, '','', false) ."</td>" ."\n<td><img src='" . _DIR_IMG_PACK - . "rien.gif' width='10' border='0' /></td><td width=\"100%\">" - ."<b>"._T('info_titre')."</b><br />" + . "rien.gif' width='10' border='0' alt=''/></td><td width=\"100%\">" + ."<b>"._T('info_titre')."</b><br />\n" . "<input type='text' class='formo' name='titre_message' value=\"" - . entites_html($titre_message ? $titre_message : $titre_page) + . entites_html($titre_page) . "\" size='40' />\n" - . "</td></tr></table>" + . "</td></tr></table><br />" . - "<p><b>" . + "<b>" . _T('info_texte_message') . "</b><br />\n" . _T('info_creation_paragraphe') . @@ -162,35 +194,29 @@ function forum_envoi( afficher_barre('document.formulaire.texte', true) . "<textarea name='texte' " . $GLOBALS['browser_caret'] . - " rows='15' class='formo' cols='40' wrap='soft'>" . + " rows='15' class='formo' cols='40'>" . entites_html($texte) . - "</textarea></p><p>\n"; - - if (!$modif_forum OR $modif_forum == "oui") { - $corps .="<input type='hidden' name='modif_forum' value='oui' />\n"; - } - if ($statut != 'perso' AND $options == "avancees") { - $corps .="<b>"._T('info_lien_hypertexte')."</b><br />\n" + "</textarea>\n" . + "<input type='hidden' name='modif_forum' value='oui' />\n" . + (!($statut != 'perso' AND $options == "avancees") + ? '' + : ("<b>"._T('info_lien_hypertexte')."</b><br />\n" . _T('texte_lien_hypertexte')."<br />\n" . _T('texte_titre_02')."<br />\n" . "<input type='text' class='forml' name='nom_site' value=\"".entites_html($nom_site)."\" size='40' /><br />\n" . _T('info_url') ."<br />\n" . "<input type='text' class='forml' name='url_site' value=\"".entites_html($url_site) - . "\" size='40' /></p>"; - } + . "\" size='40' /></p>" + )); +} - $corps = debut_cadre_formulaire(($statut == 'privac') ? "" : 'background-color: #dddddd;', true) - . $corps - . "<div align='right'><input class='fondo' type='submit' value='" - . _T('bouton_voir_message') - . "' /></div>" - . fin_cadre_formulaire(true); +function forum_envoi_entete($parent, $titre_parent, $texte, $titre_texte, $nom_site, $url_site) +{ + global $spip_lang_rtl; - if ($modif_forum == "oui") { - $corps = - "\n<table width='100%' cellpadding='0' cellspacing='0' border='0'>" + return "\n<table width='100%' cellpadding='0' cellspacing='0' border='0'>" . (!$parent ? '' : "<tr><td colspan='2'>$parent</td></tr>") . "\n<tr>" . (!$parent ? "<td colsan='2'" @@ -201,7 +227,7 @@ function forum_envoi( . http_img_pack('rien.gif', ' ', "width='10' height='13' border='0'") . "</td>\n<td ")) . " width='100%' valign='top' rowspan='2'>" - . debut_cadre_thread_forum("", true, "", typo($titre_message)) + . debut_cadre_thread_forum("", true, "", typo($titre_texte)) . propre($texte) . (!$nom_site ? '' : "<p><a href='$url_site'>$nom_site</a></p>") . "\n<div align='right'><input class='fondo' type='submit' name='valider_forum' value='" @@ -217,22 +243,7 @@ function forum_envoi( . http_img_pack("forum-droite$spip_lang_rtl.gif", $titre_parent, "width='10' height='13' border='0'") . "</td>\n</tr>")) . "</table>" - . "\n<div> </div>" - . $corps; - $parent = ''; - } - - $cat = intval($id) . '/' - . intval($id_parent) . '/' - . $statut . '/' - . $script . '/' - . $objet; - - echo $parent, - "\n<div> </div>" - . redirige_action_auteur('editer_forum',$cat, $script, "$objet=$id", $corps, "") - . "<a id='formulaire'></a>" - . fin_page(); + . "\n<div> </div>"; } ?> diff --git a/ecrire/inc/gadgets.php b/ecrire/inc/gadgets.php index 8e0bb2075d..7b5f891a1d 100644 --- a/ecrire/inc/gadgets.php +++ b/ecrire/inc/gadgets.php @@ -316,10 +316,16 @@ onmouseover=\"findObj_forcer('bandeautoutsite').style.visibility='visible'; char // FIN GADGET Navigation rapide // GADGET Recherche + // attribut non conforme ==> le generer dynamiquement + $js = 'this.setAttribute(\'autocomplete\', \'off\')'; $bandeau .= "<div id='bandeaurecherche' class='bandeau_couleur_sous' style='$spip_lang_left: 60px;'>" - . "<form method='get' style='margin: 0px; position: relative;' action='" . generer_url_ecrire("recherche") . "'>" + . "<form method='get' style='margin: 0px; position: relative;' action='" + . generer_url_ecrire("recherche") + . "'>" . "<input type='hidden' name='exec' value='recherche' />" - . "<input type=\"text\" id=\"form_recherche\" style=\"width: 140px;\" size=\"10\" value=\""._T('info_rechercher')."\" name=\"recherche\" onkeypress=\"t=window.setTimeout('lancer_recherche(\'form_recherche\',\'resultats_recherche\')', 200);\" autocomplete=\"off\" class=\"formo\" accesskey=\"r\" />" + . "<input type=\"text\" id=\"form_recherche\" style=\"width: 140px;\" size=\"10\" value=\"" + . _T('info_rechercher') + . "\" name=\"recherche\" onkeypress=\"$js;t=window.setTimeout('lancer_recherche(\'form_recherche\',\'resultats_recherche\')', 200);\" class=\"formo\" accesskey=\"r\" />" . "</form>" . "</div>"; // FIN GADGET recherche diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index dfbb364480..e55a6cec11 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -296,32 +296,6 @@ function fin_boite_info($return=false) { if ($return) return $r; else echo $r; } -// -// une autre boite -// -// http://doc.spip.org/@bandeau_titre_boite -function bandeau_titre_boite($titre, $afficher_auteurs, $boite_importante = true) { - global $couleur_foncee; - if ($boite_importante) { - $couleur_fond = $couleur_foncee; - $couleur_texte = '#FFFFFF'; - } - else { - $couleur_fond = '#EEEECC'; - $couleur_texte = '#000000'; - } - echo "<tr bgcolor='$couleur_fond'><td width=\"100%\"><font face='Verdana,Arial,Sans,sans-serif' size='3' color='$couleur_texte'>"; - echo "<b>$titre</b></font></td>"; - if ($afficher_auteurs){ - echo "<td width='100'>"; - echo http_img_pack("rien.gif", " ", "width='100' height='12'"); - echo "</td>"; - } - echo "<td width='90'>"; - echo http_img_pack("rien.gif", " ", "width='90' height='12'"); - echo "</td>"; - echo "</tr>"; -} // // une autre boite // @@ -1979,7 +1953,7 @@ if (true /*$bandeau_colore*/) { } echo "\n<div style=\"max-height: 40px; width: 100%; border-bottom: solid 1px white;$style\">"; - echo "<table align='center' cellpadding='0' style='background: none;' width='$largeur'><tr width='$largeur'>"; + echo "<table align='center' cellpadding='0' style='background: none;' width='$largeur'><tr>"; echo "<td valign='middle' class='bandeau_couleur' style='text-align: $spip_lang_left;'>"; @@ -2040,7 +2014,7 @@ if (true /*$bandeau_colore*/) { http_img_pack("$icone", "", "width='26' height='20'")."</a>"; echo http_img_pack("rien.gif", " ", "width='10' height='1'"); - echo http_img_pack("choix-layout$spip_lang_rtl".($spip_lang=='he'?'_he':'').".gif", "abc", "class='format_png' valign='middle' width='59' height='15' usemap='#map_layout'"); + echo http_img_pack("choix-layout$spip_lang_rtl".($spip_lang=='he'?'_he':'').".gif", "abc", "class='format_png' style='vertical-align: middle' width='59' height='15' usemap='#map_layout'"); echo http_img_pack("rien.gif", " ", "width='10' height='1'"); @@ -2217,7 +2191,7 @@ function debut_gauche($rubrique = "accueil", $return=false) { } $flag_3_colonnes = true; - $rspan = " rowspan=2"; + $rspan = " rowspan='2'"; } else { @@ -2226,7 +2200,7 @@ function debut_gauche($rubrique = "accueil", $return=false) { } $res = "<br /><table width='$largeur_ecran' cellpadding='0' cellspacing='0' border='0'> - <tr><td width='$largeur' class='colonne_etroite serif' valign='top' $rspan> + <tr>\n<td width='$largeur' class='colonne_etroite serif' valign='top' $rspan> <div style='width: ${largeur}px; overflow:hidden;'> \n"; @@ -2257,16 +2231,16 @@ function creer_colonne_droite($rubrique="", $return= false){ $largeur = 200; } - $res = "<td width='" + $res = "\n<td width='" . $espacement . "' rowspan='2' class='colonne_etroite'> </td>" - . "<td rowspan='1' class='colonne_etroite'></td>" - . "<td width='" + . "\n<td rowspan='1' class='colonne_etroite'></td>" + . "\n<td width='" . $espacement - . "'rowspan=2 class='colonne_etroite'> </td>" - . "<td width='" + . "'rowspan='2' class='colonne_etroite'> </td>" + . "\n<td width='" . $largeur - . "' rowspan=2 align='" + . "' rowspan='2' align='" . $spip_lang_left . "' valign='top' class='colonne_etroite'><p />"; @@ -2287,8 +2261,7 @@ function debut_droite($rubrique="", $return= false) { if ($options == "avancees") { - $res .= liste_articles_bloques() - . creer_colonne_droite($rubrique, true); + $res .= liste_articles_bloques(); } $res .= "<div> </div></td>"; @@ -2370,7 +2343,7 @@ function fin_page() { . '</div>')) . fin_grand_cadre(true) - . "</center></font>" + . "</center>" . $GLOBALS['rejoue_session'] . generer_spip_cron() . (defined('_TESTER_NOSCRIPT') ? _TESTER_NOSCRIPT : '') diff --git a/ecrire/inc/vieilles_defs.php b/ecrire/inc/vieilles_defs.php index c5f543ec9f..bfcfa5a000 100644 --- a/ecrire/inc/vieilles_defs.php +++ b/ecrire/inc/vieilles_defs.php @@ -114,4 +114,31 @@ function applatit_arbre($arbre,$separateur = " "){ return spip_xml_aplatit($arbre,$separateur); } + +// +// une autre boite +// +// http://doc.spip.org/@bandeau_titre_boite +function bandeau_titre_boite($titre, $afficher_auteurs, $boite_importante = true) { + global $couleur_foncee; + if ($boite_importante) { + $couleur_fond = $couleur_foncee; + $couleur_texte = '#FFFFFF'; + } + else { + $couleur_fond = '#EEEECC'; + $couleur_texte = '#000000'; + } + echo "<tr bgcolor='$couleur_fond'><td width=\"100%\"><font face='Verdana,Arial,Sans,sans-serif' size='3' color='$couleur_texte'>"; + echo "<b>$titre</b></font></td>"; + if ($afficher_auteurs){ + echo "<td width='100'>"; + echo http_img_pack("rien.gif", " ", "width='100' height='12'"); + echo "</td>"; + } + echo "<td width='90'>"; + echo http_img_pack("rien.gif", " ", "width='90' height='12'"); + echo "</td>"; + echo "</tr>"; +} ?> \ No newline at end of file -- GitLab