Code Duplication    Length = 19-19 lines in 2 locations

ecrire/inc/filtres.php 2 locations

@@ 3237-3255 (lines=19) @@
3234
 * @return string
3235
 *      Code HTML résultant
3236
 **/
3237
function env_to_params($env, $ignore_params = array()) {
3238
	$ignore_params = array_merge(
3239
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3240
		$ignore_params
3241
	);
3242
	if (!is_array($env)) {
3243
		$env = unserialize($env);
3244
	}
3245
	$texte = "";
3246
	if ($env) {
3247
		foreach ($env as $i => $j) {
3248
			if (is_string($j) and !in_array($i, $ignore_params)) {
3249
				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3250
			}
3251
		}
3252
	}
3253
3254
	return $texte;
3255
}
3256
3257
/**
3258
 * Écrit des attributs HTML à partir d'un tableau de données tel que `#ENV`
@@ 3276-3294 (lines=19) @@
3273
 * @return string
3274
 *      Code HTML résultant
3275
 **/
3276
function env_to_attributs($env, $ignore_params = array()) {
3277
	$ignore_params = array_merge(
3278
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3279
		$ignore_params
3280
	);
3281
	if (!is_array($env)) {
3282
		$env = unserialize($env);
3283
	}
3284
	$texte = "";
3285
	if ($env) {
3286
		foreach ($env as $i => $j) {
3287
			if (is_string($j) and !in_array($i, $ignore_params)) {
3288
				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3289
			}
3290
		}
3291
	}
3292
3293
	return $texte;
3294
}
3295
3296
3297
/**