[#692] Fix syntax errors and undefined methods in layout from merge

This commit is contained in:
Eric Davis 2011-11-12 14:46:06 -08:00
parent 83f8f63640
commit 32fa8cb522
1 changed files with 9 additions and 1 deletions

View File

@ -973,14 +973,21 @@ module ApplicationHelper
split_top_menu_into_main_or_more_menus[:more] split_top_menu_into_main_or_more_menus[:more]
end end
def help_menu_item
split_top_menu_into_main_or_more_menus[:help]
end
# Split the :top_menu into separate :main and :more items # Split the :top_menu into separate :main and :more items
def split_top_menu_into_main_or_more_menus def split_top_menu_into_main_or_more_menus
unless @top_menu_split unless @top_menu_split
items_for_main_level = [] items_for_main_level = []
items_for_more_level = [] items_for_more_level = []
help_menu = nil
menu_items_for(:top_menu) do |item| menu_items_for(:top_menu) do |item|
if item.name == :home || item.name == :my_page if item.name == :home || item.name == :my_page
items_for_main_level << item items_for_main_level << item
elsif item.name == :help
help_menu = item
elsif item.name == :projects elsif item.name == :projects
# Remove, present in layout # Remove, present in layout
else else
@ -989,7 +996,8 @@ module ApplicationHelper
end end
@top_menu_split = { @top_menu_split = {
:main => items_for_main_level, :main => items_for_main_level,
:more => items_for_more_level :more => items_for_more_level,
:help => help_menu
} }
end end
@top_menu_split @top_menu_split