X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=plugins%2Ffunction.select_db_table.php;fp=plugins%2Ffunction.select_db_table.php;h=1c7f0722b18da155c3f78efc9db6a97b2a592c67;hb=a3a049fc80d3707bcc76903ab89f73974c470c0c;hp=4276fa850ad046749987c2cb45b2c6262e9ebd5d;hpb=08cce2ff528b38bde27cdec6d6bc28d6af4a42d4;p=platal.git diff --git a/plugins/function.select_db_table.php b/plugins/function.select_db_table.php index 4276fa8..1c7f072 100644 --- a/plugins/function.select_db_table.php +++ b/plugins/function.select_db_table.php @@ -21,7 +21,6 @@ function select_options($table,$valeur,$champ="text",$pad=false,$where="") { - global $globals; $sql = "SELECT id,$champ FROM $table $where ORDER BY $champ"; $res = XDB::iterRow($sql); $sel = ' selected="selected"'; @@ -32,7 +31,8 @@ function select_options($table,$valeur,$champ="text",$pad=false,$where="") { $html.= '\n"; } while (list($my_id,$my_text) = $res->next()) { - $html .= sprintf("\n",$my_id,($valeur==$my_id?$sel:""),$my_text); + $html .= sprintf("\n", + $my_id, ($valeur==$my_id?$sel:""), $my_text); } return $html; } @@ -48,7 +48,8 @@ function smarty_function_select_db_table($params, &$smarty) { $pad = true; if(empty($params['where'])) $params['where'] = ''; - return select_options($params['table'], $params['valeur'], $params['champ'], $pad, $params['where']); + return select_options($params['table'], $params['valeur'], + $params['champ'], $pad, $params['where']); } ?>