Module:Lua banner: Difference between revisions

No edit summary
Tag: Reverted
m Reverted edits by Abhishek.it (talk) to last revision by Shia.k
Tag: Rollback
Line 47: Line 47:
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
else
boxArgs.text = 'This template  uses [[Chabadpedia:Lua|Lua]]:\n' .. moduleList
boxArgs.text = 'This template  uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
end
end
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 109: Line 109:
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
for i, module in ipairs(modules) do
if module ~= "CP:libraryUtil" then
if module ~= "WP: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