]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed issue when reordering plugins to second last position of other
authorJeroen Dalsem <jdalsem@coldtrick.com>
Wed, 23 Oct 2013 13:11:11 +0000 (15:11 +0200)
committerJeroen Dalsem <jdalsem@coldtrick.com>
Wed, 23 Oct 2013 13:11:11 +0000 (15:11 +0200)
column that has more than 2 widgets

engine/classes/ElggWidget.php

index c123e50326bf8c6e2f64a1a4f0a444f5abd315f8..66191bf472484a1e70efe63d2101b20ac5721793 100644 (file)
@@ -146,10 +146,15 @@ class ElggWidget extends ElggObject {
                        }
                }
 
+               $bottom_rank = count($widgets);
+               if ($column == $this->column) {
+                       $bottom_rank--;
+               }
+               
                if ($rank == 0) {
                        // top of the column
                        $this->order = reset($widgets)->order - 10;
-               } elseif ($rank == (count($widgets) - 1)) {
+               } elseif ($rank == $bottom_rank) {
                        // bottom of the column of active widgets
                        $this->order = end($widgets)->order + 10;
                } else {