18 public static function show($values, $method=
'toString', $implode=
"<br/>") {
19 if (is_array($values)) {
20 foreach ( $values as $v ) {
34 public static function get($values, $method=
'toString', $implode=
"<br/>") {
36 if (is_array($values)) {
37 foreach ( $values as $v ) {
50 public static function showOne($value, $method=
'toString') {
59 public static function getOne($value, $method=
'toString') {
60 if (method_exists(
"GUI", $method)) {
61 $value=GUI::$method($value);
63 if (method_exists($value, $method)) {
64 $value=$value->$method();
78 return "<tr><td class='element'><input title='Sélectionner' type='checkbox' class='ck' id='ck" . $value->getId() .
"' value='" . $value->getId() .
"'><span title='Modifier...' class='update' id='update" . $value->getId() .
"'> " . $value->toString() .
"<span></td><td><span title='Supprimer...' class='delete' id='delete" . $value->getId() .
"'> </span></td></tr>";
87 return "<option class='element' id='element" . $value->getId() .
"' value='" . $value->getId() .
"'>" . $value->toString() .
"</option>";
95 public static function select($values, $value, $first=null) {
98 $result.=
"<option class='element'>" . $first .
"</option>";
100 foreach ( $values as $v ) {
103 if (is_object($v) ===
true) {
106 if ($id === $value) {
107 $selected=
"selected";
109 $result.=
"<option " . $selected .
" class='element' id='element" . $id .
"' value='" . $id .
"'>" . $v .
"</option>";
120 public static function pluriel($singulier, $pluriel, $nb) {
122 $result=
"Aucun " . $singulier;
124 $result=sprintf(ngettext(
"%d " . $singulier,
"%d " . $pluriel, $nb), $nb);
static getOne($value, $method='toString')
Retourne un objet $value en lui ayant au préalable appliqué la méthode $method.
static show($values, $method='toString', $implode="<br/>")
Affiche un objet ou un tableau d'objets en appliquant au préalable la méthode $method à chacun d'entr...
Classe technique destinée à la conception des interfaces.
static showOne($value, $method='toString')
Affiche un objet $value en lui ayant au préalable appliqué la méthode $method.
static select($values, $value, $first=null)
Retourne un objet ou un tableau d'objets sous forme de liste HTML (select)
static pluriel($singulier, $pluriel, $nb)
Retourne l'expression $singulier au pluriel en fonction du nombre $nb.