From 50ffd3f52a765994d168075899b50b417875363e Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 6 May 2005 16:40:54 +0000 Subject: [PATCH] =?utf8?q?Se=20agrega=20m=C3=A9todo=20toHtmlOption()=20al?= =?utf8?q?=20Usuario=20para=20mostrarlo=20m=C3=A1s=20f=C3=A1cil=20y=20cons?= =?utf8?q?istente=20dentro=20de=20los=20SELECT.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/lib/Usuario.php | 14 +++++++++++++- src/lib/admin.forms.php | 7 +------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/lib/Usuario.php b/src/lib/Usuario.php index bf18d9e..864f2c3 100644 --- a/src/lib/Usuario.php +++ b/src/lib/Usuario.php @@ -101,13 +101,25 @@ class Usuario } /// Muestra el usuario como HTML (foto + apellido) - function toHTML() + function toHtml() { return sprintf('Foto de %s %s %s', $this->getFotoFilename(), $this->getNombre(), $this->getApellido(), $this->getApellido()); } + /// Muestra el usuario como una opción de un select HTML. + function toHtmlOption($selected = null) + { + $cred = $this->esAsesor() ? '' : ' ('.$this->getCreditos().')'; + $admin = $this->esAdmin() ? '* ' : ''; + if (!is_null($selected)) + $selected = ($this->getId() == $user) ? ' selected="selected"' : ''; + return sprintf("\n", + $this->getId(), $selected, $admin, $this->getNombre(), + $this->getApellido(), $cred); + } + /// Entrada al sistema. function login() { diff --git a/src/lib/admin.forms.php b/src/lib/admin.forms.php index 5d38995..7c02881 100644 --- a/src/lib/admin.forms.php +++ b/src/lib/admin.forms.php @@ -133,12 +133,7 @@ function admin_form_creditos($users, $user = '', $creditos = 1, $action = 'admin créditos a
Contraseña: (esta operación requiere contraseña)

-- 2.43.0