<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.caricature.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtected_edit_request%2Factive</id>
	<title>Module:Protected edit request/active - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.caricature.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtected_edit_request%2Factive"/>
	<link rel="alternate" type="text/html" href="http://wiki.caricature.org/wiki/index.php?title=Module:Protected_edit_request/active&amp;action=history"/>
	<updated>2026-05-10T04:06:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>http://wiki.caricature.org/wiki/index.php?title=Module:Protected_edit_request/active&amp;diff=2131&amp;oldid=prev</id>
		<title>TheChairman: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.caricature.org/wiki/index.php?title=Module:Protected_edit_request/active&amp;diff=2131&amp;oldid=prev"/>
		<updated>2020-05-16T20:37:24Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 20:37, 16 May 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>TheChairman</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.caricature.org/wiki/index.php?title=Module:Protected_edit_request/active&amp;diff=2130&amp;oldid=prev</id>
		<title>en&gt;Anarchyte: Removed protection from &quot;Module:Protected edit request/active&quot;: usefulness disputed</title>
		<link rel="alternate" type="text/html" href="http://wiki.caricature.org/wiki/index.php?title=Module:Protected_edit_request/active&amp;diff=2130&amp;oldid=prev"/>
		<updated>2019-03-02T02:14:33Z</updated>

		<summary type="html">&lt;p&gt;Removed protection from &amp;quot;&lt;a href=&quot;/wiki/index.php/Module:Protected_edit_request/active&quot; title=&quot;Module:Protected edit request/active&quot;&gt;Module:Protected edit request/active&lt;/a&gt;&amp;quot;: &lt;a href=&quot;/wiki/index.php/Special:PermanentLink/885654787&quot; title=&quot;Special:PermanentLink/885654787&quot;&gt;usefulness disputed&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('Module:No globals')&lt;br /&gt;
