use new meta HTML classes

This commit is contained in:
Roland Gruber 2010-09-18 16:11:43 +00:00
parent a03e8da20a
commit e3d96cf92f
1 changed files with 16 additions and 27 deletions

View File

@ -74,12 +74,9 @@ class inetLocalMailRecipient extends baseModule {
"Text" => _("This is the mail server for the user.") "Text" => _("This is the mail server for the user.")
)); ));
// profile options // profile options
$return['profile_options'] = array( $profileContainer = new htmlTable();
array( $profileContainer->addElement(new htmlTableExtendedInputField(_('Mail server'), 'inetLocalMailRecipient_host', null, 'host'));
array('kind' => 'text', 'text' => _('Mail server') . ":"), $return['profile_options'] = $profileContainer;
array('kind' => 'input', 'name' => 'inetLocalMailRecipient_host', 'type' => 'text', 'size' => '30', 'maxlength' => '255'),
array('kind' => 'help', 'value' => 'host'))
);
// profile checks // profile checks
$return['profile_checks']['inetLocalMailRecipient_host'] = array( $return['profile_checks']['inetLocalMailRecipient_host'] = array(
'type' => 'ext_preg', 'type' => 'ext_preg',
@ -134,41 +131,33 @@ class inetLocalMailRecipient extends baseModule {
/** /**
* Returns the HTML meta data for the main account page. * Returns the HTML meta data for the main account page.
* *
* @return array HTML meta data * @return htmlElement HTML meta data
*/ */
function display_html_attributes() { function display_html_attributes() {
$return = array(); $return = new htmlTable();
// mail routing address // mail routing address
$routingAddress = ''; $routingAddress = '';
if (isset($this->attributes['mailRoutingAddress'][0])) $routingAddress = $this->attributes['mailRoutingAddress'][0]; if (isset($this->attributes['mailRoutingAddress'][0])) $routingAddress = $this->attributes['mailRoutingAddress'][0];
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Routing address'), 'routingAdr', $routingAddress, 'routingAdr'), true);
array('kind' => 'text', 'text' => _('Routing address')),
array('kind' => 'input', 'name' => 'routingAdr', 'type' => 'text', 'size' => '20', 'value' => $routingAddress),
array('kind' => 'help', 'value' => 'routingAdr'));
// mail server // mail server
$mailServer = ''; $mailServer = '';
if (isset($this->attributes['mailHost'][0])) $mailServer = $this->attributes['mailHost'][0]; if (isset($this->attributes['mailHost'][0])) $mailServer = $this->attributes['mailHost'][0];
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('Mail server'), 'host', $mailServer, 'host'), true);
array('kind' => 'text', 'text' => _('Mail server')),
array('kind' => 'input', 'name' => 'host', 'type' => 'text', 'size' => '20', 'value' => $mailServer),
array('kind' => 'help', 'value' => 'host'));
// list current local addresses // list current local addresses
$localAdresses = array(); $localAdresses = array();
if (isset($this->attributes['mailLocalAddress'])) $localAdresses = $this->attributes['mailLocalAddress']; if (isset($this->attributes['mailLocalAddress'])) $localAdresses = $this->attributes['mailLocalAddress'];
for ($i = 0; $i < sizeof($localAdresses); $i++) { for ($i = 0; $i < sizeof($localAdresses); $i++) {
$return[] = array( $return->addElement(new htmlOutputText(_('Local address')));
array('kind' => 'text', 'text' => _('Local address')), $return->addElement(new htmlInputField('localAdr' . $i, $localAdresses[$i]));
array('kind' => 'input', 'name' => 'localAdr' . $i, 'type' => 'text', 'size' => '20', 'value' => $localAdresses[$i]), $return->addElement(new htmlButton('delAdr' . $i, 'del.png', true));
array('kind' => 'input', 'type' => 'submit', 'name' => 'delAdr' . $i, 'title' => _("Remove"), 'value' => ' ', 'image' => 'del.png'), $return->addElement(new htmlHelpLink('localAdr'), true);
array('kind' => 'help', 'value' => 'localAdr'));
} }
// input box for new local addresses // input box for new local addresses
$return[] = array( $return->addElement(new htmlOutputText(_('New local address')));
array('kind' => 'text', 'text' => _('New local address')), $return->addElement(new htmlInputField('localAdr', ''));
array('kind' => 'input', 'name' => 'localAdr', 'type' => 'text', 'size' => '20', 'value' => ''), $return->addElement(new htmlButton('addAdr', 'add.png', true));
array('kind' => 'input', 'type' => 'submit', 'name' => 'addAdr', 'title' => _("Add"), 'value' => ' ', 'image' => 'add.png'), $return->addElement(new htmlHelpLink('localAdr'));
array('kind' => 'help', 'value' => 'localAdr'), $return->addElement(new htmlHiddenInput('adr_number', sizeof($localAdresses)));
array('kind' => 'input', 'type' => 'hidden', 'value' => sizeof($localAdresses), 'name' => 'adr_number'));
return $return; return $return;
} }