Jump to content

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 cfg = configObj
local configTables = {}
local configTables = {}
if cfg.banners[self.action] then
if configObj.banners[self.action] then
configTables[#configTables + 1] = cfg.banners[self.action][self.reason]
configTables[#configTables + 1] = configObj.banners[self.action][self.reason]
end
end
if cfg.defaultBanners[self.action] then
if configObj.defaultBanners[self.action] then
configTables[#configTables + 1] = cfg.defaultBanners[self.action][self.level]
configTables[#configTables + 1] = configObj.defaultBanners[self.action][self.level]
configTables[#configTables + 1] = cfg.defaultBanners[self.action].default
configTables[#configTables + 1] = configObj.defaultBanners[self.action].default
end
end
configTables[#configTables + 1] = cfg.masterBanner
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 cfg.protectionBlurbs.edit.default')
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 cfg.protectionLevels.edit.default')
error('no protection level defined for protectionLevels.edit.default')
end
end
return self:_substituteParameters(msg)
return self:_substituteParameters(msg)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.