Code Duplication    Length = 19-19 lines in 2 locations

ecrire/inc/filtres.php 2 locations

@@ 3247-3265 (lines=19) @@
3244
 * @return string
3245
 *      Code HTML résultant
3246
 **/
3247
function env_to_params($env, $ignore_params = array()) {
3248
	$ignore_params = array_merge(
3249
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3250
		$ignore_params
3251
	);
3252
	if (!is_array($env)) {
3253
		$env = unserialize($env);
3254
	}
3255
	$texte = "";
3256
	if ($env) {
3257
		foreach ($env as $i => $j) {
3258
			if (is_string($j) and !in_array($i, $ignore_params)) {
3259
				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3260
			}
3261
		}
3262
	}
3263
3264
	return $texte;
3265
}
3266
3267
/**
3268
 * Écrit des attributs HTML à partir d'un tableau de données tel que `#ENV`
@@ 3286-3304 (lines=19) @@
3283
 * @return string
3284
 *      Code HTML résultant
3285
 **/
3286
function env_to_attributs($env, $ignore_params = array()) {
3287
	$ignore_params = array_merge(
3288
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3289
		$ignore_params
3290
	);
3291
	if (!is_array($env)) {
3292
		$env = unserialize($env);
3293
	}
3294
	$texte = "";
3295
	if ($env) {
3296
		foreach ($env as $i => $j) {
3297
			if (is_string($j) and !in_array($i, $ignore_params)) {
3298
				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3299
			}
3300
		}
3301
	}
3302
3303
	return $texte;
3304
}
3305
3306
3307
/**