Module:Documentation: Difference between revisions
Testing
No edit summary |
(Testing) |
||
Line 405: | Line 405: | ||
-- 'protection-template' --> 'pp-template' | -- 'protection-template' --> 'pp-template' | ||
-- 'protection-template-args' --> {docusage = 'yes'} | -- 'protection-template-args' --> {docusage = 'yes'} | ||
local title = env.title | local title = env.title | ||
local protectionLevels | |||
local protectionTemplate = message('protection-template') | |||
local namespace = title.namespace | |||
if not (protectionTemplate and (namespace == 10 or namespace == 828)) then | |||
-- Don't display the protection template if we are not in the template or module namespaces. | -- Don't display the protection template if we are not in the template or module namespaces. | ||
return nil | return nil | ||
Line 415: | Line 417: | ||
return nil | return nil | ||
end | end | ||
local | local editLevels = protectionLevels.edit | ||
local | local moveLevels = protectionLevels.move | ||
if moveLevels and moveLevels[1] == 'sysop' or editLevels and editLevels[1] then | |||
-- The page is | -- The page is full-move protected, or full, template, or semi-protected. | ||
local frame = mw.getCurrentFrame() | |||
return frame:expandTemplate{title = protectionTemplate, args = message('protection-template-args', nil, 'table')} | |||
else | else | ||
return nil | return nil |