From f069ddca3493163b00be41ac835874c4e18ed8dd Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 29 Jun 2010 17:17:36 +0000 Subject: [PATCH] use new meta HTML --- lam/lib/modules/account.inc | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/lam/lib/modules/account.inc b/lam/lib/modules/account.inc index 899570f7..8fd4ae36 100644 --- a/lam/lib/modules/account.inc +++ b/lam/lib/modules/account.inc @@ -191,25 +191,33 @@ class account extends baseModule { /** * Returns the HTML meta data for the main account page. * - * @return array HTML meta data + * @return htmlElement HTML meta data */ function display_html_attributes() { + $container = new htmlTable(); // user name if no posixAccount $modules = $_SESSION['config']->get_AccountModules($this->get_scope()); if (!in_array('posixAccount', $modules)) { - $return[] = array ( - array('kind' => 'text', 'text' => _("User name").'*'), - array('kind' => 'input', 'name' => 'uid', 'type' => 'text', 'size' => '30', 'maxlength' => '20', - 'value' => $this->attributes['uid'][0]), - array('kind' => 'help', 'value' => 'uid')); + $uid = null; + if (isset($this->attributes['uid'][0])) { + $uid = $this->attributes['uid'][0]; + } + $title = _('User name'); + if ($this->get_scope()=='host') { + $title = _('Host name'); + } + $uidElement = new htmlTableExtendedInputField($title, 'uid', $uid, 'uid'); + $uidElement->setRequired(true); + $uidElement->setFieldMaxLength(20); + $container->addElement($uidElement, true); } // description - $return[] = array( - array('kind' => 'text', 'text' => _('Description')), - array('kind' => 'input', 'name' => 'description', 'type' => 'text', 'size' => '30', - 'maxlength' => '255', 'value' => $this->attributes['description'][0]), - array('kind' => 'help', 'value' => 'description')); - return $return; + $description = ''; + if (isset($this->attributes['description'][0])) { + $description = $this->attributes['description'][0]; + } + $container->addElement(new htmlTableExtendedInputField(_('Description'), 'description', $description, 'description')); + return $container; } /**