X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.select_nat.php;h=a9720ed720b708c5e8b4fceaa69ed362978f8ef3;hb=01bb23e6f5ae192ffaa6afbbd94b21b2b37f2138;hp=ebfa2f3b2c7c0ce0250046da8fdf3b5a927fc090;hpb=c3c43c0ebe734e2b43b5d5fdb6010d08358bc34b;p=platal.git diff --git a/plugins/function.select_nat.php b/plugins/function.select_nat.php index ebfa2f3..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); }