def category
end

def categories_categories(path = @datadir)
  src = ""
  Dir.foreach(path.untaint){|d|
    fulld = "#{path}/#{d}"
    if d != "." and d != ".."then
      fs = []
      @file_extension.each do |fext|
        fs += Dir.glob("#{fulld}/**/*.#{fext}".untaint)
      end
      if !fs.nil? and fs.size > 0 then
        pi = fulld.sub("#{@datadir}/","")
        src << "<li><a href=\"#{@url}/#{pi}\">#{get_alias_name(d)}</a>[#{fs.size.to_s}]\n"
        src << categories_categories(fulld)
        src << "</li>\n"
      end
    end
  }
  if src != "" then
     src = "<ul>\n" + src + "</ul>\n"
  end
  return src
end

def get_alias_name(path)
  if @env["category::#{path}"]
    convert(@env["category::#{path}"])
  else
    path
  end
end
