Project

General

Profile

RE: Redmine+Bundler - method_missing "has_key?" ยป menu_manager.patch

patch for menu_manager.rb - Lee Pope, 2011-02-11 21:28

View differences:

lib/redmine/menu_manager.rb
# parent is set to be the receiver. The child is added as the first child in
# the current list of children for the receiver node.
def prepend(child)
raise "Child already added" if @children_hash.has_key?(child.name)
raise "Child already added" if @childrenHash.has_key?(child.name)
@children_hash[child.name] = child
@childrenHash[child.name] = child
@children = [child] + @children
child.parent = self
return child
......
# parent is set to be the receiver. The child is added at the position
# into the current list of children for the receiver node.
def add_at(child, position)
raise "Child already added" if @children_hash.has_key?(child.name)
raise "Child already added" if @childrenHash.has_key?(child.name)
@children_hash[child.name] = child
@childrenHash[child.name] = child
@children = @children.insert(position, child)
child.parent = self
return child
......
end
def add_last(child)
raise "Child already added" if @children_hash.has_key?(child.name)
raise "Child already added" if @childrenHash.has_key?(child.name)
@children_hash[child.name] = child
@childrenHash[child.name] = child
@children << child
@last_items_count += 1
child.parent = self
......
# parent is set to be the receiver. The child is added as the last child in
# the current list of children for the receiver node.
def add(child)
raise "Child already added" if @children_hash.has_key?(child.name)
raise "Child already added" if @childrenHash.has_key?(child.name)
@children_hash[child.name] = child
@childrenHash[child.name] = child
position = @children.size - @last_items_count
@children.insert(position, child)
child.parent = self
......
end
def render_menu_node(node, project=nil)
if node.has_children? || !node.child_menus.nil?
if node.hasChildren? || !node.child_menus.nil?
return render_menu_node_with_children(node, project)
else
caption, url, selected = extract_node_details(node, project)
    (1-1/1)