X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.select_nat.php;h=a9720ed720b708c5e8b4fceaa69ed362978f8ef3;hb=a48b23c3d3e357a2f6e776f452074fe0ee5d594f;hp=bc0401c8dff173498f6f25ef30d8b507bb36b9ce;hpb=ebd515f95f03f8a87f9b846d65e179b39a535222;p=platal.git diff --git a/plugins/function.select_nat.php b/plugins/function.select_nat.php index bc0401c..a9720ed 100644 --- a/plugins/function.select_nat.php +++ b/plugins/function.select_nat.php @@ -1,6 +1,6 @@ \n"; + $html .= sprintf("\n", ($valeur ? $sel : "")); } - while (list($my_id,$my_text) = $res->next()) { - $html .= sprintf("\n",$my_id,($valeur==$my_id?$sel:""),$my_text); + while (list($my_id, $my_text) = $res->next()) { + $html .= sprintf("\n", $my_id, ($valeur==$my_id ? $sel : ""), $my_text?$my_text:" "); } + return $html; } function smarty_function_select_nat($params, &$smarty) { - if(empty($params['pad']) || !($params['pad'])) - $pad = false; - else - $pad = true; + if (empty($params['pad']) || !($params['pad'])) { + $pad = false; + } else { + $pad = true; + } + return select_nat($params['valeur'], $pad); }