&lt;br /&gt;
local yesno, makeMessageBox -- passed in from Module:Protected edit request&lt;br /&gt;
local makeToolbar = require('Module:Toolbar')._main&lt;br /&gt;
local getPagetype = require('Module:Pagetype')._main&lt;br /&gt;
local effectiveProtectionLevel = require('Module:Effective protection level')._main&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeWikilink(page, display)&lt;br /&gt;
	if display then&lt;br /&gt;
		return mw.ustring.format('[[%s|%s]]', page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format('[[%s]]', page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
-- Title class&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This is basically the mw.title class with some extras thrown in.&lt;br /&gt;
&lt;br /&gt;
local title = {}&lt;br /&gt;
title.__index = title&lt;br /&gt;
&lt;br /&gt;
function title.getProtectionLevelText(protectionLevel)&lt;br /&gt;
	-- Gets the text to use in anchors and urn links.&lt;br /&gt;
	local levels = {unprotected = 'editunprotected', autoconfirmed = 'editsemiprotected', extendedconfirmed = 'editextendedprotected', templateeditor = 'edittemplateprotected', sysop = 'editprotected', interfaceadmin = 'editinterfaceprotected'}&lt;br /&gt;
	return levels[protectionLevel]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function title.new(...)&lt;br /&gt;
	local success, obj = pcall(mw.title.new, ...)&lt;br /&gt;
	if not (success and obj) then return end&lt;br /&gt;
&lt;br /&gt;
	-- Add a protectionLevel property.&lt;br /&gt;
	obj.protectionLevel = effectiveProtectionLevel(obj.exists and 'edit' or 'create', obj)&lt;br /&gt;
	if obj.protectionLevel == '*' then&lt;br /&gt;
		-- Make unprotected pages return &amp;quot;unprotected&amp;quot;.&lt;br /&gt;
		obj.protectionLevel = 'unprotected'&lt;br /&gt;
	elseif obj.protectionLevel == 'user' then&lt;br /&gt;
		-- If we just need to be registered, pretend we need to be autoconfirmed, since it's the closest thing we have.&lt;br /&gt;
		obj.protectionLevel = 'autoconfirmed'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add a pagetype property.&lt;br /&gt;
	obj.pagetype = getPagetype{page = obj.prefixedText, defaultns = 'all'}&lt;br /&gt;
	&lt;br /&gt;
	-- Add link-making methods.&lt;br /&gt;
	function obj:makeUrlLink(query, display)&lt;br /&gt;
		return mw.ustring.format('[%s %s]', self:fullUrl(query), display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeViewLink(display)&lt;br /&gt;
		return self:makeUrlLink({redirect = 'no'}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeEditLink(display)&lt;br /&gt;
		return self:makeUrlLink({action = 'edit'}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeHistoryLink(display)&lt;br /&gt;
		return self:makeUrlLink({action = 'history'}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeLastEditLink(display)&lt;br /&gt;
		return self:makeUrlLink({diff = 'cur', oldid = 'prev'}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeWhatLinksHereLink(display)&lt;br /&gt;
		return makeWikilink('Special:WhatLinksHere/' .. self.prefixedText, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeCompareLink(otherTitle, display)&lt;br /&gt;
		display = display or 'diff'&lt;br /&gt;
		local comparePagesTitle = title.new('Special:ComparePages')&lt;br /&gt;
		return comparePagesTitle:makeUrlLink({page1 = self.prefixedText, page2 = otherTitle.prefixedText}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeLogLink(logType, display)&lt;br /&gt;
		local logTitle = title.new('Special:Log')&lt;br /&gt;
		return logTitle:makeUrlLink({type = logType, page = self.prefixedText}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:urlEncode()&lt;br /&gt;
		return mw.uri.encode(self.prefixedText, 'WIKI')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeUrnLink(boxProtectionLevel)&lt;br /&gt;
		-- Outputs a urn link. The protection level is taken from the template, rather than detected from page itself,&lt;br /&gt;
		-- as the detection may be inaccurate for cascade-protected and title-blacklisted pages as of Nov 2013.&lt;br /&gt;
		local protectionLinkText = title.getProtectionLevelText(boxProtectionLevel)&lt;br /&gt;
		return mw.ustring.format('[urn:x-wp-%s:%s &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;]', protectionLinkText, self:urlEncode())&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get a subpage title object, but go through pcall rather than use the unprotected mw.title:subPageTitle.&lt;br /&gt;
	function obj:getSubpageTitle(subpage)&lt;br /&gt;
		return title.new(self.prefixedText .. '/' .. subpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
-- TitleTable class&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local titleTable = {}&lt;br /&gt;
titleTable.__index = titleTable&lt;br /&gt;
&lt;br /&gt;
function titleTable.new(args)&lt;br /&gt;
	-- Get numerical arguments and make title objects for each of them. &lt;br /&gt;
	local nums = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == 'number' then&lt;br /&gt;
			table.insert(nums, k)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(nums)&lt;br /&gt;
	local titles = {}&lt;br /&gt;
	for _, num in ipairs(nums) do&lt;br /&gt;
		local title = title.new(args[num])&lt;br /&gt;
		table.insert(titles, title)&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the current title, and get the subject title if no titles were specified.&lt;br /&gt;
	titles.currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if #titles &amp;lt; 1 then&lt;br /&gt;
		local subjectNs = titles.currentTitle.subjectNsText&lt;br /&gt;
		if subjectNs ~= '' then&lt;br /&gt;
			subjectNs = subjectNs .. ':'&lt;br /&gt;
		end&lt;br /&gt;
		table.insert(titles, title.new(subjectNs .. titles.currentTitle.text))&lt;br /&gt;
	end&lt;br /&gt;
	-- Set the metatable.&lt;br /&gt;
	setmetatable(titles, titleTable)&lt;br /&gt;
	return titles&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:memoize(memoField, func, ...)&lt;br /&gt;
	if self[memoField] ~= nil then&lt;br /&gt;
		return self[memoField]&lt;br /&gt;
	else&lt;br /&gt;
		self[memoField] = func(...)&lt;br /&gt;
		return self[memoField]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:titleIterator()&lt;br /&gt;
	local i = 0&lt;br /&gt;
	local n = #self&lt;br /&gt;
	return function()&lt;br /&gt;
		i = i + 1&lt;br /&gt;
		if i &amp;lt;= n then&lt;br /&gt;
			return self[i]&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasSameProperty(memoField, getPropertyFunc)&lt;br /&gt;
	-- If the titles table has more than one title in it, check if they have the same property.&lt;br /&gt;
	-- The property is found using the getPropertyFunc function, which takes a title object as its single argument.&lt;br /&gt;
	&lt;br /&gt;
	local function hasSameProperty(getPropertyFunc)&lt;br /&gt;
		local property&lt;br /&gt;
		for i, obj in ipairs(self) do&lt;br /&gt;
			if i == 1 then&lt;br /&gt;
				property = getPropertyFunc(obj)&lt;br /&gt;
			elseif getPropertyFunc(obj) ~= property then&lt;br /&gt;
				return false&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return self:memoize(memoField, hasSameProperty, getPropertyFunc)&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasSameExistenceStatus()&lt;br /&gt;
	-- Returns true if all the titles exist, or if they all don't exist. Returns false if there is a mixture of existence statuses.&lt;br /&gt;
	return self:hasSameProperty('sameExistenceStatus', function (title) return title.exists end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasSameProtectionStatus()&lt;br /&gt;
	-- Checks if all the titles have the same protection status (either for creation protection or for edit-protection - the two are not mixed).&lt;br /&gt;
	local sameExistenceStatus = self:hasSameExistenceStatus()&lt;br /&gt;
	if sameExistenceStatus then&lt;br /&gt;
		return self:hasSameProperty('sameProtectionStatus', function (title) return title.protectionLevel end)&lt;br /&gt;
	else&lt;br /&gt;
		return sameExistenceStatus&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasSamePagetype()&lt;br /&gt;
	-- Checks if all the titles have the same pagetype.&lt;br /&gt;
	return self:hasSameProperty('samePagetype', function (title) return title.pagetype end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:propertyExists(memoField, getPropertyFunc)&lt;br /&gt;
	-- Checks if a title with a certain property exists.&lt;br /&gt;
	-- The property is found using the getPropertyFunc function, which takes a title object as its single argument&lt;br /&gt;
	-- and should return a boolean value.&lt;br /&gt;
	local function propertyExists(getPropertyFunc)&lt;br /&gt;
		for titleObj in self:titleIterator() do&lt;br /&gt;
			if getPropertyFunc(titleObj) then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return self:memoize(memoField, propertyExists, getPropertyFunc)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasNonInterfacePage()&lt;br /&gt;
	return self:propertyExists('nonInterfacePage', function (titleObj) return titleObj.namespace ~= 8 end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasTemplateOrModule()&lt;br /&gt;
	return self:propertyExists('templateOrModule', function (titleObj) return titleObj.namespace == 10 or titleObj.namespace == 828 end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasNonTemplateOrModule()&lt;br /&gt;
	return self:propertyExists('nontemplateormodule', function (titleobj) return titleobj.namespace ~= 10 and titleobj.namespace ~= 828 end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:hasOtherProtectionLevel(level)&lt;br /&gt;
	for titleObj in self:titleIterator() do&lt;br /&gt;
		if titleObj.protectionLevel ~= level then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function titleTable:getProtectionLevels()&lt;br /&gt;
	local function getProtectionLevels()&lt;br /&gt;
		local levels = {}&lt;br /&gt;
		for titleObj in self:titleIterator() do&lt;br /&gt;
			local level = titleObj.protectionLevel&lt;br /&gt;
			levels[level] = true&lt;br /&gt;
		end&lt;br /&gt;
		return levels&lt;br /&gt;
	end&lt;br /&gt;
	return self:memoize('protectionLevels', getProtectionLevels)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
-- Blurb class definition&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local blurb = {}&lt;br /&gt;
blurb.__index = blurb&lt;br /&gt;
&lt;br /&gt;
function blurb.new(titleTable, boxProtectionLevel)&lt;br /&gt;
	local obj = {}&lt;br /&gt;
	obj.titles = titleTable&lt;br /&gt;
	obj.boxProtectionLevel = boxProtectionLevel&lt;br /&gt;
	obj.linkCount = 0 -- Counter for the number of total items in the object's link lists. &lt;br /&gt;
	setmetatable(obj, blurb)&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Static methods --&lt;br /&gt;
&lt;br /&gt;
function blurb.makeParaText(name, val)&lt;br /&gt;
	local pipe = mw.text.nowiki('|')&lt;br /&gt;
	local equals = mw.text.nowiki('=')&lt;br /&gt;
	val = val and (&amp;quot;''&amp;quot; .. val .. &amp;quot;''&amp;quot;) or ''&lt;br /&gt;
	return mw.ustring.format('&amp;lt;code style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;%s%s%s%s&amp;lt;/code&amp;gt;', pipe, name, equals, val)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blurb.makeTemplateLink(s)&lt;br /&gt;
	return mw.ustring.format('%s[[Template:%s|%s]]%s', mw.text.nowiki('{{'), s,	s, mw.text.nowiki('}}'))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blurb:makeProtectionText()&lt;br /&gt;
	local boxProtectionLevel = self.boxProtectionLevel&lt;br /&gt;
	local levels = {['*'] = 'unprotected', autoconfirmed = 'semi-protected', extendedconfirmed = 'extended-confirmed-protected', templateeditor = 'template-protected', sysop = 'fully protected', interfaceadmin = 'interface-protected'}&lt;br /&gt;
	for level, protectionText in pairs(levels) do&lt;br /&gt;
		if level == boxProtectionLevel then&lt;br /&gt;
			return mw.ustring.format('[[Help:Protection|%s]]', protectionText)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	error('Unknown protection level ' .. boxProtectionLevel)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blurb.getPagetypePlural(title)&lt;br /&gt;
	local pagetype = title.pagetype&lt;br /&gt;
	if pagetype == 'category' then&lt;br /&gt;
		return 'categories'&lt;br /&gt;
	else&lt;br /&gt;
		return pagetype .. 's'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Normal methods --&lt;br /&gt;
&lt;br /&gt;
function blurb:makeLinkList(title)&lt;br /&gt;
	local tbargs = {} -- The argument list to pass to Module:Toolbar&lt;br /&gt;
	tbargs.style = 'font-size: smaller;'&lt;br /&gt;
	tbargs.separator = 'dot'&lt;br /&gt;
	-- Page links.&lt;br /&gt;
	table.insert(tbargs, title:makeEditLink('edit'))&lt;br /&gt;
	table.insert(tbargs, title:makeHistoryLink('history'))&lt;br /&gt;
	table.insert(tbargs, title:makeLastEditLink('last'))&lt;br /&gt;
	table.insert(tbargs, title:makeWhatLinksHereLink('links'))&lt;br /&gt;
	-- Sandbox links.&lt;br /&gt;
	local sandboxTitle = title:getSubpageTitle('sandbox')&lt;br /&gt;
	if sandboxTitle and sandboxTitle.exists then&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeViewLink('sandbox'))&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeEditLink('edit sandbox'))&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeHistoryLink('sandbox history'))&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeLastEditLink('sandbox last edit'))&lt;br /&gt;
		table.insert(tbargs, title:makeCompareLink(sandboxTitle, 'sandbox diff'))&lt;br /&gt;
	end&lt;br /&gt;
	-- Test cases links.&lt;br /&gt;
	local testcasesTitle = title:getSubpageTitle('testcases')&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		table.insert(tbargs, testcasesTitle:makeViewLink('test cases'))&lt;br /&gt;
	end&lt;br /&gt;
	-- Transclusion count link.&lt;br /&gt;
	if title.namespace == 10 or title.namespace == 828 then -- Only add the transclusion count link for templates and modules.&lt;br /&gt;
		local tclink = mw.uri.new{&lt;br /&gt;
			host = 'tools.wmflabs.org',&lt;br /&gt;
			path = '/templatecount/index.php',&lt;br /&gt;
			query = {&lt;br /&gt;
				lang = 'en',&lt;br /&gt;
				name = title.text,&lt;br /&gt;
				namespace = title.namespace,&lt;br /&gt;
			},&lt;br /&gt;
			fragment = 'bottom'&lt;br /&gt;
		}&lt;br /&gt;
		tclink = string.format('[%s transclusion count]', tostring(tclink))&lt;br /&gt;
		table.insert(tbargs, tclink)&lt;br /&gt;
	end&lt;br /&gt;
	-- Protection log link.&lt;br /&gt;
	if title.namespace ~= 8 then -- MediaWiki pages don't have protection log entries.&lt;br /&gt;
		table.insert(tbargs, title:makeLogLink('protect', 'protection log'))&lt;br /&gt;
	end&lt;br /&gt;
	self.linkCount = self.linkCount + #tbargs -- Keep track of the number of total links created by the object.&lt;br /&gt;
	return makeToolbar(tbargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blurb:makeLinkLists()&lt;br /&gt;
	local titles = self.titles&lt;br /&gt;
	if #titles == 1 then&lt;br /&gt;
		return self:makeLinkList(titles[1])&lt;br /&gt;
	else&lt;br /&gt;
		local ret = {}&lt;br /&gt;
		table.insert(ret, '&amp;lt;ul&amp;gt;')&lt;br /&gt;
		for i, titleObj in ipairs(titles) do&lt;br /&gt;
			table.insert(ret, mw.ustring.format('&amp;lt;li&amp;gt;%s %s&amp;lt;/li&amp;gt;', titleObj:makeViewLink(titleObj.prefixedText), self:makeLinkList(titleObj)))&lt;br /&gt;
		end&lt;br /&gt;
		table.insert(ret, '&amp;lt;/ul&amp;gt;')&lt;br /&gt;
		return table.concat(ret)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blurb:makeIntro()&lt;br /&gt;
	local titles = self.titles&lt;br /&gt;
	local requested = 'It is [[Wikipedia:Edit requests|requested]] that'&lt;br /&gt;
	local protectionText&lt;br /&gt;
	if titles:hasNonInterfacePage() then&lt;br /&gt;
		protectionText = ' ' .. self:makeProtectionText()&lt;br /&gt;
	else&lt;br /&gt;
		protectionText = '' -- Interface pages cannot be unprotected, so we don't need to explicitly say they are protected.&lt;br /&gt;
	end&lt;br /&gt;
	-- Deal with cases where we are passed multiple titles.&lt;br /&gt;
	if #titles &amp;gt; 1 then&lt;br /&gt;
		local pagetype&lt;br /&gt;
		if titles:hasSamePagetype() then&lt;br /&gt;
			pagetype = blurb.getPagetypePlural(titles[1])&lt;br /&gt;
		else&lt;br /&gt;
			pagetype = 'pages'&lt;br /&gt;
		end&lt;br /&gt;
		return mw.ustring.format(&amp;quot;'''%s edits be made to the following%s %s''':&amp;quot;, requested, protectionText, pagetype)&lt;br /&gt;
	end&lt;br /&gt;
	-- Deal with cases where we are passed only one title.&lt;br /&gt;
	local title = titles[1]&lt;br /&gt;
	local stringToFormat&lt;br /&gt;
	if title.exists then&lt;br /&gt;
		stringToFormat = '%s an edit be made to the%s %s at %s.'&lt;br /&gt;
	else&lt;br /&gt;
		stringToFormat = '%s the%s %s at %s be created.'&lt;br /&gt;
	end&lt;br /&gt;
	stringToFormat = &amp;quot;'''&amp;quot; .. stringToFormat .. &amp;quot;'''&amp;quot;&lt;br /&gt;
	return mw.ustring.format(stringToFormat, requested, protectionText, title.pagetype, title:makeViewLink(title.prefixedText))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blurb:makeBody()&lt;br /&gt;
	local titles = self.titles&lt;br /&gt;
	local protectionLevels = titles:getProtectionLevels()&lt;br /&gt;
	local boxProtectionLevel = self.boxProtectionLevel&lt;br /&gt;
	local hasNonInterfacePage = titles:hasNonInterfacePage()&lt;br /&gt;
	local isPlural = false&lt;br /&gt;
	if #titles &amp;gt; 1 then&lt;br /&gt;
		isPlural = true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local descriptionText = &amp;quot;This template must be followed by a '''complete and specific description''' of the request, &amp;quot;&lt;br /&gt;
	if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'templateeditor' then&lt;br /&gt;
		local editText = 'edit'&lt;br /&gt;
		if isPlural then&lt;br /&gt;
			editText = editText .. 's'&lt;br /&gt;
		end&lt;br /&gt;
		local descriptionCompleteText = mw.ustring.format('so that an editor unfamiliar with the subject matter could complete the requested %s immediately.', editText)&lt;br /&gt;
		descriptionText = descriptionText .. descriptionCompleteText&lt;br /&gt;
	else&lt;br /&gt;
		descriptionText = descriptionText .. 'that is, specify what text should be removed and a verbatim copy of the text that should replace it. '&lt;br /&gt;
			.. [[&amp;quot;Please change ''X''&amp;quot; is '''not acceptable''' and will be rejected; the request '''must''' be of the form &amp;quot;please change ''X'' to ''Y''&amp;quot;.]]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local smallText = ''&lt;br /&gt;
	if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'templateeditor' then&lt;br /&gt;
		local templateFullText&lt;br /&gt;
		if boxProtectionLevel == 'sysop' then&lt;br /&gt;
			templateFullText = 'fully protected'&lt;br /&gt;
		elseif boxProtectionLevel == 'templateeditor' then&lt;br /&gt;
			templateFullText = 'template-protected'&lt;br /&gt;
		end&lt;br /&gt;
		smallText =	'Edit requests to ' .. templateFullText	.. &amp;quot; pages should only be used for edits that are either '''uncontroversial''' or supported by [[Wikipedia:Consensus|consensus]].&amp;quot;&lt;br /&gt;
			.. &amp;quot; If the proposed edit might be controversial, discuss it on the protected page's talk page '''before''' using this template.&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		local userText&lt;br /&gt;
		local responseTemplate&lt;br /&gt;
		if boxProtectionLevel == 'extendedconfirmed' then&lt;br /&gt;
			userText = '[[Wikipedia:User access levels#Extended confirmed users|extended confirmed]] user'&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink('EEp')&lt;br /&gt;
		elseif boxProtectionLevel == 'autoconfirmed' then&lt;br /&gt;
			userText = '[[Wikipedia:User access levels#Autoconfirmed|autoconfirmed]] user'&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink('ESp')&lt;br /&gt;
		elseif boxProtectionLevel == 'interfaceadmin' then&lt;br /&gt;
			userText = '[[Wikipedia:User access levels#Interface administrators|interface-admin]]'&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink('EIp')&lt;br /&gt;
		else&lt;br /&gt;
			userText = 'user'&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink('ESp')&lt;br /&gt;
		end&lt;br /&gt;
		local answeredPara = blurb.makeParaText('answered', 'no')&lt;br /&gt;
		local stringToFormat =	'The edit may be made by any %s. '&lt;br /&gt;
			.. [[Remember to change the %s parameter to &amp;quot;'''yes'''&amp;quot; when the request has been accepted, rejected or on hold awaiting user input. ]]&lt;br /&gt;
			.. &amp;quot;This is so that inactive or completed requests don't needlessly fill up the edit requests category. &amp;quot;&lt;br /&gt;
			.. 'You may also wish to use the %s template in the response.'&lt;br /&gt;
		smallText = mw.ustring.format(stringToFormat, userText, answeredPara, responseTemplate)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not isPlural then&lt;br /&gt;
		local title = titles[1]&lt;br /&gt;
		if title.namespace == 10 or title.namespace == 828 then&lt;br /&gt;
			local sandboxTitle = title:getSubpageTitle('sandbox')&lt;br /&gt;
			if sandboxTitle and sandboxTitle.exists then&lt;br /&gt;
				smallText = smallText .. ' Consider making changes first to the '&lt;br /&gt;
					.. sandboxTitle:makeViewLink(title.pagetype .. &amp;quot;'s sandbox&amp;quot;)&lt;br /&gt;
				local testcasesTitle = title:getSubpageTitle('testcases')&lt;br /&gt;
				if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
					smallText = smallText .. ' and ' .. testcasesTitle:makeViewLink('test them thoroughly here')&lt;br /&gt;
				end&lt;br /&gt;
				smallText = smallText .. ' before submitting an edit request.'&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if hasNonInterfacePage then&lt;br /&gt;
		smallText = smallText .. ' To request that a page be protected or unprotected, make a [[Wikipedia:Requests for page protection|protection request]].'&lt;br /&gt;
	end&lt;br /&gt;
	if boxProtectionLevel == 'sysop' or boxProtectionLevel == 'templateeditor' or boxProtectionLevel == 'interfaceadmin' then&lt;br /&gt;
		smallText = smallText .. ' When the request has been completed or denied, please add the ' .. blurb.makeParaText('answered', 'yes') .. ' parameter to deactivate the template.'&lt;br /&gt;
	end&lt;br /&gt;
	return mw.ustring.format('%s\n&amp;lt;p style=&amp;quot;font-size:smaller; line-height:1.3em;&amp;quot;&amp;gt;\n%s\n&amp;lt;/p&amp;gt;', descriptionText, smallText)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function blurb:export()&lt;br /&gt;
	local intro = self:makeIntro()&lt;br /&gt;
	local linkLists = self:makeLinkLists()&lt;br /&gt;
	local body = self:makeBody()&lt;br /&gt;
	-- Start long links lists on a new line.&lt;br /&gt;
	local linkListSep = ' '&lt;br /&gt;
	if self.linkCount &amp;gt; 5 then&lt;br /&gt;
		linkListSep = '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
	return mw.ustring.format('%s%s%s\n\n%s', intro, linkListSep, linkLists, body)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
-- Subclass of Module:Protected edit request's box class for active boxes&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local box = {}&lt;br /&gt;
box.__index = box&lt;br /&gt;
&lt;br /&gt;
function box.new(protectionType, args)&lt;br /&gt;
	-- In the inheritance system used here, an object's metatable is its class, and a class's metatable is its superclass&lt;br /&gt;
	local obj = getmetatable(box).new(protectionType, args)&lt;br /&gt;
	setmetatable(obj, box)&lt;br /&gt;
	local boxProtectionLevels = {semi = 'autoconfirmed', extended = 'extendedconfirmed', template = 'templateeditor', full = 'sysop', interface = 'interfaceadmin'}&lt;br /&gt;
	obj.boxProtectionLevel = boxProtectionLevels[protectionType]&lt;br /&gt;
	obj.demo = yesno(args.demo)&lt;br /&gt;
	-- Set dependent objects.&lt;br /&gt;
	obj.titles = titleTable.new(args)&lt;br /&gt;
	if not yesno(args.force) and obj.titles:hasSameProperty('sameProtectionStatus', function (title) return title.protectionLevel end) and obj.titles[1].protectionLevel ~= 'unprotected' then&lt;br /&gt;
		obj.boxProtectionLevel = obj.titles[1].protectionLevel&lt;br /&gt;
	end&lt;br /&gt;
	obj.blurb = blurb.new(obj.titles, obj.boxProtectionLevel)&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:setImage()&lt;br /&gt;
	local titles = self.titles&lt;br /&gt;
	local boxProtectionLevel = self.boxProtectionLevel&lt;br /&gt;
	local padlock&lt;br /&gt;
	if boxProtectionLevel == 'sysop' then&lt;br /&gt;
		padlock = 'Full-protection-shackle.svg'&lt;br /&gt;
	elseif boxProtectionLevel == 'interfaceadmin' then&lt;br /&gt;
		padlock = 'Interface-protection-shackle.svg '&lt;br /&gt;
	elseif boxProtectionLevel == 'templateeditor' then&lt;br /&gt;
		padlock = 'Template-protection-shackle.svg'&lt;br /&gt;
	elseif boxProtectionLevel == 'autoconfirmed' then&lt;br /&gt;
		padlock = 'Semi-protection-shackle.svg'&lt;br /&gt;
	elseif boxProtectionLevel == 'extendedconfirmed' then&lt;br /&gt;
		padlock = 'Extended-protection-shackle.svg'&lt;br /&gt;
	else&lt;br /&gt;
		padlock = 'Padlock-bronze-open.svg'&lt;br /&gt;
	end&lt;br /&gt;
	local stringToFormat = '[[File:%s|%dpx|alt=|link=]]'&lt;br /&gt;
	local smallPadlock = mw.ustring.format(stringToFormat, padlock, 25)&lt;br /&gt;
	local largePadlock = mw.ustring.format(stringToFormat, padlock, 60)&lt;br /&gt;
	self:setArg('smallimage', smallPadlock)&lt;br /&gt;
	self:setArg('image', largePadlock)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:buildUrnLinks()&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local boxProtectionLevel = self.boxProtectionLevel&lt;br /&gt;
	for titleObj in self.titles:titleIterator() do&lt;br /&gt;
		table.insert(ret, titleObj:makeUrnLink(boxProtectionLevel))&lt;br /&gt;
	end&lt;br /&gt;
	return mw.ustring.format('&amp;lt;span class=&amp;quot;plainlinks&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;', table.concat(ret))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:setBlurbText()&lt;br /&gt;
	self:setArg('text', self.blurb:export() .. self:buildUrnLinks())&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:exportRequestTmbox()&lt;br /&gt;
	self:setImage()&lt;br /&gt;
	self:setBlurbText()&lt;br /&gt;
	self:setArg('class', 'editrequest')&lt;br /&gt;
	self:setArg('id', title.getProtectionLevelText(self.boxProtectionLevel)) -- for anchor. yes, this leads to multiple elements with the same ID. we should probably fix this at some point&lt;br /&gt;
	return makeMessageBox('tmbox', self.tmboxArgs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:exportRequestCategories()&lt;br /&gt;
	local cats = {}&lt;br /&gt;
	local boxProtectionLevel = self.boxProtectionLevel&lt;br /&gt;
	local function addCat(cat)&lt;br /&gt;
		table.insert(cats, mw.ustring.format('[[Category:%s]]', cat))&lt;br /&gt;
	end&lt;br /&gt;
	local protectionCats = {&lt;br /&gt;
		autoconfirmed = 'Wikipedia semi-protected edit requests',&lt;br /&gt;
		extendedconfirmed = 'Wikipedia extended-confirmed-protected edit requests',&lt;br /&gt;
		templateeditor = 'Wikipedia template-protected edit requests',&lt;br /&gt;
		sysop = 'Wikipedia fully-protected edit requests',&lt;br /&gt;
		interfaceadmin = 'Wikipedia interface-protected edit requests'&lt;br /&gt;
	}&lt;br /&gt;
	addCat(protectionCats[boxProtectionLevel])&lt;br /&gt;
	if self.titles:hasOtherProtectionLevel(boxProtectionLevel) then&lt;br /&gt;
		addCat('Wikipedia edit requests possibly using incorrect templates')&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(cats)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:export()&lt;br /&gt;
	if not self.titles.currentTitle.isTalkPage and not self.demo then&lt;br /&gt;
		return '&amp;lt;span class=&amp;quot;error&amp;quot;&amp;gt;Error: Protected edit requests can only be made on the talk page.&amp;lt;/span&amp;gt;[[Category:Non-talk pages with an edit request template]]'&lt;br /&gt;
	end&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	table.insert(ret, self:exportRequestTmbox())&lt;br /&gt;
	if not self.demo then&lt;br /&gt;
		table.insert(ret, self:exportRequestCategories())&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
-- Function exported to Module:Protected edit request&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return function(superclass, yn, mb)&lt;br /&gt;
	yesno = yn&lt;br /&gt;
	makeMessageBox = mb&lt;br /&gt;
	return setmetatable(box, superclass)&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>en&gt;Anarchyte</name></author>
		
	</entry>
</feed>