From 750cbec946a78a397ba4a7c0d6f3f82e7ba977c1 Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Sun, 19 Feb 2006 19:43:48 +0000
Subject: [PATCH] autoriser les squelettes inclus a avoir des tableaux comme
 argument

---
 inc-compilo.php3 | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/inc-compilo.php3 b/inc-compilo.php3
index 9e8e3dd037..f26d15e7e6 100644
--- a/inc-compilo.php3
+++ b/inc-compilo.php3
@@ -57,13 +57,13 @@ function calculer_inclure($struct, $descr, &$boucles, $id_boucle) {
 	$l = array();
 	foreach($struct->param as $val) {
 		$var = array_shift($val);
-		$l[] = "\'$var\' => \'' . addslashes(" .
-		    ($val ? calculer_liste($val[0], $descr, $boucles, $id_boucle) :
-		    (($var =='lang') ?
-		     '$GLOBALS["spip_lang"]' :
-		     index_pile($id_boucle, $var, $boucles)))
-		    . ") . '\\'";
-		}
+		$futurval = ($val ? calculer_liste($val[0], $descr, $boucles, $id_boucle) :(($var =='lang') ? '$GLOBALS["spip_lang"]' : index_pile($id_boucle, $var, $boucles))); 
+		$l[] = "\'$var\' => ' . (!is_array(\$x = " .
+		  $futurval . 
+		  ") ? (\"'\" . addslashes(\$x) . \"'\") :
+ 		argumenter_balise_dynamique(array(\$x))) . '";
+
+	}
 
 	return "\n'<".
 		"?php\n\t\$contexte_inclus = array(" .
-- 
GitLab