Methods
Included Modules
Attributes
[R] items
[R] name
[R] options
Public Instance methods
add(name, path=nil, options={}, &block)

Add a new submenu to the menu

     # File lib/access_control/base.rb, line 203
203:       def add(name, path=nil, options={}, &block)
204:         @items << Menu.new(name, path, options, &block)
205:       end
allowed()

Return allowed controllers

     # File lib/access_control/base.rb, line 208
208:       def allowed
209:         @items.each { |i| @allowed.concat i.allowed }
210:         @allowed.uniq
211:       end
config()

Return ExtJs Config for this menu

     # File lib/access_control/base.rb, line 224
224:       def config
225:         if @url.blank? && @items.empty?
226:           options = human_name
227:         else
228:           options = @options.merge(:text => human_name)
229:           options.merge!(:menu => @items.collect(&:config)) if @items.size > 0
230:           options.merge!(:handler => "function(){ Backend.app.load('#{url}') }".to_l) if !@url.blank?
231:         end
232:         options
233:       end
human_name()

Return the original name or try to translate or humanize the symbol

     # File lib/access_control/base.rb, line 214
214:       def human_name
215:         @name.is_a?(Symbol) ? I18n.t("backend.menus.#{@name}", :default => @name.to_s.humanize) : @name
216:       end
uid()

Return a unique id for the given project module

     # File lib/access_control/base.rb, line 219
219:       def uid
220:         @name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '')
221:       end
url()

Return the url of this menu

     # File lib/access_control/base.rb, line 198
198:       def url
199:         @url.is_a?(Hash) ? url_for(@url.merge(:only_path => true)) : @url
200:       end