summaryrefslogtreecommitdiffstats
path: root/lib/redmine/plugin.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-22 18:19:00 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-22 18:19:00 +0000
commit792b7f30e32eec84d6106e947fc3987e4e26a0b0 (patch)
tree4cb8b01adcbd16fd7b0bde60c0372ccb57f42e6f /lib/redmine/plugin.rb
parentb0bb41ad355771d4ae4704585f29bc12ae6c345d (diff)
downloadredmine-792b7f30e32eec84d6106e947fc3987e4e26a0b0.tar.gz
redmine-792b7f30e32eec84d6106e947fc3987e4e26a0b0.zip
Menus items:
* fixed broken translation when a plugin is installed (closes #649) * small fix to the plugin API: options parameter added to Redmine::Plugin#menu git-svn-id: http://redmine.rubyforge.org/svn/trunk@1172 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/plugin.rb')
-rw-r--r--lib/redmine/plugin.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb
index e6047974e..36632c13e 100644
--- a/lib/redmine/plugin.rb
+++ b/lib/redmine/plugin.rb
@@ -66,11 +66,12 @@ module Redmine #:nodoc:
# Adds an item to the given +menu+.
# The +id+ parameter (equals to the project id) is automatically added to the url.
- # menu :project_menu, :label_plugin_example, :controller => 'example', :action => 'say_hello'
+ # menu :project_menu, :plugin_example, { :controller => 'example', :action => 'say_hello' }, :caption => 'Sample'
#
- # Currently, only the project menu can be extended. Thus, the +name+ parameter must be +:project_menu+
- def menu(name, label, url)
- Redmine::MenuManager.map(name) {|menu| menu.push label, url}
+ # +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}
end
# Defines a permission called +name+ for the given +actions+.