use new meta HTML classes

This commit is contained in:
Roland Gruber 2010-09-16 18:20:09 +00:00
parent 877f6db3f3
commit f6702d180b
1 changed files with 55 additions and 114 deletions

View File

@ -161,7 +161,7 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
"Text" => _("The subnet mask of the network.") "Text" => _("The subnet mask of the network.")
) , 'netmask' => array( ) , 'netmask' => array(
"Headline" => _("Net mask"), "Headline" => _("Net mask"),
"Text" => _("The net mask is derived from the subnet mask. If you leave this field empty then LAM will calculate it for you.") "Text" => _("The net mask is derived from the subnet mask. LAM will calculate it automatically.")
), 'description' => array( ), 'description' => array(
"Headline" => _("Description"), "Headline" => _("Description"),
"Text" => _("Here you can enter a description for this DHCP entry.") "Text" => _("Here you can enter a description for this DHCP entry.")
@ -181,53 +181,20 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
'description' => _('Description') 'description' => _('Description')
); );
// profile elements // profile elements
$return['profile_options'] = array( $profileContainer = new htmlTable();
// Subnet name $profileContainer->addElement(new htmlTableExtendedInputField(_('Subnet'), 'cn', null, 'subnet'), true);
array( $profileContainer->addElement(new htmlTableExtendedInputField(_('Domain name'), 'domainname', null, 'domainname'), true);
array('kind' => 'text', 'text' => _('Subnet') . ": "), $profileContainer->addElement(new htmlTableExtendedInputField(_('Lease time'), 'lease_time', null, 'leasetime'), true);
array('kind' => 'input', 'name' => 'cn', 'type'=>'text'), $profileContainer->addElement(new htmlTableExtendedInputField(_('Maximum lease time'), 'max_lease_time', null, 'max_leasetime'), true);
array('kind' => 'help', 'value' => 'subnet')), $profileContainer->addElement(new htmlTableExtendedInputField(_('DNS'), 'dns', null, 'dns'), true);
// Domainname $profileContainer->addElement(new htmlTableExtendedInputField(_('Default gateway'), 'routers', null, 'gateway'), true);
array( $profileContainer->addElement(new htmlTableExtendedInputField(_('Netbios name servers'), 'netbios', null, 'netbios'), true);
array('kind' => 'text', 'text' => _('Domain name') . ": "), $nodeList = array_flip($this->all_netbios_node_types);
array('kind' => 'input', 'name' => 'domainname', 'type'=>'text'), $profileNodeSelect = new htmlTableExtendedSelect('netbios_node_type', $nodeList, null, _('Netbios node type'), 'netbios_type');
array('kind' => 'help', 'value' => 'domainname')), $profileNodeSelect->setHasDescriptiveElements(true);
// Lease Time $profileContainer->addElement($profileNodeSelect, true);
array( $profileContainer->addElement(new htmlTableExtendedInputField(_('Subnet mask'), 'subnet', null, 'subnetmask'), true);
array('kind' => 'text', 'text' => _('Lease time') . ": "), $return['profile_options'] = $profileContainer;
array('kind' => 'input', 'name' => 'lease_time', 'type'=>'text'),
array('kind' => 'help', 'value' => 'leasetime')),
// Max lease Time
array(
array('kind' => 'text', 'text' => _('Maximum lease time') . ": "),
array('kind' => 'input', 'name' => 'max_lease_time', 'type'=>'text'),
array('kind' => 'help', 'value' => 'max_leasetime')),
// DNS
array(
array('kind' => 'text', 'text' => _('DNS') . ": "),
array('kind' => 'input', 'name' => 'dns', 'type'=>'text'),
array('kind' => 'help', 'value' => 'dns')),
// Gateway
array(
array('kind' => 'text', 'text' => _('Default gateway') . ": "),
array('kind' => 'input', 'name' => 'routers', 'type'=>'text'),
array('kind' => 'help', 'value' => 'gateway')),
// Netbios Name Servers
array(
array('kind' => 'text', 'text' => _('Netbios name servers') . ": "),
array('kind' => 'input', 'name' => 'netbios', 'type'=>'text'),
array('kind' => 'help', 'value' => 'netbios')),
// Netbios Node Type
array(
array('kind' => 'text', 'text' => _('Netbios node type') . ": "),
array('kind' => 'select', 'name' => 'netbios_node_type', 'options' => $this->all_netbios_node_types),
array('kind' => 'help', 'value' => 'netbios_type')),
// subnetmask
array(
array('kind' => 'text', 'text' => _('Subnet mask') . ": "),
array('kind' => 'input', 'name' => 'subnet', 'type'=>'text'),
array('kind' => 'help', 'value' => 'subnetmask'))
);
// upload fields // upload fields
$return['upload_columns'] = array( $return['upload_columns'] = array(
array( array(
@ -533,90 +500,64 @@ By default, the nodes are configured as H-Nodes which fits for small networks. I
// check if DHCP main settings and valid DHCP entry // check if DHCP main settings and valid DHCP entry
if ($_SESSION['config']->get_suffix('dhcp') == $this->getAccountContainer()->dn_orig) { if ($_SESSION['config']->get_suffix('dhcp') == $this->getAccountContainer()->dn_orig) {
if (!in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) { if (!in_array_ignore_case('dhcpServer', $this->attributes['objectClass'])) {
StatusMessage("ERROR", _('Please set your LDAP suffix to an LDAP entry with object class "dhcpServer".')); $return->addElement(new htmlStatusMessage('ERROR', _('Please set your LDAP suffix to an LDAP entry with object class "dhcpServer".')));
return array(); return $return;
} }
} }
$return = new htmlTable();
// Subnet name // Subnet name
if ($_SESSION['config']->get_suffix('dhcp') != $this->getAccountContainer()->dn_orig) { if ($_SESSION['config']->get_suffix('dhcp') != $this->getAccountContainer()->dn_orig) {
$return[] = array( $cn = '';
array('kind' => 'text', 'text' => _('Subnet') . ":* "), if (isset($this->attributes['cn'][0])) {
array('kind' => 'input', 'name' => 'cn', 'value' => $this->attributes['cn'][0]), $cn = $this->attributes['cn'][0];
array('kind' => 'help', 'value' => 'subnet'), }
array('kind' => 'text', 'text' => "&nbsp;&nbsp;&nbsp;" . _('Example') . ": 192.168.10.<b>0</b>") ); $subnetInput = new htmlTableExtendedInputField(_('Subnet'), 'cn', $cn, 'subnet');
$subnetInput->setRequired(true);
$return->addElement($subnetInput);
$return->addElement(new htmlOutputText(_('Example') . ": 192.168.10.0"), true);
} }
// domain name
// Domainname $return->addElement(new htmlTableExtendedInputField(_('Domain name'), 'domainname', $this->getDHCPOption('domain-name'), 'domainname'), true);
$return[] = array( // lease Time
array('kind' => 'text', 'text' => _('Domain name') . ": "), $return->addElement(new htmlTableExtendedInputField(_('Lease time'), 'lease_time', $this->getDefaultLeaseTime(), 'leasetime'), true);
array('kind' => 'input', 'name' => 'domainname', 'value' => $this->getDHCPOption('domain-name')), // max lease time
array('kind' => 'help', 'value' => 'domainname')); $return->addElement(new htmlTableExtendedInputField(_('Maximum lease time'), 'max_lease_time', $this->getMaxLeaseTime(), 'max_leasetime'), true);
// Lease Time
$return[] = array(
array('kind' => 'text', 'text' => _('Lease time') . ": "),
array('kind' => 'input', 'name' => 'lease_time', 'value' => $this->getDefaultLeaseTime()),
array('kind' => 'help', 'value' => 'leasetime'));
// Max lease Time
$return[] = array(
array('kind' => 'text', 'text' => _('Maximum lease time') . ": "),
array('kind' => 'input', 'name' => 'max_lease_time', 'value' => $this->getMaxLeaseTime()),
array('kind' => 'help', 'value' => 'max_leasetime'));
// DNS // DNS
$return[] = array( $return->addElement(new htmlTableExtendedInputField(_('DNS'), 'dns', $this->getDHCPOption('domain-name-servers'), 'dns'), true);
array('kind' => 'text', 'text' => _('DNS') . ": "), // gateway
array('kind' => 'input', 'name' => 'dns', 'value' => $this->getDHCPOption('domain-name-servers')), $return->addElement(new htmlTableExtendedInputField(_('Default gateway'), 'routers', $this->getDHCPOption('routers'), 'gateway'), true);
array('kind' => 'help', 'value' => 'dns')); // netbios name servers
$return->addElement(new htmlTableExtendedInputField(_('Netbios name servers'), 'netbios', $this->getDHCPOption('netbios-name-servers'), 'netbios'), true);
// Gateway // netbios node type
$return[] = array(
array('kind' => 'text', 'text' => _('Default gateway') . ": "),
array('kind' => 'input', 'name' => 'routers', 'value' => $this->getDHCPOption('routers')),
array('kind' => 'help', 'value' => 'gateway'));
// Netbios Name Servers
$return[] = array(
array('kind' => 'text', 'text' => _('Netbios name servers') . ": "),
array('kind' => 'input', 'name' => 'netbios', 'value' => $this->getDHCPOption('netbios-name-servers')),
array('kind' => 'help', 'value' => 'netbios'));
// Netbios Node Type
$nodeType = $this->getDHCPOption('netbios-node-type'); $nodeType = $this->getDHCPOption('netbios-node-type');
if ($nodeType == '') { if ($nodeType == '') {
$nodeType = 8; $nodeType = 8;
} }
$nodeOptions = array(); $nodeOptions = array();
foreach ($this->all_netbios_node_types as $key => $value) { foreach ($this->all_netbios_node_types as $key => $value) {
$nodeOptions[] = array($key, $value); $nodeOptions[$value] = $key;
} }
$return[] = array( $nodeSelect = new htmlTableExtendedSelect('netbios_node_type', $nodeOptions, array($nodeType), _('Netbios node type'), 'netbios_type');
array('kind' => 'text', 'text' => _('Netbios node type') . ": "), $nodeSelect->setHasDescriptiveElements(true);
array('kind' => 'select', 'name' => 'netbios_node_type', 'descriptiveOptions' => true, 'options' => $nodeOptions, 'options_selected' => array($nodeType)), $return->addElement($nodeSelect, true);
array('kind' => 'help', 'value' => 'netbios_type'));
if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) { if ($this->getAccountContainer()->dn_orig!=$_SESSION['config']->get_suffix('dhcp')) {
// subnetmask // subnetmask
$return[] = array( $subnetMaskInput = new htmlTableExtendedInputField(_('Subnet mask'), 'subnet', $this->getDHCPOption('subnet-mask'), 'subnetmask');
array('kind' => 'text', 'text' => _('Subnet mask') . ":* "), $subnetMaskInput->setRequired(true);
array('kind' => 'input', 'name' => 'subnet', 'value' => $this->getDHCPOption('subnet-mask')), $return->addElement($subnetMaskInput, true);
array('kind' => 'help', 'value' => 'subnetmask')); // netmask
$return->addElement(new htmlOutputText(_('Net mask')));
// Netmask $return->addElement(new htmlOutputText($this->attributes['dhcpNetMask'][0]));
$return[] = array( $return->addElement(new htmlHelpLink('netmask'), true);
array('kind' => 'text', 'text' => _('Net mask') . ":* "),
array('kind' => 'text', 'text' => $this->attributes['dhcpNetMask'][0]),
array('kind' => 'help', 'value' => 'netmask'));
} }
// description // description
$return[] = array( $description = '';
array('kind' => 'text', 'text' => _('Description') . ": "), if (isset($this->attributes['dhcpComments'][0])) {
array('kind' => 'input', 'name' => 'description', 'value' => $this->attributes['dhcpComments'][0]), $description = $this->attributes['dhcpComments'][0];
array('kind' => 'help', 'value' => 'description')); }
$return->addElement(new htmlTableExtendedInputField(_('Description'), 'description', $description, 'description'), true);
return $return; return $return;
} }