Modul:Vorlage:ATP-Turnierplan

aus Wikipedia, der freien Enzyklopädie

Die Dokumentation für dieses Modul kann unter Modul:Vorlage:ATP-Turnierplan/Doku erstellt werden

--[=[

Achtung Draft in Arbeit, derzeit noch nicht verwendbar!

Vorlage:ATP-Turnierplan


]=]
local p = { }
local keytyp={["ds"]="tournament information"
	, ["mds"] = "main draw singles"
	, ["mdd"] = "main draw doubles"
	, ["qs"] = "qualifier singles"
	, ["qd"] = "qualifier doubles"
	, ["op"] = "order of play"
	, ["singles"] = "main draw singles"
	, ["doubles"] = "main draw doubles"
	, ["qualifierSingles"] = "qualifier singles"
	, ["qualifierDoubles"] = "qualifier doubles"	
	--|mds=singles|mdd=doubles|qs=qualifierSingles|qd=qualifierDoubles
	}
local l_url
local lucky
local URLutil

local function getparams (frame)
	local l_pars
    l_pars  = frame:getParent().args
    l_url =  l_pars.url
end --getparams

local function getParsURL(url)
  local lucky, l_authority, l_path, l_query, l_fragment, l_praefix, l_Linktext, l_postfix, splitpath, l_url2
        lucky, URLutil = pcall( require, "Modul:URLutil" )
        l_authortiy =URLutil.getAuthority(url)
        l_path =URLutil.getPath(url)
        l_query =URLutil.getQuery(url)
        l_fragment =URLutil.getFragment(url)
        
        if l_authortiy== "www.protennislive.com" then
        	splitpath= mw.text.split(l_path,"/")
        	url = string.format("http://www.protennislive.com/%s", l_path)
        	--http://www.atpworldtour.com/posting/2015/341/mds.pdf
        	l_praefix ="Turnierplan als"
        	l_Linktext= "PDF"
        	l_postfix= "auf der ATP-Homepage"
        	
        	
        	
        elseif l_authortiy== "www.atpworldtour.com" then
        	url = string.format("http://www.atpworldtour.com/%s", l_path)
        end 
       -- http://www.protennislive.com/posting/{{{jahr}}}/{{{id}}}/{{#switch:{{{typ}}}|mds|mdd|qs|qd={{{typ}}}|#default=mds}}.pdf PDF
        return url, l_praefix, l_Linktext, l_postfix
  end