<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.ostan-collections.net/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="https://www.ostan-collections.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtected_edit_request%2Factive"/>
	<link rel="alternate" type="text/html" href="https://www.ostan-collections.net/wiki/index.php?title=Module:Protected_edit_request/active&amp;action=history"/>
	<updated>2026-04-10T20:50:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.15</generator>
	<entry>
		<id>https://www.ostan-collections.net/wiki/index.php?title=Module:Protected_edit_request/active&amp;diff=5949&amp;oldid=prev</id>
		<title>Halian: Created page with &quot;require(&#039;strict&#039;)  local yesno, makeMessageBox -- passed in from Module:Protected edit request local makeToolbar = require(&#039;Module:Toolbar&#039;)._main local getPagetype = require(&#039;Module:Pagetype&#039;)._main local effectiveProtectionLevel = require(&#039;Module:Effective protection level&#039;)._main  ---------------------------------------------------------------------- -- Helper functions ----------------------------------------------------------------------  local function makeWikilink...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.ostan-collections.net/wiki/index.php?title=Module:Protected_edit_request/active&amp;diff=5949&amp;oldid=prev"/>
		<updated>2023-12-05T05:04:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;require(&amp;#039;strict&amp;#039;)  local yesno, makeMessageBox -- passed in from Module:Protected edit request local makeToolbar = require(&amp;#039;Module:Toolbar&amp;#039;)._main local getPagetype = require(&amp;#039;Module:Pagetype&amp;#039;)._main local effectiveProtectionLevel = require(&amp;#039;Module:Effective protection level&amp;#039;)._main  ---------------------------------------------------------------------- -- Helper functions ----------------------------------------------------------------------  local function makeWikilink...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local yesno, makeMessageBox -- passed in from Module:Protected edit request&lt;br /&gt;
local makeToolbar = require(&amp;#039;Module:Toolbar&amp;#039;)._main&lt;br /&gt;
local getPagetype = require(&amp;#039;Module:Pagetype&amp;#039;)._main&lt;br /&gt;
local effectiveProtectionLevel = require(&amp;#039;Module:Effective protection level&amp;#039;)._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(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s]]&amp;#039;, 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 = &amp;#039;editunprotected&amp;#039;, autoconfirmed = &amp;#039;editsemiprotected&amp;#039;, extendedconfirmed = &amp;#039;editextendedprotected&amp;#039;, templateeditor = &amp;#039;edittemplateprotected&amp;#039;, sysop = &amp;#039;editprotected&amp;#039;, interfaceadmin = &amp;#039;editinterfaceprotected&amp;#039;}&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;
	title.init(obj)&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function title.init(obj)&lt;br /&gt;
	-- Add a protectionLevel property.&lt;br /&gt;
	obj.protectionLevel = effectiveProtectionLevel(obj.exists and &amp;#039;edit&amp;#039; or &amp;#039;create&amp;#039;, obj)&lt;br /&gt;
	if obj.protectionLevel == &amp;#039;*&amp;#039; then&lt;br /&gt;
		-- Make unprotected pages return &amp;quot;unprotected&amp;quot;.&lt;br /&gt;
		obj.protectionLevel = &amp;#039;unprotected&amp;#039;&lt;br /&gt;
	elseif obj.protectionLevel == &amp;#039;user&amp;#039; then&lt;br /&gt;
		-- If we just need to be registered, pretend we need to be autoconfirmed, since it&amp;#039;s the closest thing we have.&lt;br /&gt;
		obj.protectionLevel = &amp;#039;autoconfirmed&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add a pagetype property.&lt;br /&gt;
	obj.pagetype = getPagetype{page = obj.prefixedText, defaultns = &amp;#039;all&amp;#039;}&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(&amp;#039;[%s %s]&amp;#039;, 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 = &amp;#039;no&amp;#039;}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeEditLink(display)&lt;br /&gt;
		return self:makeUrlLink({action = &amp;#039;edit&amp;#039;}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeHistoryLink(display)&lt;br /&gt;
		return self:makeUrlLink({action = &amp;#039;history&amp;#039;}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeLastEditLink(display)&lt;br /&gt;
		return self:makeUrlLink({diff = &amp;#039;cur&amp;#039;, oldid = &amp;#039;prev&amp;#039;}, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeWhatLinksHereLink(display)&lt;br /&gt;
		return makeWikilink(&amp;#039;Special:WhatLinksHere/&amp;#039; .. self.prefixedText, display)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:makeCompareLink(otherTitle, display)&lt;br /&gt;
		display = display or &amp;#039;diff&amp;#039;&lt;br /&gt;
		local comparePagesTitle = title.new(&amp;#039;Special:ComparePages&amp;#039;)&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(&amp;#039;Special:Log&amp;#039;)&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, &amp;#039;WIKI&amp;#039;)&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(&amp;#039;[urn:x-wp-%s:%s &amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;]&amp;#039;, 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 .. &amp;#039;/&amp;#039; .. subpage)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function obj:getSandboxTitle()&lt;br /&gt;
		if self.isSubpage and self.contentModel == &amp;#039;sanitized-css&amp;#039; then&lt;br /&gt;
			local success2, obj2 = pcall(mw.title.makeTitle, self.namespace, self.baseText .. &amp;#039;/sandbox/&amp;#039; .. self.subpageText)&lt;br /&gt;
			if success2 and obj2 then&lt;br /&gt;
				title.init(obj2)&lt;br /&gt;
				return obj2&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return self:getSubpageTitle(&amp;#039;sandbox&amp;#039;)&lt;br /&gt;
	end&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) == &amp;#039;number&amp;#039; 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 ~= &amp;#039;&amp;#039; then&lt;br /&gt;
			subjectNs = subjectNs .. &amp;#039;:&amp;#039;&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&amp;#039;t exist. Returns false if there is a mixture of existence statuses.&lt;br /&gt;
	return self:hasSameProperty(&amp;#039;sameExistenceStatus&amp;#039;, 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(&amp;#039;sameProtectionStatus&amp;#039;, 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(&amp;#039;samePagetype&amp;#039;, 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(&amp;#039;nonInterfacePage&amp;#039;, 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(&amp;#039;templateOrModule&amp;#039;, 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(&amp;#039;nontemplateormodule&amp;#039;, 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(&amp;#039;protectionLevels&amp;#039;, 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&amp;#039;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(&amp;#039;|&amp;#039;)&lt;br /&gt;
	local equals = mw.text.nowiki(&amp;#039;=&amp;#039;)&lt;br /&gt;
	val = val and (&amp;quot;&amp;#039;&amp;#039;&amp;quot; .. val .. &amp;quot;&amp;#039;&amp;#039;&amp;quot;) or &amp;#039;&amp;#039;&lt;br /&gt;
	return mw.ustring.format(&amp;#039;&amp;lt;code style=&amp;quot;white-space: nowrap;&amp;quot;&amp;gt;%s%s%s%s&amp;lt;/code&amp;gt;&amp;#039;, 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(&amp;#039;%s[[Template:%s|%s]]%s&amp;#039;, mw.text.nowiki(&amp;#039;{{&amp;#039;), s,	s, mw.text.nowiki(&amp;#039;}}&amp;#039;))&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 = {[&amp;#039;*&amp;#039;] = &amp;#039;unprotected&amp;#039;, autoconfirmed = &amp;#039;semi-protected&amp;#039;, extendedconfirmed = &amp;#039;extended-confirmed-protected&amp;#039;, templateeditor = &amp;#039;template-protected&amp;#039;, sysop = &amp;#039;fully protected&amp;#039;, interfaceadmin = &amp;#039;interface-protected&amp;#039;}&lt;br /&gt;
	for level, protectionText in pairs(levels) do&lt;br /&gt;
		if level == boxProtectionLevel then&lt;br /&gt;
			return mw.ustring.format(&amp;#039;[[Help:Protection|%s]]&amp;#039;, protectionText)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	error(&amp;#039;Unknown protection level &amp;#039; .. 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 == &amp;#039;category&amp;#039; then&lt;br /&gt;
		return &amp;#039;categories&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return pagetype .. &amp;#039;s&amp;#039;&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 = &amp;#039;font-size: smaller;&amp;#039;&lt;br /&gt;
	tbargs.separator = &amp;#039;dot&amp;#039;&lt;br /&gt;
	-- Page links.&lt;br /&gt;
	table.insert(tbargs, title:makeEditLink(&amp;#039;edit&amp;#039;))&lt;br /&gt;
	table.insert(tbargs, title:makeHistoryLink(&amp;#039;history&amp;#039;))&lt;br /&gt;
	table.insert(tbargs, title:makeLastEditLink(&amp;#039;last&amp;#039;))&lt;br /&gt;
	table.insert(tbargs, title:makeWhatLinksHereLink(&amp;#039;links&amp;#039;))&lt;br /&gt;
	-- Sandbox links.&lt;br /&gt;
	local sandboxTitle = title:getSandboxTitle()&lt;br /&gt;
	if sandboxTitle and sandboxTitle.exists then&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeViewLink(&amp;#039;sandbox&amp;#039;))&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeEditLink(&amp;#039;edit sandbox&amp;#039;))&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeHistoryLink(&amp;#039;sandbox history&amp;#039;))&lt;br /&gt;
		table.insert(tbargs, sandboxTitle:makeLastEditLink(&amp;#039;sandbox last edit&amp;#039;))&lt;br /&gt;
		table.insert(tbargs, title:makeCompareLink(sandboxTitle, &amp;#039;sandbox diff&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	-- Test cases links.&lt;br /&gt;
	local testcasesTitle = title:getSubpageTitle(&amp;#039;testcases&amp;#039;)&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		table.insert(tbargs, testcasesTitle:makeViewLink(&amp;#039;test cases&amp;#039;))&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 = &amp;#039;templatecount.toolforge.org&amp;#039;,&lt;br /&gt;
			path = &amp;#039;/index.php&amp;#039;,&lt;br /&gt;
			query = {&lt;br /&gt;
				lang = &amp;#039;en&amp;#039;,&lt;br /&gt;
				name = title.text,&lt;br /&gt;
				namespace = title.namespace,&lt;br /&gt;
			},&lt;br /&gt;
			fragment = &amp;#039;bottom&amp;#039;&lt;br /&gt;
		}&lt;br /&gt;
		tclink = string.format(&amp;#039;[%s transclusion count]&amp;#039;, 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&amp;#039;t have protection log entries.&lt;br /&gt;
		table.insert(tbargs, title:makeLogLink(&amp;#039;protect&amp;#039;, &amp;#039;protection log&amp;#039;))&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;#039;&amp;lt;ul&amp;gt;&amp;#039;)&lt;br /&gt;
		for i, titleObj in ipairs(titles) do&lt;br /&gt;
			table.insert(ret, mw.ustring.format(&amp;#039;&amp;lt;li&amp;gt;%s %s&amp;lt;/li&amp;gt;&amp;#039;, titleObj:makeViewLink(titleObj.prefixedText), self:makeLinkList(titleObj)))&lt;br /&gt;
		end&lt;br /&gt;
		table.insert(ret, &amp;#039;&amp;lt;/ul&amp;gt;&amp;#039;)&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 = &amp;#039;It is [[Wikipedia:Edit requests|requested]] that&amp;#039;&lt;br /&gt;
	local protectionText&lt;br /&gt;
	if titles:hasNonInterfacePage() then&lt;br /&gt;
		protectionText = &amp;#039; &amp;#039; .. self:makeProtectionText()&lt;br /&gt;
	else&lt;br /&gt;
		protectionText = &amp;#039;&amp;#039; -- Interface pages cannot be unprotected, so we don&amp;#039;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 = &amp;#039;pages&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		return mw.ustring.format(&amp;quot;&amp;#039;&amp;#039;&amp;#039;%s edits be made to the following%s %s&amp;#039;&amp;#039;&amp;#039;:&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 = &amp;#039;%s an edit be made to the%s %s at %s.&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		stringToFormat = &amp;#039;%s the%s %s at %s be created.&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	stringToFormat = &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;quot; .. stringToFormat .. &amp;quot;&amp;#039;&amp;#039;&amp;#039;&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 &amp;#039;&amp;#039;&amp;#039;complete and specific description&amp;#039;&amp;#039;&amp;#039; of the request, &amp;quot;&lt;br /&gt;
	if boxProtectionLevel == &amp;#039;sysop&amp;#039; or boxProtectionLevel == &amp;#039;templateeditor&amp;#039; then&lt;br /&gt;
		local editText = &amp;#039;edit&amp;#039;&lt;br /&gt;
		if isPlural then&lt;br /&gt;
			editText = editText .. &amp;#039;s&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		local descriptionCompleteText = mw.ustring.format(&amp;#039;so that an editor unfamiliar with the subject matter could complete the requested %s immediately.&amp;#039;, editText)&lt;br /&gt;
		descriptionText = descriptionText .. descriptionCompleteText&lt;br /&gt;
	else&lt;br /&gt;
		descriptionText = descriptionText .. &amp;#039;that is, specify what text should be removed and a verbatim copy of the text that should replace it. &amp;#039;&lt;br /&gt;
			.. [[&amp;quot;Please change &amp;#039;&amp;#039;X&amp;#039;&amp;#039;&amp;quot; is &amp;#039;&amp;#039;&amp;#039;not acceptable&amp;#039;&amp;#039;&amp;#039; and will be rejected; the request &amp;#039;&amp;#039;&amp;#039;must&amp;#039;&amp;#039;&amp;#039; be of the form &amp;quot;please change &amp;#039;&amp;#039;X&amp;#039;&amp;#039; to &amp;#039;&amp;#039;Y&amp;#039;&amp;#039;&amp;quot;.]]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local smallText = &amp;#039;&amp;#039;&lt;br /&gt;
	if boxProtectionLevel == &amp;#039;sysop&amp;#039; or boxProtectionLevel == &amp;#039;templateeditor&amp;#039; then&lt;br /&gt;
		local templateFullText&lt;br /&gt;
		if boxProtectionLevel == &amp;#039;sysop&amp;#039; then&lt;br /&gt;
			templateFullText = &amp;#039;fully protected&amp;#039;&lt;br /&gt;
		elseif boxProtectionLevel == &amp;#039;templateeditor&amp;#039; then&lt;br /&gt;
			templateFullText = &amp;#039;template-protected&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
		smallText =	&amp;#039;Edit requests to &amp;#039; .. templateFullText	.. &amp;quot; pages should only be used for edits that are either &amp;#039;&amp;#039;&amp;#039;uncontroversial&amp;#039;&amp;#039;&amp;#039; 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&amp;#039;s talk page &amp;#039;&amp;#039;&amp;#039;before&amp;#039;&amp;#039;&amp;#039; using this template.&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		local userText&lt;br /&gt;
		local responseTemplate&lt;br /&gt;
		if boxProtectionLevel == &amp;#039;extendedconfirmed&amp;#039; then&lt;br /&gt;
			userText = &amp;#039;[[Wikipedia:User access levels#Extended confirmed users|extended confirmed]] user&amp;#039;&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink(&amp;#039;EEp&amp;#039;)&lt;br /&gt;
		elseif boxProtectionLevel == &amp;#039;autoconfirmed&amp;#039; then&lt;br /&gt;
			userText = &amp;#039;[[Wikipedia:User access levels#Autoconfirmed|autoconfirmed]] user&amp;#039;&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink(&amp;#039;ESp&amp;#039;)&lt;br /&gt;
		elseif boxProtectionLevel == &amp;#039;interfaceadmin&amp;#039; then&lt;br /&gt;
			userText = &amp;#039;[[Wikipedia:User access levels#Interface administrators|interface administrator]]&amp;#039;&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink(&amp;#039;EIp&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			userText = &amp;#039;user&amp;#039;&lt;br /&gt;
			responseTemplate = blurb.makeTemplateLink(&amp;#039;ESp&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local answeredPara = blurb.makeParaText(&amp;#039;answered&amp;#039;, &amp;#039;no&amp;#039;)&lt;br /&gt;
		local stringToFormat =	&amp;#039;The edit may be made by any %s. &amp;#039;&lt;br /&gt;
			.. [[Remember to change the %s parameter to &amp;quot;&amp;#039;&amp;#039;&amp;#039;yes&amp;#039;&amp;#039;&amp;#039;&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&amp;#039;t needlessly fill up the edit requests category. &amp;quot;&lt;br /&gt;
			.. &amp;#039;You may also wish to use the %s template in the response.&amp;#039;&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(&amp;#039;sandbox&amp;#039;)&lt;br /&gt;
			if sandboxTitle and sandboxTitle.exists then&lt;br /&gt;
				smallText = smallText .. &amp;#039; Consider making changes first to the &amp;#039;&lt;br /&gt;
					.. sandboxTitle:makeViewLink(title.pagetype .. &amp;quot;&amp;#039;s sandbox&amp;quot;)&lt;br /&gt;
				local testcasesTitle = title:getSubpageTitle(&amp;#039;testcases&amp;#039;)&lt;br /&gt;
				if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
					smallText = smallText .. &amp;#039; and &amp;#039; .. testcasesTitle:makeViewLink(&amp;#039;test them thoroughly here&amp;#039;)&lt;br /&gt;
				end&lt;br /&gt;
				smallText = smallText .. &amp;#039; before submitting an edit request.&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if hasNonInterfacePage then&lt;br /&gt;
		smallText = smallText .. &amp;#039; To request that a page be protected or unprotected, make a [[Wikipedia:Requests for page protection|protection request]].&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	if boxProtectionLevel == &amp;#039;sysop&amp;#039; or boxProtectionLevel == &amp;#039;templateeditor&amp;#039; or boxProtectionLevel == &amp;#039;interfaceadmin&amp;#039; then&lt;br /&gt;
		smallText = smallText .. &amp;#039; When the request has been completed or denied, please add the &amp;#039; .. blurb.makeParaText(&amp;#039;answered&amp;#039;, &amp;#039;yes&amp;#039;) .. &amp;#039; parameter to deactivate the template.&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return mw.ustring.format(&amp;#039;%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;&amp;#039;, 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 = &amp;#039; &amp;#039;&lt;br /&gt;
	if self.linkCount &amp;gt; 5 then&lt;br /&gt;
		linkListSep = &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return mw.ustring.format(&amp;#039;%s%s%s\n\n%s&amp;#039;, intro, linkListSep, linkLists, body)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
-- Subclass of Module:Protected edit request&amp;#039;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&amp;#039;s metatable is its class, and a class&amp;#039;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 = &amp;#039;autoconfirmed&amp;#039;, extended = &amp;#039;extendedconfirmed&amp;#039;, template = &amp;#039;templateeditor&amp;#039;, full = &amp;#039;sysop&amp;#039;, interface = &amp;#039;interfaceadmin&amp;#039;}&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(&amp;#039;sameProtectionStatus&amp;#039;, function (title) return title.protectionLevel end) and obj.titles[1].protectionLevel ~= &amp;#039;unprotected&amp;#039; 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 == &amp;#039;sysop&amp;#039; then&lt;br /&gt;
		padlock = &amp;#039;Full-protection-shackle.svg&amp;#039;&lt;br /&gt;
	elseif boxProtectionLevel == &amp;#039;interfaceadmin&amp;#039; then&lt;br /&gt;
		padlock = &amp;#039;Interface-protection-shackle.svg &amp;#039;&lt;br /&gt;
	elseif boxProtectionLevel == &amp;#039;templateeditor&amp;#039; then&lt;br /&gt;
		padlock = &amp;#039;Template-protection-shackle.svg&amp;#039;&lt;br /&gt;
	elseif boxProtectionLevel == &amp;#039;autoconfirmed&amp;#039; then&lt;br /&gt;
		padlock = &amp;#039;Semi-protection-shackle.svg&amp;#039;&lt;br /&gt;
	elseif boxProtectionLevel == &amp;#039;extendedconfirmed&amp;#039; then&lt;br /&gt;
		padlock = &amp;#039;Extended-protection-shackle.svg&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		padlock = &amp;#039;Padlock-bronze-open.svg&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local stringToFormat = &amp;#039;[[File:%s|%dpx|alt=|link=]]&amp;#039;&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(&amp;#039;smallimage&amp;#039;, smallPadlock)&lt;br /&gt;
	self:setArg(&amp;#039;image&amp;#039;, 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;#039;&amp;lt;span class=&amp;quot;plainlinks&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;%s&amp;lt;/span&amp;gt;&amp;#039;, table.concat(ret))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function box:setBlurbText()&lt;br /&gt;
	self:setArg(&amp;#039;text&amp;#039;, 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(&amp;#039;class&amp;#039;, &amp;#039;editrequest&amp;#039;)&lt;br /&gt;
	self:setArg(&amp;#039;id&amp;#039;, 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(&amp;#039;tmbox&amp;#039;, 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(&amp;#039;[[Category:%s]]&amp;#039;, cat))&lt;br /&gt;
	end&lt;br /&gt;
	local protectionCats = {&lt;br /&gt;
		autoconfirmed = &amp;#039;Wikipedia semi-protected edit requests&amp;#039;,&lt;br /&gt;
		extendedconfirmed = &amp;#039;Wikipedia extended-confirmed-protected edit requests&amp;#039;,&lt;br /&gt;
		templateeditor = &amp;#039;Wikipedia template-protected edit requests&amp;#039;,&lt;br /&gt;
		sysop = &amp;#039;Wikipedia fully protected edit requests&amp;#039;,&lt;br /&gt;
		interfaceadmin = &amp;#039;Wikipedia interface-protected edit requests&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	addCat(protectionCats[boxProtectionLevel])&lt;br /&gt;
	if self.titles:hasOtherProtectionLevel(boxProtectionLevel) then&lt;br /&gt;
		addCat(&amp;#039;Wikipedia edit requests possibly using incorrect templates&amp;#039;)&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;
	local title = self.titles.currentTitle&lt;br /&gt;
	if not title.isTalkPage and not self.demo and not yesno(self.args.skiptalk) then&lt;br /&gt;
		return &amp;#039;&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]]&amp;#039;&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>Halian</name></author>
	</entry>
</feed>