Code Duplication    Length = 19-19 lines in 2 locations

ecrire/inc/filtres.php 2 locations

@@ 3281-3299 (lines=19) @@
3278
 * @return string
3279
 *      Code HTML résultant
3280
 **/
3281
function env_to_params($env, $ignore_params = array()) {
3282
	$ignore_params = array_merge(
3283
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3284
		$ignore_params
3285
	);
3286
	if (!is_array($env)) {
3287
		$env = unserialize($env);
3288
	}
3289
	$texte = "";
3290
	if ($env) {
3291
		foreach ($env as $i => $j) {
3292
			if (is_string($j) and !in_array($i, $ignore_params)) {
3293
				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3294
			}
3295
		}
3296
	}
3297
3298
	return $texte;
3299
}
3300
3301
/**
3302
 * Écrit des attributs HTML à partir d'un tableau de données tel que `#ENV`
@@ 3320-3338 (lines=19) @@
3317
 * @return string
3318
 *      Code HTML résultant
3319
 **/
3320
function env_to_attributs($env, $ignore_params = array()) {
3321
	$ignore_params = array_merge(
3322
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3323
		$ignore_params
3324
	);
3325
	if (!is_array($env)) {
3326
		$env = unserialize($env);
3327
	}
3328
	$texte = "";
3329
	if ($env) {
3330
		foreach ($env as $i => $j) {
3331
			if (is_string($j) and !in_array($i, $ignore_params)) {
3332
				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3333
			}
3334
		}
3335
	}
3336
3337
	return $texte;
3338
}
3339
3340
3341
/**