Code Duplication    Length = 19-19 lines in 2 locations

ecrire/inc/filtres.php 2 locations

@@ 3142-3160 (lines=19) @@
3139
 * @return string
3140
 *      Code HTML résultant
3141
 **/
3142
function env_to_params($env, $ignore_params = array()) {
3143
	$ignore_params = array_merge(
3144
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3145
		$ignore_params
3146
	);
3147
	if (!is_array($env)) {
3148
		$env = unserialize($env);
3149
	}
3150
	$texte = "";
3151
	if ($env) {
3152
		foreach ($env as $i => $j) {
3153
			if (is_string($j) and !in_array($i, $ignore_params)) {
3154
				$texte .= "<param name='" . attribut_html($i) . "'\n\tvalue='" . attribut_html($j) . "' />";
3155
			}
3156
		}
3157
	}
3158
3159
	return $texte;
3160
}
3161
3162
/**
3163
 * Écrit des attributs HTML à partir d'un tableau de données tel que `#ENV`
@@ 3181-3199 (lines=19) @@
3178
 * @return string
3179
 *      Code HTML résultant
3180
 **/
3181
function env_to_attributs($env, $ignore_params = array()) {
3182
	$ignore_params = array_merge(
3183
		array('id', 'lang', 'id_document', 'date', 'date_redac', 'align', 'fond', '', 'recurs', 'emb', 'dir_racine'),
3184
		$ignore_params
3185
	);
3186
	if (!is_array($env)) {
3187
		$env = unserialize($env);
3188
	}
3189
	$texte = "";
3190
	if ($env) {
3191
		foreach ($env as $i => $j) {
3192
			if (is_string($j) and !in_array($i, $ignore_params)) {
3193
				$texte .= attribut_html($i) . "='" . attribut_html($j) . "' ";
3194
			}
3195
		}
3196
	}
3197
3198
	return $texte;
3199
}
3200
3201
3202
/**