Anonymous user
Module:Protection banner: Difference between revisions
allow specifying banner config by protection level as well as by action
(add a blurb parameter function for making the explanation text) |
(allow specifying banner config by protection level as well as by action) |
||
Line 85:
function Config:getBannerConfig(protectionStatusObj)
local cfg = self._cfg▼
local action = protectionStatusObj:getAction()▼
local reason = protectionStatusObj:getReason()▼
if self._bannerConfigTables[protectionStatusObj] then
return self._bannerConfigTables[protectionStatusObj]
else
local ret = {}
local level = protectionStatusObj:getLevel()
local fields = {
'text',
Line 103:
}
local configTables = {}
configTables[#configTables + 1] = cfg.
end
if cfg.defaultBanners[action] then
configTables[#configTables + 1] = cfg.defaultBanners[action][level]
configTables[#configTables + 1] = cfg.defaultBanners[action].default
end
for i, field in ipairs(fields) do
for j, t in ipairs(configTables) do
|