Module:Protection banner: Difference between revisions

m
1 revision imported: Import "Information Appliance" infobox template
(add catonly param which hides both the banner and padlock if set to yes. all testcases pass. tested in sandbox.)
m (1 revision imported: Import "Information Appliance" infobox template)
Line 146:
obj.protectionDate = validateDate(args.date, 'protection date')
end
 
-- Set banner config
do
Line 202:
local cfg = self._cfg
local title = self.title
 
-- Get the expiry key fragment.
local expiryFragment
Line 240:
--]]
table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
 
--[[
-- Define the attempt order. Inactive subtables (subtables with nil "value"
Line 265:
end
end
 
--[[
-- Check increasingly generic key combinations until we find a match. If a
Line 278:
-- would look like this, with 0 corresponding to the key fragment "all", and
-- 1 corresponding to other key fragments.
--
-- j 1 2 3
-- i
-- 1 1 1 1
-- 2 0 1 1
Line 289:
-- 7 1 0 0
-- 8 0 0 0
--
-- Values of j higher than the number of active subtables are set
-- to the string "all".
Line 418:
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
parameterFuncs.VANDAL = self._makeVandalTemplateParameter
 
self._params = setmetatable({}, {
__index = function (t, k)
Line 431:
})
end
 
msg = msg:gsub('${(%u+)}', self._params)
return msg
Line 461:
local action = self._protectionObj.action
local level = self._protectionObj.level
 
-- Get the edit request type.
local requestType
Line 474:
end
requestType = requestType or 'full'
 
-- Get the display value.
local display = self:_getExpandedMessage('edit-request-display')
Line 709:
local namespace = protectionObj.title.namespace
local reason = protectionObj.reason
 
-- Deal with special cases first.
if (
Line 852:
-- Initialise the blurb object
local blurbObj = Blurb.new(protectionObj, args, cfg)
 
-- Render the banner
if protectionObj:shouldShowLock() then
Line 866:
ret[#ret + 1] = protectionObj:makeCategoryLinks()
end
 
return table.concat(ret)
end