Module:Protection banner: Difference between revisions

use new cfg format
(some cleanup)
(use new cfg format)
Line 98:
-- Set expiry
if args.expiry then
if configObj.cfg.indefStrings[args.expiry] then
self.expiry = 'indef'
elseif type(args.expiry) == 'number' then
Line 121:
do
self.bannerConfig = {}
local cfg = configObj.cfg
local configTables = {}
if cfg.banners[self.action] then
Line 167:
do
local namespace = titleObj.namespace
local categoryNamespaces = configObj.cfg.categoryNamespaceKeys
nskey = categoryNamespaces[namespace]
if not nskey and namespace % 2 == 1 then
Line 202:
local configOrder = {}
do
local reasonsWithNamespacePriority = configObj.cfg.reasonsWithNamespacePriority
local namespaceFirst = reason and reasonsWithNamespacePriority[reason] or false
for propertiesKey, t in pairs(properties) do
Line 271:
-- pos field in the property table.
--]]
local cats = configObj.cfg.protectionCategories
local cat
for i = 1, 2^noActive do
Line 300:
 
function Protection:makeExpiryCategory()
local reasonsWithoutExpiryCheck = self._configObj.cfg.reasonsWithoutExpiryCheck
local expiryCheckActions = self._configObj.cfg.expiryCheckActions
local cat
Line 554:
 
function Blurb:_makeImageLinkParameter()
local imageLinks = self._configObj.cfg.imageLinks
local action = self._protectionObj.action
local level = self._protectionObj.level
Line 587:
 
function Blurb:_makePagetypeParameter()
local pagetypes = self._configObj.cfg.pagetypes
local namespace = self._titleObj.namespace
return pagetypes[namespace] or pagetypes.default or error('no default pagetype defined')
Line 593:
 
function Blurb:_makeProtectionBlurbParameter()
local protectionBlurbs = self._configObj.cfg.protectionBlurbs
local action = self._protectionObj.action
local level = self._protectionObj.level
Line 619:
 
function Blurb:_makeProtectionLevelParameter()
local protectionLevels = self._configObj.cfg.protectionLevels
local action = self._protectionObj.action
local level = self._protectionObj.level
Line 767:
 
-- Deal with regular protection types.
local images = self._configObj.cfg.images
if images[action] then
if images[action][level] then
Anonymous user