Changes

Jump to navigation Jump to search

Module:Protection banner

209 bytes added, 06:53, 23 June 2014
allow specifying banner config by protection level as well as by action
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 cfg = self._cfg
local action = protectionStatusObj:getAction()
local level = protectionStatusObj:getLevel()
local reason = protectionStatusObj:getReason()
local fields = {
'text',
}
local configTables = {}
if cfg.banners[action] then configTables[#configTables + 1] = cfg.banners[action][reason] 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
Anonymous user

Navigation menu