Module:Protection banner: Difference between revisions
simplify further
(use new cfg format) |
(simplify further) |
||
Line 121: | Line 121: | ||
do | do | ||
self.bannerConfig = {} | self.bannerConfig = {} | ||
local configTables = {} | local configTables = {} | ||
if | if configObj.banners[self.action] then | ||
configTables[#configTables + 1] = | configTables[#configTables + 1] = configObj.banners[self.action][self.reason] | ||
end | end | ||
if | if configObj.defaultBanners[self.action] then | ||
configTables[#configTables + 1] = | configTables[#configTables + 1] = configObj.defaultBanners[self.action][self.level] | ||
configTables[#configTables + 1] = | configTables[#configTables + 1] = configObj.defaultBanners[self.action].default | ||
end | end | ||
configTables[#configTables + 1] = | configTables[#configTables + 1] = configObj.masterBanner | ||
for i, field in ipairs(self.bannerConfigFields) do | for i, field in ipairs(self.bannerConfigFields) do | ||
for j, t in ipairs(configTables) do | for j, t in ipairs(configTables) do | ||
Line 604: | Line 603: | ||
msg = protectionBlurbs.edit.default | msg = protectionBlurbs.edit.default | ||
else | else | ||
error('no protection blurb defined for | error('no protection blurb defined for protectionBlurbs.edit.default') | ||
end | end | ||
return self:_substituteParameters(msg) | return self:_substituteParameters(msg) | ||
Line 630: | Line 629: | ||
msg = protectionLevels.edit.default | msg = protectionLevels.edit.default | ||
else | else | ||
error('no protection level defined for | error('no protection level defined for protectionLevels.edit.default') | ||
end | end | ||
return self:_substituteParameters(msg) | return self:_substituteParameters(msg) |