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

Mise en conformité XHTML du script de forum, rendu difficile par un bug de...

Mise en conformité XHTML du script de forum, rendu difficile par un bug de Safari qui ne tient pas compte du font-weigth des classes de balises div de niveau supérieur semble-t-il. Du coup, il a fallu introduire ce champ dans des style en dur dans le code de afficher_forum, encore une belle illustration de que la recherche de la conformité peut déboucher sur l'effet inverse de celui officiellement recherché. Entre des DTD percées (cf [8135]) et des moteurs de rendu qui rendent dur, on n'est pas gatés.

Suite de [8163], conformité XHTML du mode ecrire/oo dans le cadre de l'interface simplifiée (la complète reste à faire). Et répercusion du paramètre exec dans ecrire/oo/index pour passer d'un mode à l'autre à toute vitesse.
parent 3deef574
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -1433,7 +1433,7 @@ a.pashighlight { ...@@ -1433,7 +1433,7 @@ a.pashighlight {
display:block; display:block;
} }
a.highlight:hover, a.pashighlight:hover, { a.highlight:hover, a.pashighlight:hover {
color: #000; color: #000;
cursor: pointer; cursor: pointer;
} }
......
...@@ -107,7 +107,7 @@ if ($spip_display == 4) { ...@@ -107,7 +107,7 @@ if ($spip_display == 4) {
if ($activer_breves != "non") { if ($activer_breves != "non") {
$res .= icone_horizontale(_T('icone_nouvelle_breve'), generer_url_ecrire("breves_edit","new=oui"), "breve-24.gif","creer.gif"); $res .= icone_horizontale(_T('icone_nouvelle_breve'), generer_url_ecrire("breves_edit","new=oui"), "breve-24.gif","creer.gif", false);
} }
} }
else { else {
...@@ -116,7 +116,7 @@ if ($spip_display == 4) { ...@@ -116,7 +116,7 @@ if ($spip_display == 4) {
} }
} }
if ($connect_statut == '0minirezo' and $connect_toutes_rubriques) { if ($connect_statut == '0minirezo' and $connect_toutes_rubriques) {
$res .= icone_horizontale(_T('icone_creer_rubrique_2'), generer_url_ecrire("rubriques_edit","new=oui"), "rubrique-24.gif","creer.gif", true); $res .= icone_horizontale(_T('icone_creer_rubrique_2'), generer_url_ecrire("rubriques_edit","new=oui"), "rubrique-24.gif","creer.gif", false);
} }
echo bloc_des_raccourcis($res); echo bloc_des_raccourcis($res);
} else { } else {
...@@ -446,7 +446,7 @@ function exec_accueil_dist() ...@@ -446,7 +446,7 @@ function exec_accueil_dist()
$GLOBALS['meta']["activer_breves"], $GLOBALS['meta']["activer_breves"],
$GLOBALS['meta']["activer_sites"], $GLOBALS['meta']["activer_sites"],
$GLOBALS['meta']['articles_mots']); $GLOBALS['meta']['articles_mots']);
echo encours_accueil(); echo encours_accueil();
echo afficher_enfant_rub(0, false, true); echo afficher_enfant_rub(0, false, true);
......
...@@ -65,8 +65,6 @@ function exec_forum_dist() ...@@ -65,8 +65,6 @@ function exec_forum_dist()
exit; exit;
} }
echo "<div class='serif2'>";
$result_forum = spip_query("SELECT COUNT(*) AS cnt FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 LIMIT 11"); $result_forum = spip_query("SELECT COUNT(*) AS cnt FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 LIMIT 11");
$total = ($row = spip_fetch_array($result_forum)) ? $row['cnt'] : 0; $total = ($row = spip_fetch_array($result_forum)) ? $row['cnt'] : 0;
...@@ -78,13 +76,10 @@ function exec_forum_dist() ...@@ -78,13 +76,10 @@ function exec_forum_dist()
icone (_T('icone_poster_message'), generer_url_ecrire("forum_envoi", "statut=$statutforum&script=$script"), $logo, "creer.gif"); icone (_T('icone_poster_message'), generer_url_ecrire("forum_envoi", "statut=$statutforum&script=$script"), $logo, "creer.gif");
echo "\n</div>"; echo "\n</div>";
echo "\n<p align='left'>";
$limit = $debut ? "LIMIT $debut,10" : "LIMIT 10" ; $limit = $debut ? "LIMIT $debut,10" : "LIMIT 10" ;
$result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 ORDER BY date_heure DESC $limit"); $result_forum = spip_query("SELECT * FROM spip_forum WHERE statut='$statutforum' AND id_parent=0 ORDER BY date_heure DESC $limit");
echo afficher_forum($result_forum,$script,''); echo afficher_forum($result_forum,$script,'');
echo "</p></div>";
echo fin_gauche(), fin_page(); echo fin_gauche(), fin_page();
} }
......
...@@ -173,7 +173,7 @@ function rechercher_auteurs_articles($cherche_auteur, $ids, $id_article) ...@@ -173,7 +173,7 @@ function rechercher_auteurs_articles($cherche_auteur, $ids, $id_article)
// http://doc.spip.org/@afficher_auteurs_articles // http://doc.spip.org/@afficher_auteurs_articles
function afficher_auteurs_articles($id_article, $flag_editable, $les_auteurs) function afficher_auteurs_articles($id_article, $flag_editable, $les_auteurs)
{ {
global $connect_statut, $options,$connect_id_auteur; global $connect_statut, $options,$connect_id_auteur, $spip_display;
if (!$les_auteurs) return ''; if (!$les_auteurs) return '';
...@@ -192,9 +192,12 @@ function afficher_auteurs_articles($id_article, $flag_editable, $les_auteurs) ...@@ -192,9 +192,12 @@ function afficher_auteurs_articles($id_article, $flag_editable, $les_auteurs)
$largeurs = array('14', '', '', '', '', ''); $largeurs = array('14', '', '', '', '', '');
$styles = array('arial11', 'arial2', 'arial11', 'arial11', 'arial11', 'arial1'); $styles = array('arial11', 'arial2', 'arial11', 'arial11', 'arial11', 'arial1');
return "<div class='liste'><table width='100%' cellpadding='3' cellspacing='0' border='0'>" $t = afficher_liste($largeurs, $table, $styles);
. afficher_liste($largeurs, $table, $styles) if ($spip_display != 4)
. "</table></div>\n"; $t = "<table width='100%' cellpadding='3' cellspacing='0' border='0'>"
. $t
. "</table>";
return "<div class='liste'>$t</div>\n";
} }
......
...@@ -971,26 +971,24 @@ function afficher_rubriques_boucle($row, &$tous_id) ...@@ -971,26 +971,24 @@ function afficher_rubriques_boucle($row, &$tous_id)
$lang = traduire_nom_langue($row['lang']); $lang = traduire_nom_langue($row['lang']);
$langue_choisie = $row['langue_choisie']; $langue_choisie = $row['langue_choisie'];
if ($langue_choisie == "oui") $lang = "<b>$lang</b>";
else $lang = "($lang)";
if ($id_parent == 0) $puce = "secteur-12.gif"; if ($id_parent == 0) $puce = "secteur-12.gif";
else $puce = "rubrique-12.gif"; else $puce = "rubrique-12.gif";
$s = http_img_pack($puce, '', ""); $vals[] = http_img_pack($puce, '', "");
$vals[] = $s;
$s = "<b><a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "'>"; $s = "<a href='" . generer_url_ecrire("naviguer","id_rubrique=$id_rubrique") . "' style='font-weight: bold;'>";
$s .= typo($titre); $s .= typo($titre);
$s .= "</a></b>"; $s .= "</a>";
$vals[] = $s; $vals[] = $s;
$s = "\n<div align=\"right\">"; $s = "\n<div align=\"right\">";
if ($GLOBALS['meta']['multi_rubriques'] == 'oui') { if ($GLOBALS['meta']['multi_rubriques'] == 'oui') {
$s .= ($lang); if ($langue_choisie == "oui") $s .= "<b>$lang</b>";
else $s .= "($lang)";
} }
$s .= "</div>"; $s .= "</div>";
$vals[] = $s; $vals[] = $s;
return $vals; return $vals;
} }
...@@ -1059,24 +1057,23 @@ function afficher_forum($request, $retour, $arg, $controle_id_article = false) { ...@@ -1059,24 +1057,23 @@ function afficher_forum($request, $retour, $arg, $controle_id_article = false) {
$thread[$compteur_forum] = 1; $thread[$compteur_forum] = 1;
$res = ''; $res = '';
if ($spip_display == 4) $res = "<ul>";
if ($spip_display == 4) $res .= "<ul>";
while($row = spip_fetch_array($request)) { while($row = spip_fetch_array($request)) {
$statut=$row['statut']; $statut=$row['statut'];
if ($compteur_forum==1) $res .= "\n<br />";
if (($controle_id_article) ? ($statut!="perso") : if (($controle_id_article) ? ($statut!="perso") :
(($statut=="prive" OR $statut=="privrac" OR $statut=="privadm" OR $statut=="perso") (($statut=="prive" OR $statut=="privrac" OR $statut=="privadm" OR $statut=="perso")
OR ($statut=="publie" AND $id_parent > 0))) { OR ($statut=="publie" AND $id_parent > 0))) {
$res .= afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $thread, $retour, $arg);
$res .= afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_forum, $thread, $retour, $arg) $res .= afficher_forum(spip_query("SELECT * FROM spip_forum WHERE id_parent='" . $row['id_forum'] . "'" . ($controle_id_article ? '':" AND statut<>'off'") . " ORDER BY date_heure"), $retour, $arg, $controle_id_article);
. afficher_forum(spip_query("SELECT * FROM spip_forum WHERE id_parent='" . $row['id_forum'] . "'" . ($controle_id_article ? '':" AND statut<>'off'") . " ORDER BY date_heure"), $retour, $arg, $controle_id_article);
} }
$thread[$compteur_forum]++; $thread[$compteur_forum]++;
} }
if ($spip_display == 4) $res .= "</ul>";
spip_free_result($request); spip_free_result($request);
$compteur_forum--; $compteur_forum--;
if ($spip_display == 4) $res .= "</ul>";
return $res; return $res;
} }
...@@ -1109,10 +1106,10 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1109,10 +1106,10 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
$ip=$row["ip"]; $ip=$row["ip"];
$id_auteur=$row["id_auteur"]; $id_auteur=$row["id_auteur"];
$res = "<a id='id$id_forum'></a>"; $deb = "<a id='id$id_forum'></a>";
if ($spip_display == 4) { if ($spip_display == 4) {
$res .= "\n<li>".typo($titre)."<br />"; $res .= "\n<li>$deb".typo($titre)."<br />";
} else { } else {
$titre_boite = ''; $titre_boite = '';
...@@ -1128,14 +1125,15 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1128,14 +1125,15 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
$titre_boite .= typo($titre); $titre_boite .= typo($titre);
$res .= "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>"; $res .= "$deb<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>"
$res .= afficher_forum_4($compteur_forum, $nb_forum, $i); . afficher_forum_4($compteur_forum, $nb_forum, $i)
. "\n<td style='width: 100%' valign='top'>";
if ($compteur_forum == 1) if ($compteur_forum == 1)
$res .= afficher_forum_logo($statut, $titre_boite); $res .= '<br />'
. debut_cadre_forum(forum_logo($statut), true, "", $titre_boite);
else $res .= debut_cadre_thread_forum("", true, "", $titre_boite); else $res .= debut_cadre_thread_forum("", true, "", $titre_boite);
} }
// Si refuse, cadre rouge // Si refuse, cadre rouge
if ($statut=="off") { if ($statut=="off") {
$res .= "\n<div style='border: 2px dashed red; padding: 5px;'>"; $res .= "\n<div style='border: 2px dashed red; padding: 5px;'>";
...@@ -1149,7 +1147,7 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1149,7 +1147,7 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
$res .= "\n<div style='border: 1px solid green; padding: 5px;'>"; $res .= "\n<div style='border: 1px solid green; padding: 5px;'>";
} }
$res .= "<span class='arial2'>". date_interface($date_heure) . "</span>&nbsp;&nbsp;"; $res .= "<div style='font-weight: normal;'>". date_interface($date_heure) . "&nbsp;&nbsp;";
if ($id_auteur) { if ($id_auteur) {
$formater_auteur = charger_fonction('formater_auteur', 'inc'); $formater_auteur = charger_fonction('formater_auteur', 'inc');
...@@ -1166,11 +1164,13 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1166,11 +1164,13 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
$res .= safehtml("<span class='arial2'> / <b>$auteur</b></span>"); $res .= safehtml("<span class='arial2'> / <b>$auteur</b></span>");
} }
$res .= '</div>';
// boutons de moderation // boutons de moderation
if ($controle_id_article) if ($controle_id_article)
$res .= boutons_controle_forum($id_forum, $statut, $id_auteur, "id_article=$id_article", $ip); $res .= boutons_controle_forum($id_forum, $statut, $id_auteur, "id_article=$id_article", $ip);
$res .= safehtml(justifier(propre($texte))); $res .= safehtml(justifier(propre("<div style='font-weight: normal;'>$texte</div>")));
if ($nom_site) { if ($nom_site) {
if (strlen($url_site) > 10) if (strlen($url_site) > 10)
...@@ -1182,7 +1182,7 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1182,7 +1182,7 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
$tm = rawurlencode($titre); $tm = rawurlencode($titre);
$res .= "\n<div align='right' class='verdana1'>" $res .= "\n<div align='right' class='verdana1'>"
. "<b><a href='" . "<b><a href='"
. generer_url_ecrire("forum_envoi", "id_parent=$id_forum&titre_message=$tm&script=$retour") . '#formulaire' . generer_url_ecrire("forum_envoi", "id_parent=$id_forum&titre_message=$tm&script=$retour") . '#formulaire'
. "'>" . "'>"
. _T('lien_repondre_message') . _T('lien_repondre_message')
. "</a></b></div>"; . "</a></b></div>";
...@@ -1190,7 +1190,7 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1190,7 +1190,7 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
if ($GLOBALS['meta']["mots_cles_forums"] == "oui") if ($GLOBALS['meta']["mots_cles_forums"] == "oui")
$res .= afficher_forum_mots($id_forum); $res .= afficher_forum_mots($id_forum);
if ($statut == "off" OR $statut == "prop") $res .= "</div>"; if ($statut == "off" OR $statut == "prop") $res .= "</div>";
if ($spip_display != 4) { if ($spip_display != 4) {
...@@ -1203,14 +1203,12 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_ ...@@ -1203,14 +1203,12 @@ function afficher_forum_thread($row, $controle_id_article, $compteur_forum, $nb_
} }
// http://doc.spip.org/@afficher_forum_logo function forum_logo($statut)
function afficher_forum_logo($statut, $titre_boite)
{ {
if ($statut == "prive") $logo = "forum-interne-24.gif"; if ($statut == "prive") return "forum-interne-24.gif";
else if ($statut == "privadm") $logo = "forum-admin-24.gif"; else if ($statut == "privadm") return "forum-admin-24.gif";
else if ($statut == "privrac") $logo = "forum-interne-24.gif"; else if ($statut == "privrac") return "forum-interne-24.gif";
else $logo = "forum-public-24.gif"; else return "forum-public-24.gif";
return debut_cadre_forum($logo, true, "", $titre_boite);
} }
// http://doc.spip.org/@afficher_forum_mots // http://doc.spip.org/@afficher_forum_mots
...@@ -1252,7 +1250,7 @@ function afficher_forum_4($compteur_forum, $nb_forum, $thread) ...@@ -1252,7 +1250,7 @@ function afficher_forum_4($compteur_forum, $nb_forum, $thread)
. http_img_pack($fleche, "", "width='10' height='13'") . http_img_pack($fleche, "", "width='10' height='13'")
. "</td>\n"; . "</td>\n";
} }
return $res . "\n<td style='width: 100%' valign='top'>"; return $res;
} }
......
...@@ -17,7 +17,7 @@ include_spip('inc/presentation'); ...@@ -17,7 +17,7 @@ include_spip('inc/presentation');
// http://doc.spip.org/@inc_referencer_traduction_dist // http://doc.spip.org/@inc_referencer_traduction_dist
function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_trad, $trad_err='') function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_trad, $trad_err='')
{ {
global $connect_statut, $couleur_claire, $options, $connect_toutes_rubriques, $spip_lang_right, $dir_lang; global $connect_statut, $couleur_claire, $options, $connect_toutes_rubriques, $spip_lang_right, $spip_display, $dir_lang;
if (! (($GLOBALS['meta']['multi_articles'] == 'oui') if (! (($GLOBALS['meta']['multi_articles'] == 'oui')
OR (($GLOBALS['meta']['multi_rubriques'] == 'oui') OR (($GLOBALS['meta']['multi_rubriques'] == 'oui')
...@@ -63,17 +63,23 @@ function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_tr ...@@ -63,17 +63,23 @@ function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_tr
$largeurs = array(7, 12, '', 100); $largeurs = array(7, 12, '', 100);
$styles = array('', '', 'arial2', 'arial2'); $styles = array('', '', 'arial2', 'arial2');
$t = afficher_liste($largeurs, $table, $styles);
if ($spip_display != 4)
$t = "\n<table width='100%' cellpadding='2' cellspacing='0' border='0'>"
. $t
. "</table>\n";
$liste = "\n<div class='liste'>" $liste = "\n<div class='liste'>"
. bandeau_titre_boite2( '<b>' . _T('trad_article_traduction') . '</b>','', 'white', 'black', false) . bandeau_titre_boite2( '<b>' . _T('trad_article_traduction') . '</b>','', 'white', 'black', false)
. "<table width='100%' cellspacing='0' border='0' cellpadding='2'>" . $t
. afficher_liste ($largeurs, $table, $styles)
. "</table>"
. "</div>"; . "</div>";
} }
// changer les globales $dir_lang etc // changer les globales $dir_lang etc
changer_typo($langue_article); changer_typo($langue_article);
// Participation aux Traductions pas pour Mal-voyant. A completer
if ($spip_display == 4) $form =''; else {
$form = "<table width='100%'><tr>"; $form = "<table width='100%'><tr>";
if ($flag AND $options == "avancees" AND !$table) { if ($flag AND $options == "avancees" AND !$table) {
...@@ -107,7 +113,7 @@ function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_tr ...@@ -107,7 +113,7 @@ function inc_referencer_traduction_dist($id_article, $flag, $id_rubrique, $id_tr
} }
$form .= "</tr></table>"; $form .= "</tr></table>";
}
if ($GLOBALS['meta']['gerer_trad'] == 'oui') if ($GLOBALS['meta']['gerer_trad'] == 'oui')
$bouton = _T('titre_langue_trad_article'); $bouton = _T('titre_langue_trad_article');
else else
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
// ACCESSIBILITE // ACCESSIBILITE
// la page /oo offre une lecture en mode "texte seul" // la page /oo offre une lecture en mode "texte seul"
// des 3 articles les plus recents...
@header("Location: ../?set_disp=4&set_options=basiques"); @header("Location: ../?set_disp=4&set_options=basiques&exec=" . $_REQUEST['exec']);
?> ?>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter