From 6d4eb8b4d99cd2cd7d9bda54a7a4a78f7c7805ff Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 28 Dec 2008 19:22:07 +0000 Subject: [PATCH] code cleanup --- lam/lib/modules/fixed_ip.inc | 41 +++++++++++++++++++----------------- lam/lib/modules/range.inc | 30 ++++++++++++++------------ 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/lam/lib/modules/fixed_ip.inc b/lam/lib/modules/fixed_ip.inc index 488d6b5c..5773fca1 100644 --- a/lam/lib/modules/fixed_ip.inc +++ b/lam/lib/modules/fixed_ip.inc @@ -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' => '
')); + $return[] = array(array('kind' => 'text', 'text' => '
')); } // 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; diff --git a/lam/lib/modules/range.inc b/lam/lib/modules/range.inc index fbde7714..77b62aaf 100644 --- a/lam/lib/modules/range.inc +++ b/lam/lib/modules/range.inc @@ -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' => '
')); @@ -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;