Modul:Klasse: Unterschied zwischen den Versionen

Aus FürthWiki
Zur Navigation springen Zur Suche springen
Zeile 70: Zeile 70:
 
    '<td>[[Attribut:Suchvorlage|Suchvorlage]]</td>'
 
    '<td>[[Attribut:Suchvorlage|Suchvorlage]]</td>'
 
if not isEmpty(args.KlassenKategorie) then
 
if not isEmpty(args.KlassenKategorie) then
    t=t..'<td colspan="3">[[Suchvorlage::Abfrage_'..args.KlassenKategorie..']]</td>'
+
    t=t..'<td colspan="3">[[Suchvorlage::Abfrage_'..args.KlassenKategorie..']]</td>'..
 +
    '[[Spezial:Abfrage_ausführen/Abfrage_:'..args.KlassenKategorie..']]'
 
end
 
end
 
 

Version vom 21. Februar 2024, 21:31 Uhr

local p = {} --p stands for package
local c = require( "Module:Common" )

function p.Faktenbox( frame )
	pf = frame:getParent()
	args = pf.args
	t = p.Daten( frame, args )
	
	-- The tab "Daten" is visible everytime
	--tpl_daten = p.DatenOld( frame, args )
	--tab_daten='<tab name=Daten>' .. 
	--tpl_daten .. '</tab>'
	
	--t ='<div class=factbox><tabs>' .. 
	--   tab_daten .. 
	--   '</tabs></div>'
	   
	-- Use preprocess to render the factbox and all contens at once
	return frame:preprocess(t)
end

function p.Daten(frame, args)
	title = mw.title.getCurrentTitle().text
	t = '<table class="wikitable">'..
		'<th colspan="4">'..title..'</th>'
		
	t=t..'<tr>'..
	    '<td>[[Attribut:KlassenBildHauptseite|Bild auf Hauptseite (48px)]]</td>'
	if not isEmpty(args.KlassenBildHauptseite) then
	    t=t..'<td colspan="3">[[KlassenBildHauptseite::Datei:'..args.KlassenBildHauptseite..']]</td>'
	end
	
	t=t..'</tr><tr>'..
	    '<td>[[Attribut:KlassenBildKategorie|Bild in Kategorie (64px)]]</td>'
	if not isEmpty(args.KlassenBildKategorie) then
	    t=t..'<td colspan="3">[[KlassenBildKategorie::Datei:'..args.KlassenBildKategorie..']]</td>'
	end 

	t=t..'</tr><tr>'..
	    '<td>[[Attribut:KlassenVorlage|Vorlage]]</td>'
	if not isEmpty(title) then
	    t=t..'<td colspan="3">[[KlassenVorlage::Vorlage:'..title..']]</td>'
	end
	
	t=t..'</tr><tr>'..
	    '<td>[[Attribut:KlassenModul|Modul]]</td>'
	if not isEmpty(title) then
	    t=t..'<td colspan="3">[[KlassenModul::Modul:'..title..']]</td>'
	end
	
	t=t..'</tr><tr>'..
	    '<td>[[Attribut:KlassenKategorie|Kategorie]]</td>'
	if not isEmpty(args.KlassenKategorie) then
	    t=t..'<td colspan="3">[[KlassenKategorie::Kategorie:'..args.KlassenKategorie..']]</td>'
	end
	
	t=t..'</tr><tr>'..
	    '<td>[[Attribut:KlassenFormular|Formular]]</td>'
	if not isEmpty(title) then
	    t=t..'<td colspan="3">[[KlassenFormular::Formular:'..title..']]</td>'
	end
	
	t=t..'</tr><tr>'..
	    '<td>[[Attribut:Suchformular|Suchformular]]</td>'
	if not isEmpty(args.KlassenKategorie) then
	    t=t..'<td colspan="3">[[Suchformular::Abfrage_'..args.KlassenKategorie..']]</td>'
	end
	
	t=t..'</tr><tr>'..
	    '<td>[[Attribut:Suchvorlage|Suchvorlage]]</td>'
	if not isEmpty(args.KlassenKategorie) then
	    t=t..'<td colspan="3">[[Suchvorlage::Abfrage_'..args.KlassenKategorie..']]</td>'..
	    	'[[Spezial:Abfrage_ausführen/Abfrage_:'..args.KlassenKategorie..']]'
	end
	
	t=t..'<tr>'..
		'<td>[[Bild:IconSearch32px.png|16px|semantisches Browsen|link=Spezial:Durchsuchen/{{NAMESPACE}}:{{PAGENAME}}]]</td>'..
		'<td colspan="3">[[Spezial:Durchsuchen/{{NAMESPACE}}:{{PAGENAME}}|semantisches Browsen]]</td>'..
	'</tr>'
	t=t..'</table>'
	return t
end
	
function p.DatenOld( frame, args )
	t = frame:expandTemplate{title = 'Klasse.Daten', args={
		KlassenName=mw.title.getCurrentTitle().text,
        KlassenBildHauptseite=args.KlassenBildHauptseite,
        KlassenBildKategorie=args.KlassenBildKategorie,
        KlassenKategorie=args.KlassenKategorie}
	}
    return t
end

return p