<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://159.13.49.45/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control</id>
	<title>Module:Authority control - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://159.13.49.45/index.php?action=history&amp;feed=atom&amp;title=Module%3AAuthority_control"/>
	<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=Module:Authority_control&amp;action=history"/>
	<updated>2026-04-04T01:25:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://159.13.49.45/index.php?title=Module:Authority_control&amp;diff=45&amp;oldid=prev</id>
		<title>Nat: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=Module:Authority_control&amp;diff=45&amp;oldid=prev"/>
		<updated>2025-04-07T10:44:38Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:44, 7 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key mediawiki:diff:1.41:old-44:rev-45 --&gt;
&lt;/table&gt;</summary>
		<author><name>Nat</name></author>
	</entry>
	<entry>
		<id>http://159.13.49.45/index.php?title=Module:Authority_control&amp;diff=44&amp;oldid=prev</id>
		<title>widipedia&gt;MSGJ: some simplification and other tweaks</title>
		<link rel="alternate" type="text/html" href="http://159.13.49.45/index.php?title=Module:Authority_control&amp;diff=44&amp;oldid=prev"/>
		<updated>2024-10-12T10:11:14Z</updated>

		<summary type="html">&lt;p&gt;some simplification and other tweaks&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;
local p = {}&lt;br /&gt;
local frame = mw.getCurrentFrame()&lt;br /&gt;
local config_file = frame.args.config and frame.args.config~=&amp;#039;&amp;#039; and (&amp;#039;/&amp;#039; .. frame.args.config) or &amp;#039;&amp;#039;&lt;br /&gt;
local config = mw.loadData(&amp;#039;Module:Authority control/config&amp;#039; .. config_file)&lt;br /&gt;
local title = mw.title.getCurrentTitle()&lt;br /&gt;
local namespace = title.namespace&lt;br /&gt;
local testcases = title.subpageText == config.i18n.testcases&lt;br /&gt;
&lt;br /&gt;
local wikilink = function(target, label)&lt;br /&gt;
	return label and &amp;#039;[[&amp;#039; .. target .. &amp;#039;|&amp;#039; .. label .. &amp;#039;]]&amp;#039; or &amp;#039;[[&amp;#039; .. target .. &amp;#039;]]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local needsAttention = function(sortkey)&lt;br /&gt;
	return wikilink(config.i18n.category .. &amp;#039;:&amp;#039; .. config.i18n.attentioncat, sortkey .. title.text)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local addCat = function(cat, sortkey)&lt;br /&gt;
	if cat and cat~=&amp;#039;&amp;#039; and (namespace==0 or namespace==14 or testcases) then&lt;br /&gt;
		local redlinkcat = &amp;#039;&amp;#039;&lt;br /&gt;
		if testcases==false then&lt;br /&gt;
			local success, exists = pcall(function() return mw.title.new(cat, 14).exists end)&lt;br /&gt;
			if success and not exists then &lt;br /&gt;
				redlinkcat = needsAttention(&amp;#039;N&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return wikilink(config.i18n.category..&amp;#039;:&amp;#039;..cat, sortkey and sortkey..title.text) .. redlinkcat&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local tooltip = function(text, label)&lt;br /&gt;
	if label and label~=&amp;#039;&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{&lt;br /&gt;
			title = &amp;#039;Tooltip&amp;#039;,&lt;br /&gt;
			args = {text, label}&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		return text&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local _makelink = function(id, val, additional, qid) --validate values and create a link&lt;br /&gt;
	local link = mw.html.create(&amp;#039;span&amp;#039;):addClass(&amp;#039;uid&amp;#039;)&lt;br /&gt;
	if not additional and id.prefix then --show prefix on primary value&lt;br /&gt;
		link:wikitext(id.prefix .. &amp;#039;: &amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local valid_value = false&lt;br /&gt;
	if id.customlink then -- use function to validate and generate link&lt;br /&gt;
		local newlink = require(config.auxiliary)[id.customlink](val.id, additional)&lt;br /&gt;
		if newlink then&lt;br /&gt;
			link:wikitext(newlink)&lt;br /&gt;
			valid_value = true&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if id.pattern then -- check pattern to determine validity&lt;br /&gt;
			valid_value = string.match(val.id, &amp;#039;^&amp;#039; .. id.pattern .. &amp;#039;$&amp;#039;)&lt;br /&gt;
		elseif id.patterns then -- check multiple patterns to determine validity&lt;br /&gt;
			for _, pattern in ipairs(id.patterns) do&lt;br /&gt;
				valid_value = val.id:match(&amp;#039;^&amp;#039; .. pattern .. &amp;#039;$&amp;#039;)&lt;br /&gt;
				if valid_value then break end&lt;br /&gt;
			end&lt;br /&gt;
		elseif id.valid then -- use function to determine validity&lt;br /&gt;
			valid_value = require(config.auxiliary)[id.valid](val.id)&lt;br /&gt;
		else -- no validation possible&lt;br /&gt;
			valid_value = val.id&lt;br /&gt;
		end&lt;br /&gt;
		if valid_value then&lt;br /&gt;
			local label = id.label&lt;br /&gt;
			if not label or additional then&lt;br /&gt;
				label = tostring(additional)&lt;br /&gt;
			end&lt;br /&gt;
			local newlink&lt;br /&gt;
			if id.link then&lt;br /&gt;
				valid_value = valid_value:gsub(&amp;#039;%%&amp;#039;, &amp;#039;%%%%&amp;#039;)&lt;br /&gt;
				newlink = &amp;#039;[&amp;#039; .. mw.ustring.gsub(id.link, &amp;#039;%$1&amp;#039;, valid_value) .. &amp;#039; &amp;#039; .. label .. &amp;#039;]&amp;#039;&lt;br /&gt;
			else&lt;br /&gt;
				newlink = valid_value&lt;br /&gt;
			end&lt;br /&gt;
			link:wikitext(tooltip(newlink, val.name))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if valid_value then&lt;br /&gt;
		local cat =  id.category and string.format(config.i18n.cat, id.category)&lt;br /&gt;
		link:wikitext(addCat(cat))&lt;br /&gt;
	else&lt;br /&gt;
		local wdlink = qid and wikilink(&amp;#039;:wikidata:&amp;#039; .. qid .. &amp;#039;#P&amp;#039; .. id.property) or &amp;#039;&amp;#039;&lt;br /&gt;
		local name = mw.wikibase.getLabel(&amp;#039;P&amp;#039; .. id.property) or &amp;#039;&amp;#039;&lt;br /&gt;
		local tooltip = string.format(&lt;br /&gt;
			config.i18n.idnotvalid,&lt;br /&gt;
			name,&lt;br /&gt;
			val.id&lt;br /&gt;
		)&lt;br /&gt;
		local cat = id.category and string.format(&lt;br /&gt;
			config.i18n.cat,&lt;br /&gt;
			config.i18n.faulty .. &amp;#039; &amp;#039; .. id.category&lt;br /&gt;
		)&lt;br /&gt;
		link:wikitext(wikilink(&amp;#039;File:&amp;#039; .. config.i18n.warningicon .. &amp;#039;|20px|frameless|link=&amp;#039; .. wdlink, tooltip .. &amp;#039;.&amp;#039;))&lt;br /&gt;
			:wikitext(addCat(cat))&lt;br /&gt;
			:wikitext(addCat(config.i18n.allfaultycat, name))&lt;br /&gt;
	end&lt;br /&gt;
	return link&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local _makelinks = function(id, qid)&lt;br /&gt;
--[[==================================]]&lt;br /&gt;
--[[            Make links            ]]&lt;br /&gt;
--[[==================================]]&lt;br /&gt;
local getquals = function(statement, qualid)&lt;br /&gt;
	if statement.qualifiers and statement.qualifiers[&amp;#039;P&amp;#039;..qualid] then&lt;br /&gt;
		return mw.wikibase.renderSnak(statement.qualifiers[&amp;#039;P&amp;#039;..qualid][1])&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local ids = {}&lt;br /&gt;
if qid then&lt;br /&gt;
	for _, statement in ipairs(mw.wikibase.getBestStatements(qid, &amp;#039;P&amp;#039;..id.property)) do&lt;br /&gt;
		if statement.mainsnak.datavalue then&lt;br /&gt;
			local val = statement.mainsnak.datavalue.value&lt;br /&gt;
			if val then&lt;br /&gt;
				local namedas = getquals(statement, 1810) or getquals(statement, 742) or &amp;#039;&amp;#039;&lt;br /&gt;
				table.insert(ids, {id=val, name=namedas})&lt;br /&gt;
end end end end&lt;br /&gt;
local links&lt;br /&gt;
if ids[1] then&lt;br /&gt;
	links = mw.html.create(&amp;#039;li&amp;#039;):node(_makelink(id, ids[1], false, qid))&lt;br /&gt;
	if ids[2] then&lt;br /&gt;
		local sublinks = mw.html.create(&amp;#039;ul&amp;#039;)&lt;br /&gt;
		for n = 2, #ids do&lt;br /&gt;
			sublinks:tag(&amp;#039;li&amp;#039;):node(_makelink(id, ids[n], n, qid)):done()&lt;br /&gt;
		end&lt;br /&gt;
		links:node(sublinks)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
return links&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.authorityControl = function(frame)&lt;br /&gt;
--[[==================================]]&lt;br /&gt;
--[[               Main               ]]&lt;br /&gt;
--[[==================================]]&lt;br /&gt;
local resolveQID = function(qid)&lt;br /&gt;
	if qid then&lt;br /&gt;
		qid = &amp;#039;Q&amp;#039; .. mw.ustring.gsub(qid, &amp;#039;^[Qq]&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
		if mw.wikibase.isValidEntityId(qid) and mw.wikibase.entityExists(qid) then&lt;br /&gt;
			local sitelink = mw.wikibase.getSitelink(qid)&lt;br /&gt;
			if sitelink then&lt;br /&gt;
				return mw.wikibase.getEntityIdForTitle(sitelink) or mw.wikibase.getEntity(qid).id&lt;br /&gt;
			end&lt;br /&gt;
			return mw.wikibase.getEntity(qid).id&lt;br /&gt;
end end end&lt;br /&gt;
local conf = config.config&lt;br /&gt;
local parentArgs = frame:getParent().args&lt;br /&gt;
local auxCats = &amp;#039;&amp;#039;&lt;br /&gt;
local rct = false -- boolean to track if there are any links to be returned&lt;br /&gt;
local qid, topic&lt;br /&gt;
if namespace==0 then&lt;br /&gt;
	qid = mw.wikibase.getEntityIdForCurrentPage()&lt;br /&gt;
end&lt;br /&gt;
if qid then -- article is connected to a Wikidata item&lt;br /&gt;
	if parentArgs.qid and resolveQID(parentArgs.qid)~=qid then -- non-matching qid parameter&lt;br /&gt;
		auxCats = auxCats .. needsAttention(&amp;#039;D&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
else -- page is not connected to any Wikidata item&lt;br /&gt;
	qid = resolveQID(parentArgs.qid) -- check qid parameter if no wikidata item is connected&lt;br /&gt;
	if qid then -- qid parameter is valid, set topic to display&lt;br /&gt;
		topic = mw.wikibase.getLabel(qid)&lt;br /&gt;
		if topic then&lt;br /&gt;
			if mw.ustring.lower(title.subpageText)==mw.ustring.lower(topic) then -- suppress topic display if subpagename equals topic up to case change&lt;br /&gt;
				topic = nil&lt;br /&gt;
			end&lt;br /&gt;
			if topic and mw.wikibase.getSitelink(qid) then -- make wikilink to article&lt;br /&gt;
				topic = wikilink(mw.wikibase.getSitelink(qid), topic)&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			auxCats = auxCats .. needsAttention(&amp;#039;L&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	elseif parentArgs.qid and parentArgs.qid~=&amp;#039;&amp;#039; then -- invalid qid has been supplied, add to tracking cat&lt;br /&gt;
		auxCats = auxCats .. needsAttention(&amp;#039;Q&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local qids = {} -- setup any additional QIDs&lt;br /&gt;
if parentArgs.additional==&amp;#039;auto&amp;#039; and qid then  -- check P527 for parts to add additional qids&lt;br /&gt;
	local checkparts = function(property)&lt;br /&gt;
		local parts = mw.wikibase.getBestStatements(qid, property)&lt;br /&gt;
		if parts then&lt;br /&gt;
			for _, part in ipairs(parts) do&lt;br /&gt;
				if part.mainsnak.datavalue and part.mainsnak.datavalue.value.id then&lt;br /&gt;
					local resolvedqid = resolveQID(part.mainsnak.datavalue.value.id)&lt;br /&gt;
					if resolvedqid then&lt;br /&gt;
						table.insert(qids,resolvedqid)&lt;br /&gt;
	end end end end end&lt;br /&gt;
	for _, part in ipairs(config.auto_additional) do&lt;br /&gt;
		checkparts(&amp;#039;P&amp;#039; .. part)&lt;br /&gt;
	end&lt;br /&gt;
elseif parentArgs.additional and parentArgs.additional~=&amp;#039;&amp;#039; then&lt;br /&gt;
	for _, v in ipairs(mw.text.split(parentArgs.additional, &amp;#039;%s*,%s*&amp;#039;)) do&lt;br /&gt;
		v = resolveQID(v)&lt;br /&gt;
		if v then&lt;br /&gt;
			if v==qid then -- duplicate of qid parameter&lt;br /&gt;
				auxCats = auxCats .. needsAttention(&amp;#039;R&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			table.insert(qids, v)&lt;br /&gt;
		else -- invalid QID specified&lt;br /&gt;
			auxCats = auxCats .. needsAttention(&amp;#039;A&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local numsections, sections = 0, {}&lt;br /&gt;
for _, _ in ipairs(config.sections) do -- count number of regular sections&lt;br /&gt;
	numsections = numsections + 1&lt;br /&gt;
end&lt;br /&gt;
for _ = 1, #qids+numsections do&lt;br /&gt;
	table.insert(sections, {})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- check which identifiers to show/suppress in template&lt;br /&gt;
local show, show_all_unsuppressed = {}, true&lt;br /&gt;
local stripP = function(pid) --strip P from property number&lt;br /&gt;
	if pid:match(&amp;#039;^[Pp]%d+$&amp;#039;) then&lt;br /&gt;
		pid = mw.ustring.gsub(pid, &amp;#039;[Pp]&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if pid:match(&amp;#039;^%d+$&amp;#039;) then&lt;br /&gt;
		return tonumber(pid)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
local addshowlist = function(list)&lt;br /&gt;
	if list and list~=&amp;#039;&amp;#039; then&lt;br /&gt;
		for _, v in ipairs(mw.text.split(string.lower(list), &amp;#039;%s*,%s*&amp;#039;)) do&lt;br /&gt;
			local vprop = stripP(v)&lt;br /&gt;
			if vprop then -- e.g. show=P214 to show one particular property&lt;br /&gt;
				show[vprop] = true&lt;br /&gt;
			else -- e.g. show=arts to use whitelist&lt;br /&gt;
				if config.whitelists[v] then&lt;br /&gt;
					for _, w in ipairs(config.whitelists[v].properties) do&lt;br /&gt;
						show[w] = true&lt;br /&gt;
		end end end end&lt;br /&gt;
		show_all_unsuppressed = false&lt;br /&gt;
end end&lt;br /&gt;
addshowlist(frame.args.show) -- check show parameter on wrapper template&lt;br /&gt;
addshowlist(parentArgs.show) -- check show parameter on article&lt;br /&gt;
addshowlist(parentArgs.country) -- check country parameter on article&lt;br /&gt;
if parentArgs.suppress then&lt;br /&gt;
	local suppresslist = mw.text.split(parentArgs.suppress, &amp;#039;%s*,%s*&amp;#039;) -- split parameter by comma&lt;br /&gt;
	for _, v in ipairs(suppresslist) do&lt;br /&gt;
		v = stripP(v)&lt;br /&gt;
		if v then&lt;br /&gt;
			show[v] = false&lt;br /&gt;
			auxCats = auxCats .. wikilink(config.i18n.category .. &amp;#039;:&amp;#039; .. config.i18n.suppressedcat)&lt;br /&gt;
		else&lt;br /&gt;
			auxCats = auxCats .. needsAttention(&amp;#039;P&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local makeSections = function(qid, addit)&lt;br /&gt;
	for _, id in ipairs(conf) do&lt;br /&gt;
		if id.suppressedbyproperty then&lt;br /&gt;
			for _, property in ipairs(id.suppressedbyproperty) do&lt;br /&gt;
				if show[property]==&amp;#039;used&amp;#039; then -- property is in use&lt;br /&gt;
					show[id.property] = false -- suppressed by another property&lt;br /&gt;
		end end end&lt;br /&gt;
		if show[id.property]==nil then&lt;br /&gt;
			show[id.property] = show_all_unsuppressed&lt;br /&gt;
		end&lt;br /&gt;
		if show[id.property] then&lt;br /&gt;
			local links = _makelinks(id, qid)&lt;br /&gt;
			if links then&lt;br /&gt;
				table.insert(&lt;br /&gt;
					sections[addit or id.section],&lt;br /&gt;
					links&lt;br /&gt;
				)&lt;br /&gt;
				show[id.property] = &amp;#039;used&amp;#039;&lt;br /&gt;
				rct = true&lt;br /&gt;
end end end end&lt;br /&gt;
local pencil = function(qid)&lt;br /&gt;
	if qid then&lt;br /&gt;
		return require(&amp;#039;Module:EditAtWikidata&amp;#039;)._showMessage{&lt;br /&gt;
			pid = &amp;#039;identifiers&amp;#039;,&lt;br /&gt;
			qid = qid&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
makeSections(qid, false)&lt;br /&gt;
for c = 1, #qids do&lt;br /&gt;
	makeSections(qids[c], numsections+c)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--configure Navbox&lt;br /&gt;
local outString = &amp;#039;&amp;#039;&lt;br /&gt;
if rct then -- there is at least one link to display&lt;br /&gt;
	local Navbox = require(&amp;#039;Module:Navbox&amp;#039;)&lt;br /&gt;
	local sect, lastsect = 0, 0&lt;br /&gt;
	local navboxArgs = {&lt;br /&gt;
		name  = &amp;#039;Authority control&amp;#039;,&lt;br /&gt;
		navboxclass = &amp;#039;authority-control&amp;#039;,&lt;br /&gt;
		bodyclass = &amp;#039;hlist&amp;#039;,&lt;br /&gt;
		state = parentArgs.state or config.i18n.autocollapse,&lt;br /&gt;
		navbar = &amp;#039;off&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	for c = 1, numsections+#qids do&lt;br /&gt;
		if #sections[c]&amp;gt;0 then -- section is non-empty&lt;br /&gt;
			sect = sect + 1&lt;br /&gt;
			lastsect = c&lt;br /&gt;
			local sectname&lt;br /&gt;
			if c&amp;lt;=numsections then -- regular section&lt;br /&gt;
				sectname = config.sections[c].name&lt;br /&gt;
			else -- section from additional qid&lt;br /&gt;
				local qid = qids[c-numsections]&lt;br /&gt;
				local label, sitelink = mw.wikibase.getLabel(qid), mw.wikibase.getSitelink(qid)&lt;br /&gt;
				if label then&lt;br /&gt;
					if sitelink then&lt;br /&gt;
						local target = mw.title.new(sitelink)&lt;br /&gt;
						if target==title or (target.isRedirect and target.redirectTarget==title) then -- do not link&lt;br /&gt;
							sectname = label&lt;br /&gt;
						else -- make wikilink to article&lt;br /&gt;
							sectname = wikilink(sitelink, label)&lt;br /&gt;
						end&lt;br /&gt;
					else&lt;br /&gt;
						sectname = label&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					auxCats = auxCats .. needsAttention(&amp;#039;L&amp;#039;)&lt;br /&gt;
					sectname = qid&lt;br /&gt;
				end&lt;br /&gt;
				sectname = sectname .. pencil(qid)&lt;br /&gt;
			end&lt;br /&gt;
			navboxArgs[&amp;#039;group&amp;#039; .. c] = sectname&lt;br /&gt;
			local list = mw.html.create(&amp;#039;ul&amp;#039;)&lt;br /&gt;
			for _, link in ipairs(sections[c]) do&lt;br /&gt;
				list:node(link)&lt;br /&gt;
			end&lt;br /&gt;
			navboxArgs[&amp;#039;list&amp;#039; .. c] = tostring(list)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if topic then -- display in expanded form with topic&lt;br /&gt;
		navboxArgs.title = config.i18n.aclink .. &amp;#039; &amp;amp;ndash; &amp;#039; .. topic .. pencil(qid)&lt;br /&gt;
	elseif sect==1 then -- special display when only one section&lt;br /&gt;
		if lastsect&amp;lt;=numsections then&lt;br /&gt;
			if config.sections[lastsect].hidelabelwhenalone then -- no special label when only general or other IDs are present&lt;br /&gt;
				navboxArgs[&amp;#039;group&amp;#039; .. lastsect] = config.i18n.aclink .. pencil(qid)&lt;br /&gt;
			else -- other regular section&lt;br /&gt;
				navboxArgs[&amp;#039;group&amp;#039; .. lastsect] = config.i18n.aclink .. &amp;#039;: &amp;#039; .. navboxArgs[&amp;#039;group&amp;#039; .. lastsect] .. pencil(qid)&lt;br /&gt;
			end&lt;br /&gt;
		else -- section from additional qid&lt;br /&gt;
			navboxArgs[&amp;#039;group&amp;#039; .. lastsect] = config.i18n.aclink .. &amp;#039;: &amp;#039; .. navboxArgs[&amp;#039;group&amp;#039; .. lastsect]&lt;br /&gt;
		end&lt;br /&gt;
	else -- add title to navbox&lt;br /&gt;
		navboxArgs.title = config.i18n.aclink .. pencil(qid)&lt;br /&gt;
	end&lt;br /&gt;
	outString = Navbox._navbox(navboxArgs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if parentArgs.state&lt;br /&gt;
	and parentArgs.state~=&amp;#039;&amp;#039;&lt;br /&gt;
	and parentArgs.state~=config.i18n.collapsed&lt;br /&gt;
	and parentArgs.state~=config.i18n.expanded&lt;br /&gt;
	and parentArgs.state~=config.i18n.autocollapse then --invalid state parameter&lt;br /&gt;
	auxCats = auxCats .. needsAttention(&amp;#039;S&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
if testcases then&lt;br /&gt;
	auxCats = mw.ustring.gsub(auxCats, &amp;#039;(%[%[)(&amp;#039; .. config.i18n.category .. &amp;#039;)&amp;#039;, &amp;#039;%1:%2&amp;#039;) --for easier checking&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--out&lt;br /&gt;
outString = outString .. auxCats&lt;br /&gt;
if namespace~=0 then&lt;br /&gt;
	outString = mw.ustring.gsub(outString, &amp;#039;(%[%[)(&amp;#039; .. config.i18n.category .. &amp;#039;:&amp;#039; .. config.i18n.Articles .. &amp;#039;)([^%|%]]+)%|?[^%|%]]*(%]%])&amp;#039;,&amp;#039;%1:%2%3%4&amp;#039;)&lt;br /&gt;
	outString = mw.ustring.gsub(outString, &amp;#039;(%[%[)(&amp;#039; .. config.i18n.category .. &amp;#039;:&amp;#039; .. config.i18n.All_articles .. &amp;#039;)([^%|%]]+)%|?[^%|%]]*(%]%])&amp;#039;,&amp;#039;%1:%2%3%4&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
local check = require(&amp;#039;Module:Check for unknown parameters&amp;#039;)._check&lt;br /&gt;
local sortkey&lt;br /&gt;
if namespace==0 then&lt;br /&gt;
	sortkey = &amp;#039;*&amp;#039; .. title.text&lt;br /&gt;
else&lt;br /&gt;
	sortkey = title.fullText&lt;br /&gt;
end&lt;br /&gt;
outString = outString .. check({&lt;br /&gt;
	[&amp;#039;unknown&amp;#039;] = wikilink(config.i18n.category .. &amp;#039;:&amp;#039; .. config.i18n.pageswithparams, sortkey),&lt;br /&gt;
	[&amp;#039;preview&amp;#039;] = config.i18n.previewwarning, &amp;#039;show&amp;#039;, &amp;#039;country&amp;#039;, &amp;#039;suppress&amp;#039;, &amp;#039;additional&amp;#039;, &amp;#039;qid&amp;#039;, &amp;#039;state&amp;#039;&lt;br /&gt;
	}, parentArgs)&lt;br /&gt;
return outString&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makelink = function(id, qid)&lt;br /&gt;
	return _makelinks(id, qid)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>widipedia&gt;MSGJ</name></author>
	</entry>
</feed>