From ff96585060cf22f299799e5109da9f29e45a0b54 Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Thu, 5 Oct 2006 13:01:08 +0000
Subject: [PATCH] Est-ce qu'un jour je vais comprendre les CSS ? Plus qq mises
 au propre.

---
 ecrire/exec/documenter.php |  6 ++++--
 ecrire/inc/actions.php     |  2 +-
 ecrire/inc/documenter.php  |  4 ++--
 ecrire/inc/joindre.php     |  4 +---
 ecrire/inc/legender.php    | 11 ++++++++---
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/ecrire/exec/documenter.php b/ecrire/exec/documenter.php
index ff381cd7c3..2a1ff9b2b5 100644
--- a/ecrire/exec/documenter.php
+++ b/ecrire/exec/documenter.php
@@ -18,6 +18,7 @@ include_spip('inc/texte');
 function exec_documenter_dist()
 {
 	$type = _request("type");
+	$script = _request("script"); // generalisation a tester
 	$s = _request("s");
 	$id = intval(_request(($type == 'article') ? 'id_article' : 'id_rubrique'));
 
@@ -41,7 +42,8 @@ function exec_documenter_dist()
 		minipres(_T('info_acces_interdit'));
 	}
 
-	$f = charger_fonction('documenter', 'inc');
-	return $f($id, $type, $album, 'ajax');
+	$documenter = charger_fonction('documenter', 'inc');
+	return $documenter($id, $type, $album, 'ajax', '', $script);
+
 }
 ?>
diff --git a/ecrire/inc/actions.php b/ecrire/inc/actions.php
index a6b4ec4b22..c1f58acaed 100644
--- a/ecrire/inc/actions.php
+++ b/ecrire/inc/actions.php
@@ -200,7 +200,7 @@ function declencheur_action_ajax($request, $noeud, $fct_ajax)
 	. ")'";
 }
 
-function greffe_action_ajax($idom, $corps, $atts='')
+function greffe_action_ajax($idom, $corps)
 {
 	return _request('var_ajaxcharset')
 	? $corps
diff --git a/ecrire/inc/documenter.php b/ecrire/inc/documenter.php
index b3e3878e77..be4bcf40be 100644
--- a/ecrire/inc/documenter.php
+++ b/ecrire/inc/documenter.php
@@ -97,7 +97,7 @@ function inc_documenter_dist(
 
 		if (count($documents) > 3) {
 			$head .= "<div style='background-color: #dddddd; padding: 4px; color: black; text-align: right' class='arial1'>"
-			  . ajax_action_auteur('documenter', "$s$doc/$type", $GLOBALS['exec'], "id_$type=$doc&s=$s&type=$type",array(_L('Supprimer_tout')))
+			. ajax_action_auteur('documenter', "$s$doc/$type", $script, "id_$type=$doc&s=$s&type=$type",array(_L('Supprimer_tout')))
 			. "</div>\n";
 		}
 	} else $head = '';
@@ -107,5 +107,5 @@ function inc_documenter_dist(
 	. $res
 	. "</table>";	  
 
-	return greffe_action_ajax("documenter-$s$doc", $res);
+	return greffe_action_ajax("documenter-$s$doc", $res, $flag==='ajax');
 }
diff --git a/ecrire/inc/joindre.php b/ecrire/inc/joindre.php
index a9f63d1cf4..85bdbcfdcd 100644
--- a/ecrire/inc/joindre.php
+++ b/ecrire/inc/joindre.php
@@ -72,13 +72,11 @@ function inc_joindre_dist($script, $args, $id=0, $intitule='', $mode='', $type='
 	else
 		$res = $res . $milieu;
 
-	$f = generer_action_auteur('joindre',
+	return generer_action_auteur('joindre',
 		(intval($id) .'/' .intval($id_document) . "/$mode/$type"),
 		generer_url_ecrire($script, $args),
 		"$debut$intitule$res$dir_ftp$distant$fin",
 		" method='post' enctype='multipart/form-data' style='border: 0px; margin: 0px;'");
-
-	return $f;
 }
 
 
diff --git a/ecrire/inc/legender.php b/ecrire/inc/legender.php
index a753cff09f..92de13a3c5 100644
--- a/ecrire/inc/legender.php
+++ b/ecrire/inc/legender.php
@@ -110,11 +110,16 @@ function inc_legender_dist($id_document, $document, $script, $type, $id, $ancre)
 	. "\n\n\n\n"
 	. icone_horizontale($texte, $action, $supp, "supprimer.gif", false);
 
-	$corps = block_parfois_visible("legender-aff-$id_document", $entete, $corps, "text-align:center;", $flag);
 
-	$atts = " class='verdana1' style='color: " . $GLOBALS['couleur_foncee'] . "; border: 1px solid ". $GLOBALS['couleur_foncee'] .";  padding: 5px; margin: 3px; background-color: white;'";
+	$corps = "<div class='verdana1' style='color: "
+	. $GLOBALS['couleur_foncee']
+	. "; border: 1px solid "
+	. $GLOBALS['couleur_foncee']
+	. ";  padding: 5px; margin: 3px; background-color: white;'>"
+	. block_parfois_visible("legender-aff-$id_document", $entete, $corps, "text-align:center;", $flag)
+	. "</div>";
 
-	return greffe_action_ajax("legender-$id_document", $corps, $atts);
+	return greffe_action_ajax("legender-$id_document", $corps);
 }
 
 
-- 
GitLab