Module:Lua banner: Difference between revisions
Abhishek.it (talk | contribs) No edit summary Tag: Reverted |
Abhishek.it (talk | contribs) 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 [[ | 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. | 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 ~= " | if module ~= "WP:libraryUtil" then | ||
local moduleTitle = mw.title.new(module) | local moduleTitle = mw.title.new(module) | ||
local | local moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1] | ||
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end | |||
if moduleProt == nil then | |||
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 | ||