From 65473615d9ef9cdea27d73c3ffbf9891f7bccf96 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 14 Apr 2010 04:04:44 +0000 Subject: [PATCH] MINOR Partially reverted r99079 - SiteTree->getNavigatorItems() was refactored to SilverStripeNavigator::get_for_record() (from r99081) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102840 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 50 ----------------------------------------- 1 file changed, 50 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index ef5ca0cf8..a64d59761 100755 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -1847,56 +1847,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid return $fields; } - function getNavigatorItems() { - Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css'); - Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js'); - // Requirements::javascript(THIRDPARTY_DIR . '/prototype.js'); - Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js'); - Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-livequery/jquery.livequery.js'); - Requirements::javascript(SAPPHIRE_DIR . '/javascript/SilverStripeNavigator.js'); - - $items = ''; - $message = ''; - $link = ''; - - $navItemClasses = ClassInfo::subclassesFor('SilverStripeNavigatorItem'); - array_shift($navItemClasses); - - // Sort menu items according to priority - $menuPriority = array(); - $i = 0; - foreach($navItemClasses as $navItemClass) { - if($navItemClass == 'SilverStripeNavigatorItem') continue; - - $i++; - $obj = new $navItemClass(); - // This funny litle formula ensures that the first item added with the same priority will be left-most. - $priority = Object::get_static($navItemClass, 'priority'); - $menuPriority[$priority * 100 - 1] = $obj; - } - ksort($menuPriority); - - foreach($menuPriority as $obj) { - - $text = $obj->getHTML($this); - if($text) $items .= $text; - $newMessage = $obj->getMessage($this); - if($newMessage) $message = $newMessage; - $newLink = $obj->getLink($this); - if($newLink) $link = $newLink; - } - - if($link) { - $data = new ArrayData(array('Link' => $link)); - $items .= $data->renderWith(array('SilverStripeNavigatorLink')); - } - - return array( - 'items' => $items, - 'message' => $message - ); - } - /** * * @param boolean $includerelations a boolean value to indicate if the labels returned include relation fields