module SearchHelper

  def tree_lines(dir, user, first=true)
    lines = ""
    if (parent = dir.parent)
      if parent.directory_nodes(:user=>user)[-1] == dir
        if first
          type = "last"
        else
          type = "none"
        end
      else
        if first
          type = "t"
        else
          type = "tate"
        end
      end
      lines += tree_lines(parent, user, false)
      lines += image_tag("tree/#{type}.gif", :border => "0", :align => "middle", :class => "tree")+"<span class=\"tree\">\n</span>"
    end
    return lines
  end

end
