Module:Lua banner: Difference between revisions

No edit summary
Tag: Reverted
No edit summary
 
(One intermediate revision by the same user not shown)
Line 52: Line 52:
boxArgs.type = 'notice'
boxArgs.type = 'notice'
boxArgs.small = true
boxArgs.small = true
boxArgs.image = '[[File:Lua-Logo.svg|30px|alt=|link=]]'
boxArgs.image = '[[File:Lua-Logo.png|30px|alt=|link=]]'
return mMessageBox.main('mbox', boxArgs)
return mMessageBox.main('mbox', boxArgs)
end
end
Line 111: Line 111:
if module ~= "CP:libraryUtil" then
if module ~= "CP:libraryUtil" then
local moduleTitle = mw.title.new(module)
local moduleTitle = mw.title.new(module)
local editProtection = moduleTitle and moduleTitle.protectionLevels and moduleTitle.protectionLevels["edit"]
local moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1]
local moduleProt = editProtection and editProtection[1]
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
if moduleProt == nil then
moduleProt = 0
else
moduleProt = protLevels[moduleProt] or 0
end
if moduleProt < currentProt then
if moduleProt < currentProt then
cats[#cats + 1] = protCatName
cats[#cats + 1] = protCatName
Line 123: Line 118:
end
end
end
end
end
end
end
end