Aktionen

Modul

Folge

Aus Bohnenwiki

LUA-Modul für die Vorlage:Folge/LUA


p = {}
Tabelle = require( "Modul:Tabelle" )

function p.Zeile(frame)
	local Nummer = frame.args.Nr
	local Nummer_Richtung = frame.args.Nr_Align
	local Nummer_Farbe = frame.args.Nr_Color 
	local Thema = frame.args.Thema
	local Thema_Richtung = frame.args.Thema_Align
	local Thema_Farbe = frame.args.Thema_Color 
	local Moderator = frame.args.Moderatoren
	local Moderator_Richtung = frame.args.Moderatoren_Align
	local Moderator_Farbe = frame.args.Moderatoren_Color
	local Gaeste = frame.args.Gaeste
	local Gaeste_Richtung = frame.args.Gaeste_Align
	local Gaeste_Farbe = frame.args.Gaeste_Color 
	local Datum = frame.args.Datum
	local Datum_Richtung = frame.args.Datum_Align
	local Datum_Farbe = frame.args.Datum_Color
	local Zuschauer = frame.args.Zuschauer
	local Zuschauer_Richtung = frame.args.Zuschauer_Align
	local Zuschauer_Farbe = frame.args.Zuschauer_Color
	local VOD = frame.args.VOD
	local VOD_Richtung = frame.args.VOD_Align
	local VOD_Farbe = frame.args.VOD_Color 
	local Inhalt = frame.args.Inhalt
	local Inhalt_Richtung = frame.args.Inhalt_Align
	local Inhalt_Farbe = frame.args.Inhalt_Color
	local Linie_Farbe = frame.args.Linie_Color
	
	local Colons = 0 -- Spaltenzähler für Inhalt und Linie
	local Inhalt_Spalte

	 -- Spalte Nr
	if Nummer == nil
		then Nummer_Zeile = "" 
             Nummer_Abstand = ""
        elseif Nummer == ""
		then Nummer_Zeile = ""
             Nummer_Abstand = ""
        elseif Nummer == " "
		then Nummer_Zeile = ""
             Nummer_Abstand = ""
		else
			Colons = Colons + 1
			if Nummer_Richtung == nil
				then Nummer_Richtung = "center"
			end
			if Nummer_Farbe == nil
				then Nummer_Farbe = "#ececec"
			end
			Nummer_Zeile = Tabelle.Spalte(Nummer , Nummer_Richtung , Nummer_Farbe , 1)
			if Thema == nil and Moderator == nil and Gaeste == nil and Zuschauer == nil and VOD == nil and Datum == nil  -- falls Nr die letzte Spalte ist
				then
				Nummer_Abstand = ""
				else
				Nummer_Abstand = " |"
			end
	end
	
	 -- Spalte Thema
	if Thema == nil
		then Thema_Zeile = "" 
             Thema_Abstand = ""
        elseif Thema == ""
		then Thema_Zeile = ""
             Thema_Abstand = ""
        elseif Thema == " "
		then Thema_Zeile = ""
             Thema_Abstand = ""
		else
			Colons = Colons + 1
			if Thema_Richtung == nil
				then Thema_Richtung = "left"
			end
			if Thema_Farbe == nil
				then Thema_Farbe = "#ececec"
			end
			Thema_Zeile = Tabelle.Spalte(Thema , Thema_Richtung , Thema_Farbe , 1)
			if Moderator == nil and Gaeste == nil and Datum == nil and Zuschauer == nil and VOD == nil
				then
				Thema_Abstand = ""
				else
				Thema_Abstand = " |"
			end
	end
	
	 -- Spalte Moderator
	if Moderator == nil
		then Moderator_Zeile = "" 
             Moderator_Abstand = ""
        elseif Moderator == ""
		then Moderator_Zeile = ""
             Moderator_Abstand = ""
        elseif Moderator == " "
		then Moderator_Zeile = ""
             Moderator_Abstand = ""
		else
			Colons = Colons + 1
			if Moderator_Richtung == nil
				then Moderator_Richtung = "left"
			end
			if Moderator_Farbe == nil
				then Moderator_Farbe = "#ececec"
			end
			Moderator_Zeile = Tabelle.Spalte(Moderator , Moderator_Richtung , Moderator_Farbe , 1)
            Moderator_Abstand = "|"
			if Gaeste == nil and Datum == nil and Zuschauer == nil and VOD == nil
				then
				Moderator_Abstand = ""
				else
				Moderator_Abstand = " |"
			end
	end
	
	 -- Spalte Gaeste
	if Gaeste == nil
		then Gaeste_Zeile = "" 
             Gaeste_Abstand = ""
        elseif Gaeste == ""
		then Gaeste_Zeile = ""
             Gaeste_Abstand = ""
        elseif Gaeste == " "
		then Gaeste_Zeile = ""
             Gaeste_Abstand = ""
		else
			Colons = Colons + 1
			if Gaeste_Richtung == nil
				then Gaeste_Richtung = "left"
			end
			if Gaeste_Farbe == nil
				then Gaeste_Farbe = "#ececec"
			end
			Gaeste_Zeile = Tabelle.Spalte(Gaeste , Gaeste_Richtung , WertColor , Gaeste_Farbe)
            Gaeste_Abstand = "|"
			if Datum == nil and Zuschauer == nil and VOD == nil
				then
				Gaeste_Abstand = ""
				else
				Gaeste_Abstand = " |"
			end
	end
	
	 -- Spalte Datum
	if Datum == nil
		then Datum_Zeile = "" 
             Datum_Abstand = ""
        elseif Datum == ""
		then Datum_Zeile = ""
             Datum_Abstand = ""
        elseif Datum == " "
		then Datum_Zeile = ""
             Datum_Abstand = ""
		else
			Colons = Colons + 1
			if Datum_Richtung == nil
				then Datum_Richtung = "center"
			end
			if Datum_Farbe == nil
				then Datum_Farbe = "#ececec"
			end
			Datum_Zeile = Tabelle.Spalte(Datum , Datum_Richtung , Datum_Farbe , 1)
            Datum_Abstand = "|"
			if Zuschauer == nil and VOD == nil
				then
				Datum_Abstand = ""
				else
				Datum_Abstand = " |"
			end
	end
	
	 -- Spalte Zuschauer
	if Zuschauer == nil
		then Zuschauer_Zeile = "" 
             Zuschauer_Abstand = ""
        elseif Zuschauer == ""
		then Zuschauer_Zeile = ""
             Zuschauer_Abstand = ""
        elseif Zuschauer == " "
		then Zuschauer_Zeile = ""
             Zuschauer_Abstand = ""
		else
			Colons = Colons + 1
			if Zuschauer_Richtung == nil
				then Zuschauer_Richtung = "right"
			end
			if Zuschauer_Farbe == nil
				then Zuschauer_Farbe = "#ececec"
			end
			Zuschauer_Zeile = Tabelle.Spalte(Zuschauer , Zuschauer_Richtung , Zuschauer_Farbe , 1)
            Zuschauer_Abstand = "|"
			if VOD == nil
				then
				Zuschauer_Abstand = ""
				else
				Zuschauer_Abstand = " |"
			end
	end
	
	 -- Spalte VOD
	if VOD == nil

		then VOD_Zeile = "" 

        elseif VOD == ""
		then VOD_Zeile = ""

        elseif VOD == " "
		then VOD_Zeile = ""

		else
			Colons = Colons + 1
			if VOD_Richtung == nil
				then VOD_Richtung = "center"
			end
			if VOD_Farbe == nil
				then VOD_Farbe = "#ececec"
			end
			VOD_Zeile = Tabelle.Spalte(VOD , VOD_Richtung , VOD_Farbe , 1)

	end

	 -- Neue Zeile Inhalt
	if Inhalt == nil
		then Inhalt_Zeile = ""
             VOD_Abstand = ""
        elseif Inhalt == ""
		then Inhalt_Zeile = ""
             VOD_Abstand = ""
        elseif Inhalt == " "
		then Inhalt_Zeile = ""
             VOD_Abstand = ""
		else

			if Inhalt_Richtung == nil
				then Inhalt_Richtung = "left"
			end
			if Inhalt_Farbe == nil
				then Inhalt_Farbe = "#ececec"
			end
			Inhalt_Spalte = Tabelle.Spalte(Inhalt , Inhalt_Richtung , Inhalt_Farbe , Colons)
            Inhalt_Zeile = "\n|-\n " .. Inhalt_Spalte
            VOD_Abstand = "|"
	end
	
	 -- Neue farbige Linie (funktioniert momentan nicht)
	if Linie_Farbe == nil
		then Linie_Zeile = ""

		else
			Linie_Spalte = Tabelle.Spalte(" " , "left" , Linie_Farbe , Colons)
            Linie_Zeile = "\n|-\n " .. Linie_Spalte
			VOD_Abstand = "|"
	end
	
	-- Alles zusammenfassen und zurückgeben
	Zeile = "|-\n " .. Nummer_Zeile .. Nummer_Abstand .. Thema_Zeile .. Thema_Abstand .. Moderator_Zeile .. Moderator_Abstand .. Gaeste_Zeile .. Gaeste_Abstand .. Datum_Zeile .. Datum_Abstand .. Zuschauer_Zeile .. Zuschauer_Abstand .. VOD_Zeile .. Inhalt_Zeile .. Linie_Zeile 
	return Zeile
end

return p
Cookies helfen uns bei der Bereitstellung von Bohnenwiki. Durch die Nutzung von Bohnenwiki erklärst du dich damit einverstanden, dass wir Cookies speichern.