summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c10f193)
raw | patch | inline | side by side (parent: c10f193)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Jul 2009 09:52:48 +0000 (09:52 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 10 Jul 2009 09:52:48 +0000 (09:52 +0000) |
- 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
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
trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc | patch | blob | history |
diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiProfile.inc
index 7ffb7b9b528c597dd87d81ef65788164bf924a77..0e46f71d5fd1e91b2981f922d98ada0cce0a931f 100644 (file)
$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;$i<count($attrs);$i++) {
if ($i==$index) {
$left_index = $index - 1;
$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;$i<count($attrs);$i++) {
if ($i==$index) {
$left_index = ($index+1);
/* Append fai classes to divlist */
if($this->acl_is_readable("FAIclass")){
$i = 1;
+ $count = count($this->FAIclasses);
+
+ $linkupdown = '';
foreach($this->FAIclasses as $usedClass){
if($i==1) {
- $linkupdown = " " . $linkdown;
- } elseif ($i<count($this->FAIclasses)) {
+ if ($count > 1) {
+ $linkupdown = " " . $linkdown;
+ }
+ } elseif ($i<$count) {
$linkupdown = $linkup . $linkdown;
}
else {