Module:Protection banner: Difference between revisions

Content added Content deleted
Enwikipedia>Jackmcbarn
(now level)
Enwikipedia>Jackmcbarn
(now reason)
Line 82: Line 82:
local reason = args.reason or args[1]
local reason = args.reason or args[1]
if reason then
if reason then
self._reason = reason:lower()
self.reason = reason:lower()
end
end
end
end
Line 103: Line 103:
local configTables = {}
local configTables = {}
if cfg.banners[self.action] then
if cfg.banners[self.action] then
configTables[#configTables + 1] = cfg.banners[self.action][self._reason]
configTables[#configTables + 1] = cfg.banners[self.action][self.reason]
end
end
if cfg.defaultBanners[self.action] then
if cfg.defaultBanners[self.action] then
Line 728: Line 728:


-- Get the other inputs.
-- Get the other inputs.
local reason = protectionObj:getReason()
local reason = protectionObj.reason
local action = protectionObj.action
local action = protectionObj.action
local level = protectionObj.level
local level = protectionObj.level
Line 868: Line 868:
local expiry = protectionObj:getExpiry()
local expiry = protectionObj:getExpiry()
local action = protectionObj.action
local action = protectionObj.action
local reason = protectionObj:getReason()
local reason = protectionObj.reason
if not expiry
if not expiry