From d2bbcc1206b0e377ee61af6d5b298a9064f89173 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 27 Jul 2010 09:17:25 +0000 Subject: [PATCH] Updated several service dialogs, fixed typos, string, html, post handling and more. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19148 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../services/dhcp/class_dhcpOption.inc | 148 +++++++++--------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpOption.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpOption.inc index 8db57ff54..d9b3821dd 100644 --- a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpOption.inc +++ b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_dhcpOption.inc @@ -1,95 +1,95 @@ options); - } - - function get($name){ - if(isset($this->options[$name])){ - if(count($this->options[$name]) == 0){ - return(""); - }elseif(count($this->options[$name]) == 1){ - return($this->options[$name][0]); - }else{ - return($this->options[$name]); - } - } - } - - function removeAll($name){ - if(isset($this->options[$name])){ - unset($this->options[$name]); + function getAll(){ + return($this->options); } - } - function remove($name,$entry = 0){ - if(!isset($this->options[$name])){ - return; - } - if(isset($this->options[$name][$entry])){ - unset($this->options[$name][$entry]); + function get($name){ + if(isset($this->options[$name])){ + if(count($this->options[$name]) == 0){ + return(""); + }elseif(count($this->options[$name]) == 1){ + return($this->options[$name][0]); + }else{ + return($this->options[$name]); + } + } } - if(count($this->options[$name]) == 0){ - unset($this->options[$name]); - }else{ - $this->options[$name] = array_unique($this->options[$name]); - $this->options[$name] = array_values($this->options[$name]); - } - } - function set($name,$value = null){ - if($value == null){ - $value = trim(preg_replace("/^[^ ]*/",'',$name)); - $name = trim(preg_replace("/ .*$/",'',$name)); + function removeAll($name){ + if(isset($this->options[$name])){ + unset($this->options[$name]); + } } - if(!isset($this->options[$name])){ - $this->options[$name] = array(); + function remove($name,$entry = 0){ + if(!isset($this->options[$name])){ + return; + } + if(isset($this->options[$name][$entry])){ + unset($this->options[$name][$entry]); + } + if(count($this->options[$name]) == 0){ + unset($this->options[$name]); + }else{ + $this->options[$name] = array_unique($this->options[$name]); + $this->options[$name] = array_values($this->options[$name]); + } } - - $this->options[$name] = array($value); - } - function add($name,$value = null){ - if($value == null){ - $value = trim(preg_replace("/^[^ ]*/",'',$name)); - $name = trim(preg_replace("/ .*$/",'',$name)); + function set($name,$value = null){ + if($value == null){ + $value = trim(preg_replace("/^[^ ]*/",'',$name)); + $name = trim(preg_replace("/ .*$/",'',$name)); + } + + if(!isset($this->options[$name])){ + $this->options[$name] = array(); + } + + $this->options[$name] = array($value); } - if(!isset($this->options[$name])){ - $this->options[$name] = array(); + function add($name,$value = null){ + if($value == null){ + $value = trim(preg_replace("/^[^ ]*/",'',$name)); + $name = trim(preg_replace("/ .*$/",'',$name)); + } + + if(!isset($this->options[$name])){ + $this->options[$name] = array(); + } + + $this->options[$name][] = $value; + $this->options[$name] = array_unique($this->options[$name]); + $this->options[$name] = array_values($this->options[$name]); } - - $this->options[$name][] = $value; - $this->options[$name] = array_unique($this->options[$name]); - $this->options[$name] = array_values($this->options[$name]); - } - - function save(){ - $res = array(); - foreach($this->options as $key => $values){ - foreach($values as $value){ - $res[] = $key." ".$value; - } + + function save(){ + $res = array(); + foreach($this->options as $key => $values){ + foreach($values as $value){ + $res[] = $key." ".$value; + } + } + $res=array_unique($res); + return($res); } - $res=array_unique($res); - return($res); - } - - function exists($name){ - if(isset($this->options[$name]) && count($this->options[$name]) == 0){ - return(false); + + function exists($name){ + if(isset($this->options[$name]) && count($this->options[$name]) == 0){ + return(false); + } + return(isset($this->options[$name])); } - return(isset($this->options[$name])); - } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2