@ -35,12 +35,12 @@ module Redmine::MenuManager::MenuHelper
{ :controller = > 'wiki' , :action = > 'show' , :id = > h ( main_item . title ) } ,
:param = > :project_id , :caption = > main_item . name
menu . push :wiki_create_new_page , { :action = > " new_child " , :controller = > " wiki " , :id = > h ( main_item . title ) } ,
menu . push :" #{ main_item . item_class } _new_page " , { :action = > " new_child " , :controller = > " wiki " , :id = > h ( main_item . title ) } ,
:param = > :project_id , :caption = > :create_child_page ,
:parent = > " #{ main_item . item_class } " . to_sym if main_item . new_wiki_page and
WikiPage . find_by_wiki_id_and_title ( project_wiki . id , main_item . title )
menu . push :table_of_contents , { :action = > 'index' , :controller = > 'wiki' , :id = > h ( main_item . title ) } , :param = > :project_id , :caption = > :label_table_of_contents , :parent = > " #{ main_item . item_class } " . to_sym if main_item . index_page
menu . push :" #{ main_item . item_class } _toc " , { :action = > 'index' , :controller = > 'wiki' , :id = > h ( main_item . title ) } , :param = > :project_id , :caption = > :label_table_of_contents , :parent = > " #{ main_item . item_class } " . to_sym if main_item . index_page
main_item . children . each do | child |
menu . push " #{ child . item_class } " . to_sym ,
@ -185,15 +185,7 @@ module Redmine::MenuManager::MenuHelper
end
caption = item . caption ( project )
if @page and @page . instance_of? ( WikiPage ) and ! @page . new_record? and current_menu_item == :wiki
menu_item = @page . nearest_menu_item
selected = node . name . to_sym == menu_item . title . dasherize . to_sym if menu_item
elsif current_menu_item == :wiki and related_page = params [ :id ]
selected = related_page . dasherize == item . name . to_s . dasherize
else
selected = current_menu_item == item . name
end
selected = current_menu_item == item . name
return [ caption , url , selected ]
end