<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://afropedia.world/index.php?action=history&amp;feed=atom&amp;title=Module%3APortal_bar</id>
	<title>Module:Portal bar - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://afropedia.world/index.php?action=history&amp;feed=atom&amp;title=Module%3APortal_bar"/>
	<link rel="alternate" type="text/html" href="https://afropedia.world/index.php?title=Module:Portal_bar&amp;action=history"/>
	<updated>2026-05-15T10:05:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://afropedia.world/index.php?title=Module:Portal_bar&amp;diff=6383&amp;oldid=prev</id>
		<title>imported&gt;Kofi: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://afropedia.world/index.php?title=Module:Portal_bar&amp;diff=6383&amp;oldid=prev"/>
		<updated>2014-12-21T14:27:05Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{portal bar}}.&lt;br /&gt;
&lt;br /&gt;
require(&amp;#039;Module:No globals&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local buildNavbox = require( &amp;#039;Module:Navbox&amp;#039; )._navbox&lt;br /&gt;
local getImageName = require( &amp;#039;Module:Portal&amp;#039; ).image&lt;br /&gt;
local yesno = require( &amp;#039;Module:Yesno&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
-- Builds the portal bar used by {{portal bar}}.&lt;br /&gt;
function p._main( portals, args )&lt;br /&gt;
	if #portals &amp;lt; 1 then return &amp;#039;&amp;#039; end -- Don&amp;#039;t display a blank navbox if no portals were specified.&lt;br /&gt;
	local list = mw.html.create( &amp;#039;ul&amp;#039; )&lt;br /&gt;
	for _, portal in ipairs( portals ) do&lt;br /&gt;
		list&lt;br /&gt;
			:tag( &amp;#039;li&amp;#039; )&lt;br /&gt;
				:css( &amp;#039;display&amp;#039;, &amp;#039;inline&amp;#039; )&lt;br /&gt;
				:css( &amp;#039;white-space&amp;#039;, &amp;#039;nowrap&amp;#039; )&lt;br /&gt;
				:tag( &amp;#039;span&amp;#039; )&lt;br /&gt;
					:css( &amp;#039;margin&amp;#039;, &amp;#039;auto 0.5em&amp;#039; )&lt;br /&gt;
					:wikitext( string.format( &amp;#039;[[File:%s|24x21px]]&amp;#039;, getImageName{ portal } ) )&lt;br /&gt;
					:done()&lt;br /&gt;
				:tag( &amp;#039;span&amp;#039; )&lt;br /&gt;
					:css( &amp;#039;font-weight&amp;#039;, &amp;#039;bold&amp;#039; )&lt;br /&gt;
					:wikitext( string.format( &amp;#039;[[Portal:%s|%s portal]]&amp;#039;, portal, portal ) )&lt;br /&gt;
	end&lt;br /&gt;
	if yesno( args.border ) == false then -- Don&amp;#039;t display a border if args.border is &amp;quot;no&amp;quot;, &amp;quot;n&amp;quot;, &amp;quot;false&amp;quot;, 0 or false.&lt;br /&gt;
		return tostring(&lt;br /&gt;
			mw.html.create( &amp;#039;div&amp;#039; )&lt;br /&gt;
				:addClass( &amp;#039;noprint metadata&amp;#039; )&lt;br /&gt;
				:css( &amp;#039;width&amp;#039;, &amp;#039;100%&amp;#039; )&lt;br /&gt;
				:css( &amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039; )&lt;br /&gt;
				:css( &amp;#039;padding&amp;#039;, &amp;#039;1px&amp;#039; )&lt;br /&gt;
				:css( &amp;#039;font-size&amp;#039;, &amp;#039;88%&amp;#039; )&lt;br /&gt;
				:node( list )&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		return buildNavbox{&lt;br /&gt;
			navbar = &amp;#039;off&amp;#039;,&lt;br /&gt;
			bodyclass = &amp;#039;noprint&amp;#039;,&lt;br /&gt;
			list1 = tostring( list )&lt;br /&gt;
		}&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Processes external arguments and sends them to the other functions.&lt;br /&gt;
function p.main( frame )&lt;br /&gt;
	-- If called via #invoke, use the args passed into the invoking&lt;br /&gt;
	-- template, or the args passed to #invoke if any exist. Otherwise&lt;br /&gt;
	-- assume args are being passed directly in from the debug console&lt;br /&gt;
	-- or from another Lua module.&lt;br /&gt;
	local origArgs&lt;br /&gt;
	if type( frame.getParent ) == &amp;#039;function&amp;#039; then&lt;br /&gt;
		origArgs = frame:getParent().args&lt;br /&gt;
		for k, v in pairs( frame.args ) do&lt;br /&gt;
			origArgs = frame.args&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		origArgs = frame&lt;br /&gt;
	end&lt;br /&gt;
	-- Process the args to make an array of portal names that can be used with ipairs. We need to use ipairs because we want to list&lt;br /&gt;
	-- all the portals in the order they were passed to the template, but we also want to be able to deal with positional arguments&lt;br /&gt;
	-- passed explicitly, for example {{portal|2=Politics}}. The behaviour of ipairs is undefined if nil values are present, so we&lt;br /&gt;
	-- need to make sure they are all removed.&lt;br /&gt;
	local portals, args = {}, {}&lt;br /&gt;
	for k, v in pairs( origArgs ) do&lt;br /&gt;
		if type( k ) == &amp;#039;number&amp;#039; and type( v ) == &amp;#039;string&amp;#039; then -- Make sure we have no non-string portal names.&lt;br /&gt;
			if mw.ustring.find( v, &amp;#039;%S&amp;#039; ) then -- Remove blank values.&lt;br /&gt;
				table.insert( portals, k )&lt;br /&gt;
			end&lt;br /&gt;
		elseif type( k ) ~= &amp;#039;number&amp;#039; then -- Separate named arguments from portals.&lt;br /&gt;
			if type( v ) == &amp;#039;string&amp;#039; then&lt;br /&gt;
				v = mw.text.trim( v )&lt;br /&gt;
			end&lt;br /&gt;
			args[ k ] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort( portals )&lt;br /&gt;
	for i, v in ipairs( portals ) do&lt;br /&gt;
		portals[ i ] = mw.text.trim( origArgs[ v ] ) -- Swap keys with values, trimming whitespace.&lt;br /&gt;
	end&lt;br /&gt;
	return p._main( portals, args )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Kofi</name></author>
	</entry>
</feed>