From 3ff9ea246afbff4526b27455d76765e6e3ee8bab Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Sat, 20 Jan 2007 09:22:43 +0000
Subject: [PATCH] =?UTF-8?q?Encore=20qq=20ind=C3=A9finis=20en=20moins,=20pa?=
 =?UTF-8?q?s=20graves=20en=20g=C3=A9n=C3=A9ral=20(St=C3=A9phane).?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/exec/accueil.php       |  2 +-
 ecrire/exec/naviguer.php      |  2 +-
 ecrire/exec/rechercher.php    |  4 ++--
 ecrire/exec/sites.php         |  3 ---
 ecrire/inc/actions.php        |  8 ++++----
 ecrire/inc/filtres_images.php |  5 ++---
 ecrire/inc/presentation.php   | 12 +++++++-----
 7 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/ecrire/exec/accueil.php b/ecrire/exec/accueil.php
index 61a42d1829..393dac15ab 100644
--- a/ecrire/exec/accueil.php
+++ b/ecrire/exec/accueil.php
@@ -22,7 +22,7 @@ function encours_accueil()
 	// Les articles a valider
 	//
 
-	$res .=  afficher_articles(_T('info_articles_proposes'), array("WHERE" => "statut='prop'", 'ORDER BY' => "date DESC"));
+	$res =  afficher_articles(_T('info_articles_proposes'), array("WHERE" => "statut='prop'", 'ORDER BY' => "date DESC"));
 
 	//
 	// Les breves a valider
diff --git a/ecrire/exec/naviguer.php b/ecrire/exec/naviguer.php
index 6d247c5e25..e311358326 100644
--- a/ecrire/exec/naviguer.php
+++ b/ecrire/exec/naviguer.php
@@ -36,7 +36,7 @@ function exec_naviguer_dist()
 		exit;
 	      }
 
-	else $statut = $titre = $descriptif = $texte = $extra = '';
+	else $statut = $titre = $descriptif = $texte = $extra = $id_parent='';
 
 	if ($id_rubrique ==  0) $ze_logo = "racine-site-24.gif";
 	else if ($id_parent == 0) $ze_logo = "secteur-24.gif";
diff --git a/ecrire/exec/rechercher.php b/ecrire/exec/rechercher.php
index e1c992f561..311b52c7d3 100644
--- a/ecrire/exec/rechercher.php
+++ b/ecrire/exec/rechercher.php
@@ -76,7 +76,7 @@ function exec_rechercher_dist()
 		}
 	}
 
-	ajax_retour(proposer_item($points, $rub, $rac));
+	ajax_retour(proposer_item($points, $rub, $rac, $type));
 
 }
 
@@ -86,7 +86,7 @@ function exec_rechercher_dist()
 // ==> attention a composer le message d'erreur avec au moins 2 balises
 
 // http://doc.spip.org/@proposer_item
