Changes

Jump to navigation Jump to search

Module:Documentation

71 bytes removed, 04:05, 13 March 2014
use title.protectionLevels instead of {{PROTECTIONLEVEL}} in p.protectionTemplate
--
-- Data includes:
-- env.protectionLevels - the protection levels table of the title object.
-- env.subjectSpace - the number of the title's subject namespace.
-- env.docSpace - the number of the namespace the title puts its documentation in.
--]]
return env.templateTitle:subPageTitle(message('print-subpage'))
end
 
function envFuncs.protectionLevels()
-- The protection levels table of the title object.
return env.title.protectionLevels
end
-- 'protection-template-args' --> {docusage = 'yes'}
local title = env.title
local protectionLevels
local protectionTemplate = message('protection-template')
local namespace = title.namespace
return nil
end
local frame protectionLevels = mwenv.getCurrentFrame()protectionLevels local function getProtectionLevel(protectionType, page) -- Gets the protection level for page, or for the current page if page is not specified. local level editLevels = frame:callParserFunction('PROTECTIONLEVEL', protectionType, page) if level ~= '' then return level else return nil -- The parser function returns the blank string if there is no matchprotectionLevels. end endedit local prefixedTitle moveLevels = titleprotectionLevels.prefixedTextmove if getProtectionLevel('move', prefixedTitle) moveLevels and moveLevels[1] == 'sysop' or getProtectionLevel('edit', prefixedTitle) editLevels and editLevels[1] then
-- 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
return nil
end
return nil
end
Anonymous user

Navigation menu