@@ -99,7 +99,6 module Redmine | |||||
99 | item.url |
|
99 | item.url | |
100 | end |
|
100 | end | |
101 | caption = item.caption(project) |
|
101 | caption = item.caption(project) | |
102 | caption = l_or_humanize(caption, :prefix => 'label_') if caption.is_a?(Symbol) |
|
|||
103 | if block_given? |
|
102 | if block_given? | |
104 | yield item, caption, url, (current_menu_item == item.name) |
|
103 | yield item, caption, url, (current_menu_item == item.name) | |
105 | else |
|
104 | else | |
@@ -186,7 +185,7 module Redmine | |||||
186 | @url = url |
|
185 | @url = url | |
187 | @condition = options[:if] |
|
186 | @condition = options[:if] | |
188 | @param = options[:param] || :id |
|
187 | @param = options[:param] || :id | |
189 |
@caption = options[:caption] |
|
188 | @caption = options[:caption] | |
190 | @html_options = options[:html] || {} |
|
189 | @html_options = options[:html] || {} | |
191 | # Adds a unique class to each menu item based on its name |
|
190 | # Adds a unique class to each menu item based on its name | |
192 | @html_options[:class] = [@html_options[:class], @name.to_s.dasherize].compact.join(' ') |
|
191 | @html_options[:class] = [@html_options[:class], @name.to_s.dasherize].compact.join(' ') | |
@@ -198,7 +197,11 module Redmine | |||||
198 | c = @name.to_s.humanize if c.blank? |
|
197 | c = @name.to_s.humanize if c.blank? | |
199 | c |
|
198 | c | |
200 | else |
|
199 | else | |
201 | @caption |
|
200 | if @caption.nil? | |
|
201 | l_or_humanize(name, :prefix => 'label_') | |||
|
202 | else | |||
|
203 | @caption.is_a?(Symbol) ? l(@caption) : @caption | |||
|
204 | end | |||
202 | end |
|
205 | end | |
203 | end |
|
206 | end | |
204 |
|
207 |
General Comments 0
You need to be logged in to leave comments.
Login now