Module:Bugzilla

local UrlEncoding = require( 'Module:UrlEncoding' ) local encode = UrlEncoding._encode

local link_to_component = function ( product, component, linktext ) local linkstr = '[[:mediazilla:buglist.cgi?query_format=advanced&product=' .. encode( product )	local construct = false

if linktext == nil or linktext == '' then construct = true linktext = 'Bugs in product ' .. product end

if component ~= nil and component ~= '' then linkstr = linkstr .. '&component=' encode( component )

if construct then linktext = linktext .. ' and component ' .. component end end

return linkstr .. '|' .. linktext .. ']]' end

return { _link_to_component = link_to_component,

link_to_component = function ( frame ) local product, component, text

if frame.args[1] ~= nil then product = frame.args[1] if frame.args[2] ~= nil then component = frame.args[2] if frame.args[3] ~= nil then text = frame.args[3] end end else if frame.args.product ~= nil then product = frame.args.product if frame.args.component ~= nil then component = frame.args.component end end

if frame.args.text ~= nil then text = frame.args.text end end

return link_to_component( product, component, text ) end }