app/controllers/application_controller.rb
# Handle the breadcrumb array by either adding, or resetting to, the passed in breadcrumb
Handle the breadcrumb array by either adding, or resetting to, the passed in breadcrumb
Handle the breadcrumb array by either adding or resetting to the passed in breadcrumb
def drop_breadcrumb(new_bc, onlyreplace = false) 
    return if skip_breadcrumb?
    remove = 0
    @breadcrumbs.each do |bc|
      if remove > 0         
        remove += 1       
      else
        if bc[:name].to_s.gsub(/\(.*/, "").rstrip == new_bc[:name].to_s.gsub(/\(.*/, "").rstrip ||
           bc[:url].to_s.gsub(/\/.?$/, "") == new_bc[:url].to_s.gsub(/\/.?$/, "")
          remove = 1
        end
      end
    end
    remove.times { @breadcrumbs.pop } 
    if onlyreplace                                              
      @breadcrumbs.push(new_bc) if remove > 0 
    else
      @breadcrumbs.push(new_bc)
    end
    @breadcrumbs.push(new_bc) if onlyreplace && @breadcrumbs.empty?
    if (@lastaction == "registry_items" || @lastaction == "filesystems" || @lastaction == "files") && new_bc[:name].length > 50
      @title = new_bc [:name].slice(0..50) + "..."  
    else
      @title = new_bc [:name] 
    end
  end
def drop_breadcrumb ( new_bc , onlyreplace = false ) return if skip_breadcrumb? remove = 0 @breadcrumbs . each do | bc | if remove > 0 remove += 1 else if bc [ :name ] . to_s . gsub ( / \( .* / , "" ) . rstrip == new_bc [ :name ] . to_s . gsub ( / \( .* / , "" ) . rstrip || bc [ :url ] . to_s . gsub ( / \/ .?$ / , "" ) == new_bc [ :url ] . to_s . gsub ( / \/ .?$ / , "" ) remove = 1 end end end remove . times { @breadcrumbs . pop } if onlyreplace @breadcrumbs . push ( new_bc ) if remove > 0 else @breadcrumbs . push ( new_bc ) end @breadcrumbs . push ( new_bc ) if onlyreplace && @breadcrumbs . empty? if ( @lastaction == "registry_items" || @lastaction == "filesystems" || @lastaction == "files" ) && new_bc [ :name ] . length > 50 @title = new_bc [ :name ] . slice ( 0 .. 50 ) + "..." else @title = new_bc [ :name ] end end
Handle the breadcrumb array by either adding, or resetting to, the passed in breadcrumb
Handle the breadcrumb array by either adding or resetting to the passed in breadcrumb
# if replace = true, only add this bc if it was already there # if the breadcrumb is in the array, remove it and all below by counting how many to pop # already found a match, #   increment pop counter # Check for a name match BEFORE the first left paren "(" or a url match BEFORE the last slash "/" # remove found element and any lower elements # if replacing, # only add it if something was removed # Set the title to be the new breadcrumb # Set the title to be the new breadcrumb
new_bc
<not_specific>
onlyreplace
<not_specific>