code cleanup

This commit is contained in:
Roland Gruber 2008-12-28 19:22:07 +00:00
parent 125b763f8a
commit 6d4eb8b4d9
2 changed files with 38 additions and 33 deletions

View File

@ -370,10 +370,11 @@ class fixed_ip extends baseModule {
$error="«« " . _("The PC name may only contain A-Z, a-z and 0-9."); $error="«« " . _("The PC name may only contain A-Z, a-z and 0-9.");
} }
$pcs[] = $this->fixed_ip[$id]['cn']; $pcs[] = $this->fixed_ip[$id]['cn'];
$return[] = array(0 => array('kind' => 'text', 'text' => _('PC name') . ":* "), $return[] = array(
1 => array('kind' => 'input', 'name' => 'pc_'.$id.'', 'value' => $this->fixed_ip[$id]['cn']), array('kind' => 'text', 'text' => _('PC name') . ":* "),
2 => array('kind' => 'help', 'value' => 'pc', 'scope' => 'user'), array('kind' => 'input', 'name' => 'pc_'.$id.'', 'value' => $this->fixed_ip[$id]['cn']),
3 => array('kind' => 'text', 'text'=>$error)); array('kind' => 'help', 'value' => 'pc', 'scope' => 'user'),
array('kind' => 'text', 'text'=>$error));
// MAC address // MAC address
$error = ""; $error = "";
@ -383,10 +384,11 @@ class fixed_ip extends baseModule {
elseif ($this->check_mac($this->fixed_ip[$id]['mac'])) { elseif ($this->check_mac($this->fixed_ip[$id]['mac'])) {
$error = "«« " . _("Invalid MAC address."); $error = "«« " . _("Invalid MAC address.");
} }
$return[] = array(0 => array('kind' => 'text', 'text' => _('MAC address') . ":* "), $return[] = array(
1 => array('kind' => 'input', 'name' => 'mac_'.$id.'', 'value' => $this->fixed_ip[$id]['mac']), array('kind' => 'text', 'text' => _('MAC address') . ":* "),
2 => array('kind' => 'help', 'value' => 'mac', 'scope' => 'user'), array('kind' => 'input', 'name' => 'mac_'.$id.'', 'value' => $this->fixed_ip[$id]['mac']),
3 => array('kind' => 'text', 'text'=>$error)); array('kind' => 'help', 'value' => 'mac', 'scope' => 'user'),
array('kind' => 'text', 'text'=>$error));
// fixed ip // fixed ip
$error = ""; $error = "";
@ -399,25 +401,26 @@ class fixed_ip extends baseModule {
elseif (!$this->overlapd_ip($this->fixed_ip[$id]['ip'])) { elseif (!$this->overlapd_ip($this->fixed_ip[$id]['ip'])) {
$error = "«« " . _("The IP address is already in use."); $error = "«« " . _("The IP address is already in use.");
} }
$return[] = array(0 => array('kind' => 'text', 'text' => _('IP address') . ":* "), $return[] = array(
1 => array('kind' => 'input', 'name' => 'ip_'.$id.'', 'value' => $this->fixed_ip[$id]['ip']), array('kind' => 'text', 'text' => _('IP address') . ":* "),
2 => array('kind' => 'help', 'value' => 'ip', 'scope' => 'user'), array('kind' => 'input', 'name' => 'ip_'.$id.'', 'value' => $this->fixed_ip[$id]['ip']),
3 => array('kind' => 'text', 'text'=>$error)); array('kind' => 'help', 'value' => 'ip', 'scope' => 'user'),
array('kind' => 'text', 'text'=>$error));
// fixed_ip drop: // fixed_ip drop:
$return[] = array( $return[] = array(
0 => array('kind' => 'text', 'text' => _('Delete IP') . ':'), array('kind' => 'text', 'text' => _('Delete IP') . ':'),
1 => array('kind' => 'input', 'name' => 'drop_ip_'.$id, 'type' => 'submit', 'value' => _('Delete IP')), array('kind' => 'input', 'name' => 'drop_ip_'.$id, 'type' => 'submit', 'value' => _('Delete IP')),
2 => array('kind' => 'help', 'value' => 'drop_ip')); array('kind' => 'help', 'value' => 'drop_ip'));
// Space Line // Space Line
$return[] = array(0 => array('kind' => 'text', 'text' => '<br />')); $return[] = array(array('kind' => 'text', 'text' => '<br />'));
} }
// add fixed ip: // add fixed ip:
$return[] = array( $return[] = array(
0 => array('kind' => 'text', 'text' => _('Add IP') . ':'), array('kind' => 'text', 'text' => _('Add IP') . ':'),
1 => array('kind' => 'input', 'name' => 'add_ip', 'type' => 'submit', 'value' => _('Add IP')), array('kind' => 'input', 'name' => 'add_ip', 'type' => 'submit', 'value' => _('Add IP')),
2 => array('kind' => 'help', 'value' => 'add_ip')); array('kind' => 'help', 'value' => 'add_ip'));
} }
return $return; return $return;

