Modul:Common: Unterschied zwischen den Versionen

Aus FürthWiki
Zur Navigation springen Zur Suche springen
 
Zeile 1: Zeile 1:
 
local p = {}
 
local p = {}
  
function p.AttributeTable( args )
+
function p.AttributeTable(args)
 +
-- Draws a simple Table that contains all arguments that are fed from the
 +
-- template to the scribunto-model. For debugging only!
 
t='<table class="wikitable">'
 
t='<table class="wikitable">'
for i,v in pairs(args) do
+
for i, v in pairs(args) do
t = t .. '<tr><td>[[Attribute:' .. i .. ']]</td><td>' .. v .. '</td></tr>'
+
t = t .. '<tr><td>[[Attribut:' .. i .. '|' .. i .. ']]</td>' ..
 +
'<td>' .. v .. '</td></tr>'
 
end
 
end
 
t = t .. '</table>'
 
t = t .. '</table>'

Aktuelle Version vom 3. Februar 2024, 15:10 Uhr

Das Commons-Modul ist ein reines Import-Modul, welches immer wieder kehrende Funktionen beinhaltet, die über das Ganze Projekt hinweg immer wieder gebraucht werden.


local p = {}

function p.AttributeTable(args)
	-- Draws a simple Table that contains all arguments that are fed from the
	-- template to the scribunto-model. For debugging only!
	t='<table class="wikitable">'
	for i, v in pairs(args) do
		t = t .. '<tr><td>[[Attribut:' .. i .. '|' .. i .. ']]</td>' ..
				 '<td>' .. v .. '</td></tr>'
	end
	t = t .. '</table>'
	return t
end

function isEmpty(a)
	return a == '' or a == nil
end

return p