মডিউল:Message box: সংশোধিত সংস্করণের মধ্যে পার্থক্য
use the same invalid type warning as the previous template |
load box types from the config page automatically |
||
৫ নং লাইন: | ৫ নং লাইন: | ||
local categoryHandler = require('Module:Category handler').main | local categoryHandler = require('Module:Category handler').main | ||
local yesno = require('Module:Yesno') | local yesno = require('Module:Yesno') | ||
-- Load the configuration page. | |||
local cfgTables = mw.loadData('Module:Message box/configuration') | |||
-- Get a language object for formatDate and ucfirst. | -- Get a language object for formatDate and ucfirst. | ||
১৩১ নং লাইন: | ১৩৪ নং লাইন: | ||
boxType = box.getMboxType(self.nsid) | boxType = box.getMboxType(self.nsid) | ||
end | end | ||
local cfg = cfgTables[boxType] | local cfg = cfgTables[boxType] | ||
if not cfg then | if not cfg then | ||
১৮২ নং লাইন: | ১৮৪ নং লাইন: | ||
self.isSmall = false | self.isSmall = false | ||
end | end | ||
-- Add attributes, classes and styles. | -- Add attributes, classes and styles. | ||
৫৫১ নং লাইন: | ৫৫২ নং লাইন: | ||
end | end | ||
local p = { | |||
box = box, | box = box, | ||
makeBox = makeBox, | makeBox = makeBox, | ||
mbox = makeWrapper('mbox | mbox = makeWrapper('mbox') | ||
} | } | ||
for boxType in pairs(cfgTables) do | |||
p[boxType] = makeWrapper(boxType) | |||
end | |||
return p |