-function proposer_item ($ids, $titles, $rac)
+function proposer_item ($ids, $titles, $rac, $type)
 {
 
 	if (!$ids)
diff --git a/ecrire/exec/sites.php b/ecrire/exec/sites.php
index 9c7a2637ad..0496b95bdc 100644
--- a/ecrire/exec/sites.php
+++ b/ecrire/exec/sites.php
@@ -14,7 +14,6 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
 include_spip('inc/presentation');
 include_spip('inc/sites_voir');
 include_spip('inc/syndic');
-include_spip('inc/rubriques');
 include_spip('inc/mots');
 include_spip('inc/date');
 include_spip('inc/config');
@@ -186,8 +185,6 @@ function exec_sites_dist()
 	if ($syndication == "oui" OR $syndication == "off" OR $syndication == "sus") {
 		echo "<p class='verdana1 spip_medium'><a href='".htmlspecialchars($url_syndic)."'>",	http_img_pack('feed.png', 'RSS', ''),	'</a> <b>'._T('info_site_syndique').'</b></p>';
 
-		if ($erreur_syndic)
-			echo "<p style='color: red; font-weight: bold;'>",$erreur_syndic,"</p>";
 
 		if ($syndication == "off" OR $syndication=="sus") {
 			debut_boite_info();
diff --git a/ecrire/inc/actions.php b/ecrire/inc/actions.php
index 7d81706e06..3b58083710 100644
--- a/ecrire/inc/actions.php
+++ b/ecrire/inc/actions.php
@@ -79,8 +79,6 @@ function ajax_action_auteur($action, $id, $script, $args='', $corps=false, $args
 
 	// Lien (GET)
 	else {
-		list($clic, $att) = $corps;
-
 		$href = redirige_action_auteur($action,
 			$id,
 			$script,
@@ -94,10 +92,12 @@ function ajax_action_auteur($action, $id, $script, $args='', $corps=false, $args
 			$action,
 			"var_ajaxcharset=utf-8&script=$script$args_ajax");
 
-		if ($att) $clic = "\n<span$att>$clic</span>";
+		$cli = array_shift($corps);
 		return "<a href='$href'\nonclick="
 		.  ajax_action_declencheur($ajax, $ancre, $fct_ajax)
-		. ">$clic</a>";
+		. ">"
+		. (!$corps ?  $cli : ("\n<span" . $corps[0] . ">$cli</span>"))
+		. "</a>";
 	}
 }
 
diff --git a/ecrire/inc/filtres_images.php b/ecrire/inc/filtres_images.php
index 3b59ba15e7..926e60ad62 100644
--- a/ecrire/inc/filtres_images.php
+++ b/ecrire/inc/filtres_images.php
@@ -144,7 +144,7 @@ function image_tag_changer_taille($tag,$width,$height,$style=false){
 	if ($style===false) $style = extraire_attribut($tag,'style');
 	// enlever le width et height du style
 	$style = preg_replace(",(^|;)\s*(width|height)\s*:\s*[^;]+,ims","",$style);
-	if ($style{0}==';') $style=substr($style,1);
+	if ($style AND $style{0}==';') $style=substr($style,1);
 	// mettre des attributs de width et height sur les images, 
 	// ca accelere le rendu du navigateur
 	// ca permet aux navigateurs de reserver la bonne taille 
@@ -522,8 +522,7 @@ function image_reduire($img, $taille = -1, $taille_y = -1, $force=false, $cherch
 		if ($srcw = extraire_attribut($img, 'width')
 		AND $srch = extraire_attribut($img, 'height')) {
 			list($w,$h) = image_ratio($srcw, $srch, $taille, $taille_y);
-			$img = image_tag_changer_taille($tag,$w,$h);
-			return $img;
+			return image_tag_changer_taille($img,$w,$h);
 		}
 		// la on n'a pas d'infos sur l'image source... on refile le truc a css
 		// sous la forme style='max-width: NNpx;'
diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php
index d5b327cf78..cd4e9a88c1 100644
--- a/ecrire/inc/presentation.php
+++ b/ecrire/inc/presentation.php
@@ -341,6 +341,7 @@ function afficher_liste_display_neq4($largeurs, $t, $styles = '') {
 
 	reset($largeurs);
 	if ($styles) reset($styles);
+	$res ='';
 	while (list(, $texte) = each($t)) {
 		$style = $largeur = "";
 		list(, $largeur) = each($largeurs);
@@ -580,10 +581,6 @@ function puce_statut_article($id, $statut, $id_rubrique, $type='article', $ajax
 function puce_statut_breve($id, $statut, $type, $droit='AUTO') {
 	global $spip_lang_left, $dir_lang;
 
-	if ($droit == 'AUTO') {
-		include_spip('inc/autoriser');
-		$droit = autoriser('publierdans', 'rubrique', $id_rubrique);
-	}
 	$puces = array(
 		       0 => 'puce-orange-breve.gif',
 		       1 => 'puce-verte-breve.gif',
@@ -615,8 +612,13 @@ function puce_statut_breve($id, $statut, $type, $droit='AUTO') {
 	$type1 = "statut$type$id"; 
 	$inser_puce = http_img_pack($puce, $title, "id='img$type1' style='margin: 1px;'");
 
-	if (!$droit) return $inser_puce;
+	if (!$droit || $droit=='AUTO') return $inser_puce;
 	
+	/*	if ($droit == 'AUTO') { # id_rubrique indefinie. a revoir.
+		include_spip('inc/autoriser');
+		$droit = autoriser('publierdans', 'rubrique', $id_rubrique);
+		} */
+
 	$type2 = "statutdecal$type$id";
 	$action = "\nonmouseover=\"montrer('$type2');\"";
 
-- 
GitLab