From caf76cbe72ca6749962a1feddfd70bdd29483c36 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 13 Feb 2011 18:48:40 +0000 Subject: admin menu uses weights for ordering git-svn-id: http://code.elgg.org/elgg/trunk@8201 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggMenuItem.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'engine/classes/ElggMenuItem.php') diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index a190a89ef..108cb56f2 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -38,6 +38,11 @@ class ElggMenuItem { */ protected $tooltip = ''; + /** + * @var int Menu weight - smaller weights float to the top + */ + protected $weight = 100; + /** * @var bool Is this the currently selected menu item */ @@ -226,6 +231,26 @@ class ElggMenuItem { return $this->tooltip; } + /** + * Set the weight of the menu item + * + * @param int $weight The lower weight items float to the top of the menu + * + * @return void + */ + public function setWeight($weight) { + $this->weight = $weight; + } + + /** + * Get the weight of the menu item + * + * @return int + */ + public function getWeight() { + return $this->weight; + } + /** * Set the section identifier * -- cgit v1.2.3