此模块的文档可以在模块:设定页v2/doc创建
local SMWUtils = require("Module:SMWUtils") local PageName = require("Module:PageName") local p = {} function renderMaintainers(frame, maintainers, other_creators) local node = mw.html.create(nil) local content = "" content = content .. "创作者: " for i, m in ipairs(maintainers) do content = content .. "[[User:"..m.."|"..m.."]]" content = content .. "[[Category:由"..m.."维护的条目]]" content = content .. "[[Category:由"..m.."创作的条目]]" mw.smw.set({ ['Editable by user'] = 'User:'..m }) end for i, m in ipairs(other_creators) do content = content .. "[[创作者:"..m.."|"..m.."]]" content = content .. "[[Category:由"..m.."创作的条目]]" end local args = {image = 'Copyright.svg', content = content} return frame:expandTemplate{title = "LiteInfoBox", args = args} end function renderLockedPage(frame) mw.smw.set({ ['Editable by'] = 'whitelist' }) return frame:expandTemplate{title = "本页面仅允许维护者编辑", args = {}} end function p.renderCreator(frame) local title = PageName.getPageName() local prop_names = {"维护者", "创作者", "设定类型", "设定集核心页", "依赖设定集", "仅允许维护者编辑", "创作阶段", "上级概念", "前置条件", "事后效果"} local props = SMWUtils.query_page_properties("[["..title.."]]", prop_names)[1]["properties"] local root = mw.html.create(nil) local maintainerTemp = renderMaintainers(frame, props["维护者"], props["创作者"]) root:wikitext(maintainerTemp) if props["仅允许维护者编辑"][1] == "t" then renderLockedPage(frame) end return root:done() end return p