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

View File

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