|
|
Line 413: |
Line 413: |
| return '<div class="' .. message('clear') .. '"></div>' | | return '<div class="' .. message('clear') .. '"></div>' |
| .. require('Module:Message box').main('ombox', omargs) | | .. require('Module:Message box').main('ombox', omargs) |
| end
| |
|
| |
| function p.protectionTemplate(env)
| |
| -- Generates the padlock icon in the top right.
| |
| -- @env - environment table containing title objects, etc., generated with p.getEnvironment
| |
| -- Messages:
| |
| -- 'protection-template' --> 'pp-template'
| |
| -- 'protection-template-args' --> {docusage = 'yes'}
| |
| local protectionLevels = env.protectionLevels
| |
| if not protectionLevels then
| |
| return nil
| |
| end
| |
| local editProt = protectionLevels.edit and protectionLevels.edit[1]
| |
| local moveProt = protectionLevels.move and protectionLevels.move[1]
| |
| if editProt then
| |
| -- The page is edit-protected.
| |
| return require('Module:Protection banner')._main{
| |
| message('protection-reason-edit'), small = true
| |
| }
| |
| elseif moveProt and moveProt ~= 'autoconfirmed' then
| |
| -- The page is move-protected but not edit-protected. Exclude move
| |
| -- protection with the level "autoconfirmed", as this is equivalent to
| |
| -- no move protection at all.
| |
| return require('Module:Protection banner')._main{
| |
| action = 'move', small = true
| |
| }
| |
| else
| |
| return nil
| |
| end
| |
| end | | end |
|
| |
|