diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-03-04 06:01:05 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-03-04 06:01:05 +0000 |
commit | 7514e12d331bea026155df6cdc2b68df8b77d7b1 (patch) | |
tree | 386ddf1a125225c55825860dd44391d6799af073 /lib | |
parent | afdcd770dcb9d6b3b1f8fe301edb06a05596a5fb (diff) | |
download | redmine-7514e12d331bea026155df6cdc2b68df8b77d7b1.tar.gz redmine-7514e12d331bea026155df6cdc2b68df8b77d7b1.zip |
Hide the main menu div if there isn't any items for it. #3259
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3539 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/menu_manager.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/redmine/menu_manager.rb b/lib/redmine/menu_manager.rb index 34cea79fa..4094a9c14 100644 --- a/lib/redmine/menu_manager.rb +++ b/lib/redmine/menu_manager.rb @@ -166,6 +166,11 @@ module Redmine render_menu((project && !project.new_record?) ? :project_menu : :application_menu, project) end + def display_main_menu?(project) + menu_name = project && !project.new_record? ? :project_menu : :application_menu + Redmine::MenuManager.items(menu_name).size > 1 # 1 element is the root + end + def render_menu(menu, project=nil) links = [] menu_items_for(menu, project) do |node| |