aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-12-16 21:04:43 -0500
committerBrett Profitt <brett.profitt@gmail.com>2012-12-16 21:04:43 -0500
commit4aae9078525de7c6e56091d6864e7397b58280cb (patch)
tree54d65ffeb0c885db2253dac09771a819bab1e9fd
parentcc0f1ddad2fac1d1761d59a818f1c41d7db6ed0d (diff)
downloadelgg-4aae9078525de7c6e56091d6864e7397b58280cb.tar.gz
elgg-4aae9078525de7c6e56091d6864e7397b58280cb.tar.bz2
Fixes #4962. Using get/setData() methods to store menu item original_order.
-rw-r--r--engine/classes/ElggMenuBuilder.php8
-rw-r--r--engine/classes/ElggMenuItem.php2
2 files changed, 5 insertions, 5 deletions
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php
index df0f9147f..d7f85685c 100644
--- a/engine/classes/ElggMenuBuilder.php
+++ b/engine/classes/ElggMenuBuilder.php
@@ -205,7 +205,7 @@ class ElggMenuBuilder {
// sort each section
foreach ($this->menu as $index => $section) {
foreach ($section as $key => $node) {
- $section[$key]->original_order = $key;
+ $section[$key]->setData('original_order', $key);
}
usort($section, $sort_callback);
$this->menu[$index] = $section;
@@ -240,7 +240,7 @@ class ElggMenuBuilder {
$result = strnatcmp($at, $bt);
if ($result === 0) {
- return $a->original_order - $b->original_order;
+ return $a->getData('original_order') - $b->getData('original_order');
}
return $result;
}
@@ -258,7 +258,7 @@ class ElggMenuBuilder {
$result = strcmp($an, $bn);
if ($result === 0) {
- return $a->original_order - $b->original_order;
+ return $a->getData('original_order') - $b->getData('original_order');
}
return $result;
}
@@ -275,7 +275,7 @@ class ElggMenuBuilder {
$bw = $b->getWeight();
if ($aw == $bw) {
- return $a->original_order - $b->original_order;
+ return $a->getData('original_order') - $b->getData('original_order');
}
return $aw - $bw;
}
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index fe25f3ddd..81ce6c099 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -543,7 +543,7 @@ class ElggMenuItem {
*/
public function sortChildren($sortFunction) {
foreach ($this->data['children'] as $key => $node) {
- $this->data['children'][$key]->original_order = $key;
+ $this->data['children'][$key]->data['original_order'] = $key;
}
usort($this->data['children'], $sortFunction);
}