Module:ShipInfobox: Difference between revisions
Content deleted Content added
mNo edit summary |
No edit summary |
||
Line 1:
local ShipInfobox = {}
-- This avoids using the {{#if:{{{factionreq|}}}||}} ParserFunction.
function ShipInfobox.Factionreq( field, vars )▼
local result = false
if type(s) == "nil" then
return output▼
result = true
elseif type(s) == "string" then
if s == "" then
result = true
end
elseif type(s) == "table" then
if next(s) == nil then
result = true
end
end
return result
end
local text = 'Requires '.. field.Requirement ..' rank of '.. file.Rank ..' or higher'
if not isempty(field.Requirement) then
local output = mw.html.create('span')
:addClass('factionreq'):wikitext(text)
▲ return tostring(output)
end
end
| |||