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