\n"; } $optgrp = null; while (list($my_id, $my_text, $my_grp) = $res->next()) { if ($my_grp != $optgrp) { if (!is_null($optgrp)) { $html .= ''; } $html .= ''; $optgrp = $my_grp; } $html .= sprintf("\n", $my_id, $value == $my_id ? $sel : '', pl_entities($my_text)); } if (!is_null($optgrp)) { $html .= ''; } return $html; } function smarty_function_select_db_table($params, $smarty) { if (empty($params['table']) || !array_key_exists('valeur', $params)) { return; } if (empty($params['champ'])) { $params['champ'] = 'text'; } foreach (array('where', 'join', 'group') as $value) { if (empty($params[$value])) { $params[$value] = ''; } } $pad = (!empty($params['pad']) && $params['pad']); return select_options($params['table'], $params['valeur'], $params['champ'], $pad, $params['where'], $params['join'], $params['group']); } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>