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