Module:Protection banner: Difference between revisions

fix category name function comments
(make the category attempt order more configurable)
(fix category name function comments)
Line 195:
 
--[[
-- Define the initialproperties ordertable. toEach testproperty propertiesis in.a Thetable subtablecontaining positionthe
-- is thecanonical order that the propertiesproperty will beis tested in, and the keyposposition value inthe
-- eachproperty subtablehas isin the positioncategory ofkey thestrings, value inand the categoryproperty keyvalue itself.
--]]
local properties = {
Line 208:
 
--[[
-- Load the category order configuration for the reason specified.
-- Validate reason, and if it is specified as a "namespaceFirst" reason,
-- The configuration is stored in the categoryOrder field of each reason
-- move the namespace subtable to the end of the properties table.
-- subtable of cfg.reasons. If the value is a table, then the order is the
-- This is necessary to accommodate reasons like "vandalism", as the old
-- values specified in the table. If the value is a string, then the
-- {{pp-vandalism}} template used namespace categories rather than
-- property corresponding to that string is tested last (i.e. it is the most
-- vandalism categories if they were available.
-- important, because it keeps its specified value the longest) and the
-- other properties are tested in the canonical order. If the value is of
-- any other type then the canonical order is used.
--]]
local reasonTable = reason and cfg.reasons[reason]
local categoryOrder = reasonTable and reasonTable.categoryOrder
local categoryOrderType = type(categoryOrder)