summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-03-04 06:01:05 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-03-04 06:01:05 +0000
commit7514e12d331bea026155df6cdc2b68df8b77d7b1 (patch)
tree386ddf1a125225c55825860dd44391d6799af073 /lib
parentafdcd770dcb9d6b3b1f8fe301edb06a05596a5fb (diff)
downloadredmine-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.rb5
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|