Changes

Jump to navigation Jump to search

Module:Protection banner

479 bytes added, 05:39, 12 March 2014
add a p.getPagetype function
}
local nskeys categoryNamespaces = {
[2] = 'user',
[3] = 'user',
sock = 'reasonFirst',
office = 'reasonFirst',
}
 
local pagetypeNamespaces = {
[0] = 'article',
[6] = 'file',
[10] = 'template',
[14] = 'category',
[828] = 'module',
default = 'page'
}
local p = {}
 
function p.getPagetype(ns)
-- Returns a string with the page's type. Takes a namespace number as input.
local pagetype = pagetypeNamespaces[ns] or pagetypeNamespaces.default
if not pagetype then
error('the page type could not be found; please define a name for the key "default"')
end
return pagetype
end
function p.matchNamespace(ns)
return nil
end
local nskey = nskeyscategoryNamespaces[ns]
if not nskey and ns % 2 == 1 then
nskey = 'talk'
Anonymous user

Navigation menu