<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.railos.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtection_banner%2Fdocumentation</id>
	<title>Module:Protection banner/documentation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.railos.org/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtection_banner%2Fdocumentation"/>
	<link rel="alternate" type="text/html" href="https://wiki.railos.org/index.php?title=Module:Protection_banner/documentation&amp;action=history"/>
	<updated>2026-04-06T04:55:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.railos.org/index.php?title=Module:Protection_banner/documentation&amp;diff=3780&amp;oldid=prev</id>
		<title>Krizar: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.railos.org/index.php?title=Module:Protection_banner/documentation&amp;diff=3780&amp;oldid=prev"/>
		<updated>2023-03-11T16:31:50Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:31, 11 March 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&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>Krizar</name></author>
	</entry>
	<entry>
		<id>https://wiki.railos.org/index.php?title=Module:Protection_banner/documentation&amp;diff=3779&amp;oldid=prev</id>
		<title>wiki&gt;Jackmcbarn: Middleclass is way overkill here</title>
		<link rel="alternate" type="text/html" href="https://wiki.railos.org/index.php?title=Module:Protection_banner/documentation&amp;diff=3779&amp;oldid=prev"/>
		<updated>2016-03-21T01:07:12Z</updated>

		<summary type="html">&lt;p&gt;Middleclass is way overkill here&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module generates documentation for [[Module:Protection banner]].&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Documentation class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Documentation = {}&lt;br /&gt;
Documentation.__index = Documentation&lt;br /&gt;
&lt;br /&gt;
function Documentation:new(mainCfg, docCfg)&lt;br /&gt;
	return setmetatable({&lt;br /&gt;
		_mainCfg = mainCfg,&lt;br /&gt;
		_docCfg = docCfg&lt;br /&gt;
	}, self)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Documentation:makeReasonTable()&lt;br /&gt;
	-- Get the data from the cfg.banners table.&lt;br /&gt;
	local rowData = {}&lt;br /&gt;
	for action, reasonTables in pairs(self._mainCfg.banners) do&lt;br /&gt;
		for reason, t in pairs(reasonTables) do&lt;br /&gt;
			rowData[#rowData + 1] = {&lt;br /&gt;
				reason = reason,&lt;br /&gt;
				action = action,&lt;br /&gt;
				description = t.description&lt;br /&gt;
			}&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Sort the table into alphabetical order, first by action and then by&lt;br /&gt;
	-- reason.&lt;br /&gt;
	table.sort(rowData, function (t1, t2)&lt;br /&gt;
		if t1.action == t2.action then&lt;br /&gt;
			return t1.reason &amp;lt; t2.reason&lt;br /&gt;
		else&lt;br /&gt;
			return t1.action &amp;lt; t2.action&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
	&lt;br /&gt;
	-- Assemble a wikitable of the data.&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	ret[#ret + 1] = &amp;#039;{| class=&amp;quot;wikitable&amp;quot;&amp;#039;&lt;br /&gt;
	if #rowData &amp;lt; 1 then&lt;br /&gt;
		ret[#ret + 1] = &amp;#039;|-&amp;#039;&lt;br /&gt;
		ret[#ret + 1] = string.format(&lt;br /&gt;
			&amp;#039;| colspan=&amp;quot;3&amp;quot; | %s&amp;#039;,&lt;br /&gt;
			self._docCfg[&amp;#039;documentation-blurb-noreasons&amp;#039;]&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		-- Header&lt;br /&gt;
		ret[#ret + 1] = &amp;#039;|-&amp;#039;&lt;br /&gt;
		ret[#ret + 1] = string.format(&lt;br /&gt;
			&amp;#039;! %s\n! %s\n! %s&amp;#039;,&lt;br /&gt;
			self._docCfg[&amp;#039;documentation-heading-reason&amp;#039;],&lt;br /&gt;
			self._docCfg[&amp;#039;documentation-heading-action&amp;#039;],&lt;br /&gt;
			self._docCfg[&amp;#039;documentation-heading-description&amp;#039;]&lt;br /&gt;
		)&lt;br /&gt;
		-- Rows&lt;br /&gt;
		for _, t in ipairs(rowData) do&lt;br /&gt;
			ret[#ret + 1] = &amp;#039;|-&amp;#039;&lt;br /&gt;
			ret[#ret + 1] = string.format(&lt;br /&gt;
				&amp;#039;| %s\n| %s\n| %s&amp;#039;,&lt;br /&gt;
				t.reason,&lt;br /&gt;
				t.action,&lt;br /&gt;
				t.description or &amp;#039;&amp;#039;&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	ret[#ret + 1] = &amp;#039;|}&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(ret, &amp;#039;\n&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Exports&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.reasonTable()&lt;br /&gt;
	local mainCfg = require(&amp;#039;Module:Protection banner/config&amp;#039;)&lt;br /&gt;
	local docCfg = require(&amp;#039;Module:Protection banner/documentation/config&amp;#039;)&lt;br /&gt;
	local documentationObj = Documentation:new(mainCfg, docCfg)&lt;br /&gt;
	return documentationObj:makeReasonTable()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wiki&gt;Jackmcbarn</name></author>
	</entry>
</feed>