diff options
Diffstat (limited to 'engine/classes')
-rw-r--r-- | engine/classes/ElggMenuBuilder.php | 5 | ||||
-rw-r--r-- | engine/classes/ElggMenuItem.php | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php index 9112c9535..bafed2cea 100644 --- a/engine/classes/ElggMenuBuilder.php +++ b/engine/classes/ElggMenuBuilder.php @@ -66,6 +66,7 @@ class ElggMenuBuilder { // get menu items for this context $selected_menu = array(); foreach ($this->menu as $menu_item) { + //var_dump($menu_item); if ($menu_item->inContext()) { $selected_menu[] = $menu_item; } @@ -182,7 +183,7 @@ class ElggMenuBuilder { case 'name': $sort_callback = array('ElggMenuBuilder', 'compareByName'); break; - case 'weight': + case 'priority': $sort_callback = array('ElggMenuBuilder', 'compareByWeight'); break; case 'order': @@ -249,7 +250,7 @@ class ElggMenuBuilder { } /** - * Compare two menu items by their weight + * Compare two menu items by their priority * * @param ElggMenuItem $a * @param ElggMenuItem $b diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index 1e1981ab9..0204a85c7 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -49,9 +49,9 @@ class ElggMenuItem { protected $title = ''; /** - * @var int Menu weight - smaller weights float to the top + * @var int Menu priority - smaller prioritys float to the top */ - protected $weight = 100; + protected $priority = 100; /** * @var bool Is this the currently selected menu item @@ -297,23 +297,23 @@ class ElggMenuItem { } /** - * Set the weight of the menu item + * Set the priority of the menu item * - * @param int $weight The lower weight items float to the top of the menu + * @param int $priority The smaller numbers mean higher priority (1 before 100) * * @return void */ - public function setWeight($weight) { - $this->weight = $weight; + public function setWeight($priority) { + $this->priority = $priority; } /** - * Get the weight of the menu item + * Get the priority of the menu item * * @return int */ public function getWeight() { - return $this->weight; + return $this->priority; } /** |