62
edits
(Reverted to revision 18002 by Mr. Stradivarius (talk): Test. (TW)) |
|||
Line 170: | Line 170: | ||
-- | -- | ||
-- Data includes: | -- Data includes: | ||
-- env.protectionLevels - the protection levels table of the title object. | |||
-- env.subjectSpace - the number of the title's subject namespace. | -- env.subjectSpace - the number of the title's subject namespace. | ||
-- env.docSpace - the number of the namespace the title puts its documentation in. | -- env.docSpace - the number of the namespace the title puts its documentation in. | ||
Line 269: | Line 270: | ||
--]] | --]] | ||
return env.templateTitle:subPageTitle(message('print-subpage')) | return env.templateTitle:subPageTitle(message('print-subpage')) | ||
end | |||
function envFuncs.protectionLevels() | |||
-- The protection levels table of the title object. | |||
return env.title.protectionLevels | |||
end | end | ||
Line 381: | Line 387: | ||
text = text .. makeCategoryLink(message('sandbox-category')) | text = text .. makeCategoryLink(message('sandbox-category')) | ||
omargs.text = text | omargs.text = text | ||
local ret = '<div style="clear: both;"></div>' | |||
ret = ret .. messageBox.main('ombox', omargs) | |||
return ret | |||
end | end | ||
Line 391: | Line 399: | ||
-- '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 protectionTemplate = message('protection-template') | ||
local namespace = title.namespace | local namespace = title.namespace | ||
Line 397: | Line 406: | ||
return nil | return nil | ||
end | end | ||
protectionLevels = env.protectionLevels | |||
local | local editLevels = protectionLevels.edit | ||
local moveLevels = protectionLevels.move | |||
if moveLevels and moveLevels[1] == 'sysop' or editLevels and editLevels[1] then | |||
local | |||
if | |||
-- The page is full-move protected, or full, template, or semi-protected. | -- 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')} | return frame:expandTemplate{title = protectionTemplate, args = message('protection-template-args', nil, 'table')} | ||
else | |||
return nil | |||
end | end | ||
end | end | ||
Line 635: | Line 638: | ||
if not content and docTitle and docTitle.exists then | if not content and docTitle and docTitle.exists then | ||
local frame = mw.getCurrentFrame() | local frame = mw.getCurrentFrame() | ||
content = frame: | content = frame:expandTemplate{title = docTitle.prefixedText} | ||
end | end | ||
-- The line breaks below are necessary so that "=== Headings ===" at the start and end | -- The line breaks below are necessary so that "=== Headings ===" at the start and end |