Module:Protection banner: Difference between revisions
Content added Content deleted
Enwikipedia>Jackmcbarn (try to merge the edit conflict, one variable at a time, starting with action) |
Enwikipedia>Jackmcbarn (now level) |
||
Line 47: | Line 47: | ||
level = '*' |
level = '*' |
||
end |
end |
||
self. |
self.level = level or '*' |
||
end |
end |
||
Line 106: | Line 106: | ||
end |
end |
||
if cfg.defaultBanners[self.action] then |
if cfg.defaultBanners[self.action] then |
||
configTables[#configTables + 1] = cfg.defaultBanners[self.action][self. |
configTables[#configTables + 1] = cfg.defaultBanners[self.action][self.level] |
||
configTables[#configTables + 1] = cfg.defaultBanners[self.action].default |
configTables[#configTables + 1] = cfg.defaultBanners[self.action].default |
||
end |
end |
||
Line 122: | Line 122: | ||
function Protection:isProtected() |
function Protection:isProtected() |
||
return self. |
return self.level ~= '*' |
||
end |
end |
||
Line 268: | Line 268: | ||
local mEditRequest = require('Module:Submit an edit request') |
local mEditRequest = require('Module:Submit an edit request') |
||
local action = self._protectionObj.action |
local action = self._protectionObj.action |
||
local level = self._protectionObj |
local level = self._protectionObj.level |
||
-- Get the display message key. |
-- Get the display message key. |
||
Line 307: | Line 307: | ||
function Blurb:_makeExplanationBlurbParameter() |
function Blurb:_makeExplanationBlurbParameter() |
||
local action = self._protectionObj.action |
local action = self._protectionObj.action |
||
local level = self._protectionObj |
local level = self._protectionObj.level |
||
local namespace = self._titleObj.namespace |
local namespace = self._titleObj.namespace |
||
local isTalk = self._titleObj.isTalkPage |
local isTalk = self._titleObj.isTalkPage |
||
Line 340: | Line 340: | ||
local imageLinks = self._configObj.cfg.imageLinks |
local imageLinks = self._configObj.cfg.imageLinks |
||
local action = self._protectionObj.action |
local action = self._protectionObj.action |
||
local level = self._protectionObj |
local level = self._protectionObj.level |
||
local msg |
local msg |
||
if imageLinks[action][level] then |
if imageLinks[action][level] then |
||
Line 379: | Line 379: | ||
local protectionBlurbs = self._configObj.cfg.protectionBlurbs |
local protectionBlurbs = self._configObj.cfg.protectionBlurbs |
||
local action = self._protectionObj.action |
local action = self._protectionObj.action |
||
local level = self._protectionObj |
local level = self._protectionObj.level |
||
local msg |
local msg |
||
if protectionBlurbs[action][level] then |
if protectionBlurbs[action][level] then |
||
Line 405: | Line 405: | ||
local protectionLevels = self._configObj.cfg.protectionLevels |
local protectionLevels = self._configObj.cfg.protectionLevels |
||
local action = self._protectionObj.action |
local action = self._protectionObj.action |
||
local level = self._protectionObj |
local level = self._protectionObj.level |
||
local msg |
local msg |
||
if protectionLevels[action][level] then |
if protectionLevels[action][level] then |
||
Line 534: | Line 534: | ||
local action = protectionObj.action |
local action = protectionObj.action |
||
local level = protectionObj |
local level = protectionObj.level |
||
local expiry = protectionObj:getExpiry() |
local expiry = protectionObj:getExpiry() |
||
local namespace = titleObj.namespace |
local namespace = titleObj.namespace |
||
Line 730: | Line 730: | ||
local reason = protectionObj:getReason() |
local reason = protectionObj:getReason() |
||
local action = protectionObj.action |
local action = protectionObj.action |
||
local level = protectionObj |
local level = protectionObj.level |
||
--[[ |
--[[ |
||
Line 892: | Line 892: | ||
local expiry = protectionObj:getExpiry() |
local expiry = protectionObj:getExpiry() |
||
local action = protectionObj.action |
local action = protectionObj.action |
||
local level = protectionObj |
local level = protectionObj.level |
||
if not protectionObj:isProtected() |
if not protectionObj:isProtected() |
||
Line 919: | Line 919: | ||
local action = protectionObj.action |
local action = protectionObj.action |
||
local level = protectionObj |
local level = protectionObj.level |
||
local namespace = titleObj.namespace |
local namespace = titleObj.namespace |
||