Modul:Vorlage:Infobox Sendeanlage/Wartung

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen

Diese Seite enthält Code in der Programmiersprache Lua. Einbindungszahl Cirrus

Die zugehörigen Links sind unter Vorlage:Infobox Sendeanlage/Wartung verzeichnet.


 --	Einbinden von Wartungslinks
 local p = {}

 function p.WartungLua( DSZusatz, Daten, DN, Kategorien, frame )
	local WAL = { }
	local TEMP = { }
	if DN.NAME.WertZeile == "XXX123ABC987XXX" then table.insert(WAL, "Fehler 1" ) end
	
 --	--	Zuordnung Kategorie zum Gastronomiebetrieb
 --	TEMP = { }
 --	TEMP.VERW = false
 --	TEMP.Kategorie = false
 --	TEMP.KatInhalt = false
 --	TEMP.Inhalt = ""
 --	for ResVk, ResVv in pairs( DN.VERW.WertSplit ) do
 --		if (ResVv == "Drehrestaurant" or ResVv == "Restaurant") then TEMP.VERW = true end
 --	end
 --	for ResKk, ResKv in pairs( Kategorien ) do
 --		if ResKv.Name == "Gastronomiebetrieb" then TEMP.Kategorie = true end
 --	end
 --	if TEMP.VERW == true then
 --		TEMP.Inhalt = mw.title.getCurrentTitle():getContent()
 --		if string.find( TEMP.Inhalt, "und Verpflegungsbetrieb" ) then TEMP.KatInhalt = true end
 --		if ((TEMP.Kategorie == true and TEMP.KatInhalt == true) or (TEMP.Kategorie == false and TEMP.KatInhalt == false)) then table.insert(WAL, "Zuordnung Kategorie zum Gastronomiebetrieb fehlerhaft" ) end
 --	end
	
	--	Auswertung
	local Text = ""
	if #WAL > 0 then
		for WLk, WLv in pairs( WAL ) do
			if WLv == "Wartung" then
				WLv = "[[Vorlage:Infobox Sendeanlage/" .. WLv .. "]]"
			else
				WLv = "[[Vorlage:Infobox Sendeanlage/Wartung/" .. WLv .. "]]"
			end
			Text = Text .. WLv
		end
		WAL.Text = mw.html.create( "span" )
			:css( "display", "none" )
			:wikitext( Text )
		WAL.Text = tostring( WAL.Text )
	end
		return WAL.Text or ""
	end

 function p.WartungWiki( DSZusatz, DN, frame )
	local WAW = { title = "Infobox Sendeanlage/WART", args = { } }
	
	for WWk, WWv in pairs( DN ) do
		if type( WWv.WertZeile ) == "string" then
			WAW.args[WWv.Name] = mw.getCurrentFrame():getParent().args[WWv.Name] or frame.args[WWv.Name] or WWv.WertZeile
			end
	end
	
	return frame:expandTemplate{ title = WAW.title, args = WAW.args }
 end

 return p
Abgerufen von „https://de.wikipedia.org/w/index.php?title=Modul:Vorlage:Infobox_Sendeanlage/Wartung&oldid=189562091"