Module:Protected edit request/active: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
m lost a newline somehow
Jackmcbarn (talk | contribs)
m fix indentation
Line 468:
 
function box.new(protectionType, args)
-- In the inheritance system used here, an object's metatable is its class, and a class's metatable is its superclass
local obj = getmetatable(box).new(protectionType, args)
setmetatable(obj, box)
local boxProtectionLevels = {semi = 'autoconfirmed', template = 'templateeditor', full = 'sysop'}
obj.boxProtectionLevel = boxProtectionLevels[protectionType]
obj.demo = yesno(args.demo)
-- Set dependent objects.
obj.titles = titleTable.new(args)
if not yesno(args.force) and obj.titles:hasSameProperty('sameProtectionStatus', function (title) return title.protectionLevel end) and obj.titles[1].protectionLevel ~= 'unprotected' then
obj.boxProtectionLevel = obj.titles[1].protectionLevel
end
obj.blurb = blurb.new(obj.titles, obj.boxProtectionLevel)
obj.makeMessageBox = makeMessageBox
return obj
end
obj.blurb = blurb.new(obj.titles, obj.boxProtectionLevel)
obj.makeMessageBox = makeMessageBox
return obj
end
 
function box:setImage()