Difference between revisions 51837 and 51838 on wikimaniawiki

-- This module implements {{documentation}}.

-- Get required modules.
local getArgs = require('Module:Arguments').getArgs
local htmlBuilder = require('Module:HtmlBuilder')
local messageBox = require('Module:Message box')

-- Get the config table.
(contracted; show full)	-- 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 title = env.title
	local protectionTemplate = message('protection-template')

	local namespace = title.namespace
	if not (protectionTemplate and title.(namespace == 10 or namespace == 828)) then
		-- Don't display the protection template if we are not in the template or module namespaces.
		return nil
	end
	local frame = mw.getCurrentFrame()
	local function getProtectionLevel(protectionType, page)
		-- Gets the protection level for page, or for the current page if page is not specified.
		local level = frame:callParserFunction('PROTECTIONLEVEL', protectionType, page)
		if level ~= '' then
(contracted; show full)	if message('display-strange-usage-category', nil, 'boolean') and (subpage == message('doc-subpage') or subpage == message('testcases-subpage')) then
		local sort = (title.namespace == 0 and message('strange-usage-category-mainspace-sort') or '') .. title.prefixedText -- Sort on namespace.
		ret = ret .. makeCategoryLink(message('strange-usage-category'), sort)
	end
	return ret
end

return p