View File

@ -418,10 +418,11 @@ class range extends baseModule {
} else { } else {
$error = ""; $error = "";
} }
$return[] = array(0 => array('kind' => 'text', 'text' => _('Range from') . ":* "), $return[] = array(
1 => array('kind' => 'input', 'name' => 'range_start_'.$id.'', 'value' => $this->ranges[$id]['range_start']), array('kind' => 'text', 'text' => _('Range from') . ":* "),
2 => array('kind' => 'help', 'value' => 'range_from', 'scope' => 'user'), array('kind' => 'input', 'name' => 'range_start_'.$id.'', 'value' => $this->ranges[$id]['range_start']),
3 => array('kind' => 'text', 'text'=>$error)); array('kind' => 'help', 'value' => 'range_from', 'scope' => 'user'),
array('kind' => 'text', 'text'=>$error));
// Range end // Range end
if ($this->processed && !check_ip($this->ranges[$id]['range_end'])) { if ($this->processed && !check_ip($this->ranges[$id]['range_end'])) {
@ -431,16 +432,17 @@ class range extends baseModule {
} else { } else {
$error = ""; $error = "";
} }
$return[] = array(0 => array('kind' => 'text', 'text' => _('Range to') . ":* "), $return[] = array(
1 => array('kind' => 'input', 'name' => 'range_end_'.$id.'', 'value' => $this->ranges[$id]['range_end']), array('kind' => 'text', 'text' => _('Range to') . ":* "),
2 => array('kind' => 'help', 'value' => 'range_to', 'scope' => 'user'), array('kind' => 'input', 'name' => 'range_end_'.$id.'', 'value' => $this->ranges[$id]['range_end']),
3 => array('kind' => 'text', 'text'=>$error)); array('kind' => 'help', 'value' => 'range_to', 'scope' => 'user'),
array('kind' => 'text', 'text'=>$error));
// Drop range: // Drop range:
$return[] = array( $return[] = array(
0 => array('kind' => 'text', 'text' => _('Delete range') . ':'), array('kind' => 'text', 'text' => _('Delete range') . ':'),
1 => array('kind' => 'input', 'name' => 'drop_range_'.$id, 'type' => 'submit', 'value' => _('Delete range')), array('kind' => 'input', 'name' => 'drop_range_'.$id, 'type' => 'submit', 'value' => _('Delete range')),
2 => array('kind' => 'help', 'value' => 'drop_range')); array('kind' => 'help', 'value' => 'drop_range'));
// Space Line // Space Line
$return[] = array(0 => array('kind' => 'text', 'text' => '<br />')); $return[] = array(0 => array('kind' => 'text', 'text' => '<br />'));
@ -448,9 +450,9 @@ class range extends baseModule {
// Range hinzufügen: // Range hinzufügen:
$return[] = array( $return[] = array(
0 => array('kind' => 'text', 'text' => _('New range') . ':'), array('kind' => 'text', 'text' => _('New range') . ':'),
1 => array('kind' => 'input', 'name' => 'add_range', 'type' => 'submit', 'value' => _('New range')), array('kind' => 'input', 'name' => 'add_range', 'type' => 'submit', 'value' => _('New range')),
2 => array('kind' => 'help', 'value' => 'add_range')); array('kind' => 'help', 'value' => 'add_range'));
} }
return $return; return $return;