From: psc Date: Fri, 10 Jul 2009 09:52:48 +0000 (+0000) Subject: Some improvements to the ArrayUp/ArrayDown handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a9495474aa554c464fb37779fae20984a6063b21;p=gosa.git Some improvements to the ArrayUp/ArrayDown handling - In functions Array(Up|Down) don't do anything if number of elements is 1 - Don't display down element if there is only one entry in the list. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13920 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc index 7ffb7b9b5..0e46f71d5 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc @@ -127,6 +127,11 @@ class faiProfile extends plugin $index = $this->getpos($atr,$attrs); $res = $attrs; + /* Don't do anything if there is just one element */ + if (count($attrs) == 1) { + return($res); + } + for($i=0;$igetpos($atr,$attrs); $res = $attrs; + /* Don't do anything if there is just one element */ + if (count($attrs) == 1) { + return($res); + } + for($i=0;$iacl_is_readable("FAIclass")){ $i = 1; + $count = count($this->FAIclasses); + + $linkupdown = ''; foreach($this->FAIclasses as $usedClass){ if($i==1) { - $linkupdown = "    " . $linkdown; - } elseif ($iFAIclasses)) { + if ($count > 1) { + $linkupdown = "    " . $linkdown; + } + } elseif ($i<$count) { $linkupdown = $linkup . $linkdown; } else {