Code Duplication    Length = 19-19 lines in 2 locations

ecrire/inc/filtres.php 2 locations

@@ 3257-3275 (lines=19) @@
3254
 * @return string
3255
 *      Code HTML résultant
3256
 **/
3257
function env_to_params($env, $ignore_params = array()) {
3258
	$ignore_params = array_merge(
3259
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3260
		$ignore_params
3261
	);
3262
	if (!is_array($env)) {
3263
		$env = unserialize($env);
3264
	}
3265
	$texte = "";
3266
	if ($env) {
3267
		foreach ($env as $i => $j) {
3268
			if (is_string($j) and !in_array($i, $ignore_params)) {
3269
				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3270
			}
3271
		}
3272
	}
3273
3274
	return $texte;
3275
}
3276
3277
/**
3278
 * Écrit des attributs HTML à partir d'un tableau de données tel que `#ENV`
@@ 3296-3314 (lines=19) @@
3293
 * @return string
3294
 *      Code HTML résultant
3295
 **/
3296
function env_to_attributs($env, $ignore_params = array()) {
3297
	$ignore_params = array_merge(
3298
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3299
		$ignore_params
3300
	);
3301
	if (!is_array($env)) {
3302
		$env = unserialize($env);
3303
	}
3304
	$texte = "";
3305
	if ($env) {
3306
		foreach ($env as $i => $j) {
3307
			if (is_string($j) and !in_array($i, $ignore_params)) {
3308
				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3309
			}
3310
		}
3311
	}
3312
3313
	return $texte;
3314
}
3315
3316
3317
/**