diff options
author | Jeroen Dalsem <jdalsem@coldtrick.com> | 2013-10-23 15:11:11 +0200 |
---|---|---|
committer | Jeroen Dalsem <jdalsem@coldtrick.com> | 2013-10-23 15:11:11 +0200 |
commit | 577201be6cff3dbe2a0ee6e35c9ab33a74a55f77 (patch) | |
tree | 3ae0afebb9f5dabcc5c65b14571bc0e1d20022a5 /engine | |
parent | f8d481a563c779890815e54fef5fae43fba2612d (diff) | |
download | elgg-577201be6cff3dbe2a0ee6e35c9ab33a74a55f77.tar.gz elgg-577201be6cff3dbe2a0ee6e35c9ab33a74a55f77.tar.bz2 |
fixed issue when reordering plugins to second last position of other
column that has more than 2 widgets
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggWidget.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/engine/classes/ElggWidget.php b/engine/classes/ElggWidget.php index c123e5032..66191bf47 100644 --- a/engine/classes/ElggWidget.php +++ b/engine/classes/ElggWidget.php @@ -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 { |