projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2010.
[platal.git]
/
plugins
/
function.select_db_table.php
diff --git
a/plugins/function.select_db_table.php
b/plugins/function.select_db_table.php
index
4bb641c
..
94379a9
100644
(file)
--- a/
plugins/function.select_db_table.php
+++ b/
plugins/function.select_db_table.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
06
Polytechnique.org *
+ * Copyright (C) 2003-20
10
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-19,7
+19,6
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-
function select_options($table,$valeur,$champ="text",$pad=false,
$where="",$join="",$group="")
{
function select_options($table,$valeur,$champ="text",$pad=false,
$where="",$join="",$group="")
{
@@
-27,11
+26,10
@@
function select_options($table,$valeur,$champ="text",$pad=false,
$order = $champ;
if ($group) {
$fields .= ',' . $group;
$order = $champ;
if ($group) {
$fields .= ',' . $group;
- $order = $group . ',' . $order;
- }
+ $order = $group . ',' . $order;
+ }
$sql = "SELECT $fields FROM $table AS t $join $where ORDER BY $order";
$res = XDB::iterRow($sql);
$sql = "SELECT $fields FROM $table AS t $join $where ORDER BY $order";
$res = XDB::iterRow($sql);
- echo $sql;
$sel = ' selected="selected"';
// on ajoute une entree vide si $pad est vrai
$sel = ' selected="selected"';
// on ajoute une entree vide si $pad est vrai
@@
-45,11
+43,11
@@
function select_options($table,$valeur,$champ="text",$pad=false,
if (!is_null($optgrp)) {
$html .= '</optgroup>';
}
if (!is_null($optgrp)) {
$html .= '</optgroup>';
}
- $html .= '<optgroup label="' .
addslashes(htmlentities($my_grp)
) . '">';
+ $html .= '<optgroup label="' .
pl_entities($my_grp, ENT_QUOTES
) . '">';
$optgrp = $my_grp;
}
$optgrp = $my_grp;
}
- $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
- $my_id,
($valeur==$my_id?$sel:""), $my_text
);
+ $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
+ $my_id,
$valeur==$my_id ? $sel : "", pl_entities($my_text)
);
}
if (!is_null($optgrp)) {
$html .= '</optgroup>';
}
if (!is_null($optgrp)) {
$html .= '</optgroup>';
@@
-72,4
+70,5
@@
function smarty_function_select_db_table($params, &$smarty) {
$params['where'], $params['join'], $params['group']);
}
$params['where'], $params['join'], $params['group']);
}
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
?>