Adds #delete_menu_item to the plugin API (#2087).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@1952 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
738fc579f0
commit
5f9f6ea2e1
|
@ -94,7 +94,11 @@ module Redmine
|
|||
def map(menu_name)
|
||||
@items ||= {}
|
||||
mapper = Mapper.new(menu_name.to_sym, @items)
|
||||
yield mapper
|
||||
if block_given?
|
||||
yield mapper
|
||||
else
|
||||
mapper
|
||||
end
|
||||
end
|
||||
|
||||
def items(menu_name)
|
||||
|
|
|
@ -70,8 +70,14 @@ module Redmine #:nodoc:
|
|||
#
|
||||
# +name+ parameter can be: :top_menu, :account_menu, :application_menu or :project_menu
|
||||
#
|
||||
def menu(name, item, url, options={})
|
||||
Redmine::MenuManager.map(name) {|menu| menu.push item, url, options}
|
||||
def menu(menu, item, url, options={})
|
||||
Redmine::MenuManager.map(menu).push(item, url, options)
|
||||
end
|
||||
alias :add_menu_item :menu
|
||||
|
||||
# Removes +item+ from the given +menu+.
|
||||
def delete_menu_item(menu, item)
|
||||
Redmine::MenuManager.map(menu).delete(item)
|
||||
end
|
||||
|
||||
# Defines a permission called +name+ for the given +actions+.
|
||||
|
|
Loading…
Reference in New Issue