Difference between revisions of "Module:NAMESPACEID"

From Wiki.Agency
Jump to: navigation, search
m (Protected Module:NAMESPACEID: High-risk Lua module: used in Template:Editnotice load/core to display edit notices ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
m (1 revision imported)
 
(No difference)

Latest revision as of 22:40, 24 October 2018

Documentation for this module may be created at Module:NAMESPACEID/doc

-- This module implements {{NAMESPACEID}}.

local p = {}

function p.main(frame)
	local ns = frame:getParent().args[1] or mw.title.getCurrentTitle().namespace
	local nsTable = mw.site.namespaces[ns]
	if nsTable then
		return nsTable.id
	else
		return '<strong class="error">Invalid namespace in ' ..
		'&#123;&#123;[[Template:NAMESPACEID|NAMESPACEID]]&#125;&#125;</strong>'
	end
end

return p