projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Neutral formulation.
[platal.git]
/
plugins
/
function.select_nat.php
diff --git
a/plugins/function.select_nat.php
b/plugins/function.select_nat.php
index
9a73f39
..
57bd46f
100644
(file)
--- a/
plugins/function.select_nat.php
+++ b/
plugins/function.select_nat.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-201
0
Polytechnique.org *
+ * Copyright (C) 2003-201
1
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 *
@@
-21,25
+21,25
@@
function select_nat($valeur, $pad=false) {
function select_nat($valeur, $pad=false) {
- $res = XDB::iterRow("SELECT iso_3166_1_a2 AS id, nationality
FR
AS text
+ $res = XDB::iterRow("SELECT iso_3166_1_a2 AS id, nationality AS text
FROM geoloc_countries
FROM geoloc_countries
- WHERE nationality
FR
IS NOT NULL
- ORDER BY nationality
FR
");
+ WHERE nationality IS NOT NULL
+ ORDER BY nationality");
$sel = ' selected="selected"';
// on ajoute une entree vide si $pad est vrai
$html = "";
if ($pad) {
$sel = ' selected="selected"';
// on ajoute une entree vide si $pad est vrai
$html = "";
if ($pad) {
- $html .= sprintf("<option value=\"\"%s></option>\n", ($valeur ? $sel : ""));
+ $html .= sprintf("<option value=\"\"%s>
</option>\n", ($valeur ? $sel : ""));
}
while (list($my_id, $my_text) = $res->next()) {
}
while (list($my_id, $my_text) = $res->next()) {
- $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 : ""), $my_text
?$my_text:" "
);
}
return $html;
}
}
return $html;
}
-function smarty_function_select_nat($params,
&
$smarty) {
+function smarty_function_select_nat($params, $smarty) {
if (empty($params['pad']) || !($params['pad'])) {
$pad = false;
} else {
if (empty($params['pad']) || !($params['pad'])) {
$pad = false;
} else {