<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ar">
	<id>https://3rabica.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3APortal</id>
	<title>وحدة:Portal - تاريخ المراجعة</title>
	<link rel="self" type="application/atom+xml" href="https://3rabica.org/index.php?action=history&amp;feed=atom&amp;title=%D9%88%D8%AD%D8%AF%D8%A9%3APortal"/>
	<link rel="alternate" type="text/html" href="https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Portal&amp;action=history"/>
	<updated>2026-06-05T09:23:09Z</updated>
	<subtitle>تاريخ التعديل لهذه الصفحة في الويكي</subtitle>
	<generator>MediaWiki 1.43.7</generator>
	<entry>
		<id>https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Portal&amp;diff=3577818&amp;oldid=prev</id>
		<title>عبد العزيز في 05:02، 27 أبريل 2026</title>
		<link rel="alternate" type="text/html" href="https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Portal&amp;diff=3577818&amp;oldid=prev"/>
		<updated>2026-04-27T05:02:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Portal&amp;amp;diff=3577818&amp;amp;oldid=116&quot;&gt;أظهر التعديلات&lt;/a&gt;</summary>
		<author><name>عبد العزيز</name></author>
	</entry>
	<entry>
		<id>https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Portal&amp;diff=116&amp;oldid=prev</id>
		<title>عبد العزيز: تصنيف محول وحذوف</title>
		<link rel="alternate" type="text/html" href="https://3rabica.org/index.php?title=%D9%88%D8%AD%D8%AF%D8%A9:Portal&amp;diff=116&amp;oldid=prev"/>
		<updated>2023-09-03T15:41:53Z</updated>

		<summary type="html">&lt;p&gt;تصنيف محول وحذوف&lt;/p&gt;
&lt;p&gt;&lt;b&gt;صفحة جديدة&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[==[ This module is a Lua implementation of the old {{Portal}} template.&lt;br /&gt;
-- [[Module:Portal/images/z]]		- for portal names beginning with &amp;quot;Z&amp;quot;.&lt;br /&gt;
-- [[Module:Portal/images/other]]	- for portal names beginning with any other letters. This includes numbers,&lt;br /&gt;
-- 									  letters with diacritics, and letters in non-Latin alphabets.&lt;br /&gt;
-- [[Module:Portal/images/aliases]]	- for adding aliases for existing portal names. Use this page for variations&lt;br /&gt;
-- 									  in spelling and diacritics, etc., no matter what letter the portal begins with.&lt;br /&gt;
--&lt;br /&gt;
-- The images data pages are separated by the first letter to reduce server load when images are added, changed, or removed.&lt;br /&gt;
-- Previously all the images were on one data page at [[Module:Portal/images]], but this had the disadvantage that all&lt;br /&gt;
-- 5,000,000 pages using this module needed to be refreshed every time an image was added or removed.&lt;br /&gt;
]==]&lt;br /&gt;
&lt;br /&gt;
local mPagetype = require(&amp;#039;Module:Pagetype&amp;#039;)&lt;br /&gt;
local fPagetype = mPagetype.main&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function matchImagePage(s)&lt;br /&gt;
	-- Finds the appropriate image subpage given a lower-case&lt;br /&gt;
	-- portal name plus the first letter of that portal name.&lt;br /&gt;
	if type(s) ~= &amp;#039;string&amp;#039; or #s &amp;lt; 1 then return end&lt;br /&gt;
	local firstLetter = mw.ustring.sub(s, 1, 1)&lt;br /&gt;
	local imagePage&lt;br /&gt;
	if mw.ustring.find(firstLetter, &amp;#039;^[اأإآبجدهوزحطيكلمنسعفصقرشتثخذضظغ]&amp;#039;) then&lt;br /&gt;
		imagePage = &amp;#039;Module:Portal/images/&amp;#039; .. firstLetter&lt;br /&gt;
	else&lt;br /&gt;
		imagePage = &amp;#039;Module:Portal/images/other&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return mw.loadData(imagePage)[s]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getAlias(s)&lt;br /&gt;
	-- Gets an alias from the image alias data page.&lt;br /&gt;
	local aliasData = mw.loadData(&amp;#039;Module:Portal/images/aliases&amp;#039;)&lt;br /&gt;
	for portal, aliases in pairs(aliasData) do&lt;br /&gt;
		for _, alias in ipairs(aliases) do&lt;br /&gt;
			if alias == s then&lt;br /&gt;
				return portal&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getImageName(s)&lt;br /&gt;
	-- Gets the image name for a given string.&lt;br /&gt;
	if type(s) ~= &amp;#039;string&amp;#039; or #s &amp;lt; 1 then&lt;br /&gt;
		return &amp;#039;Portal-puzzle.svg&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	s = mw.ustring.lower(s)&lt;br /&gt;
	return matchImagePage(s) or matchImagePage(getAlias(s)) or &amp;#039;Portal-puzzle.svg&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._portal(portals, args)&lt;br /&gt;
	-- This function builds the vertical portal box used by the {{بوابة}} template.&lt;br /&gt;
	local root = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;noprint portal&amp;#039;)&lt;br /&gt;
		:addClass(args.left and &amp;#039;tleft&amp;#039; or &amp;#039;tright&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;border&amp;#039;, &amp;#039;solid #aaa 1px&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;margin&amp;#039;, args.margin or (args.left == &amp;#039;yes&amp;#039; and &amp;#039;0.5em 1em 0.5em 0&amp;#039;) or &amp;#039;0.5em 0.5em 0.5em 0&amp;#039;)&lt;br /&gt;
		:newline()&lt;br /&gt;
 &lt;br /&gt;
	-- Start the table. This corresponds to the start of the wikitext table in the old [[Template:Portal]].&lt;br /&gt;
	local tableroot = root:tag(&amp;#039;table&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;background&amp;#039;, &amp;#039;#f9f9f9&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;font-size&amp;#039;, &amp;#039;85%&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;line-height&amp;#039;, &amp;#039;110%&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;max-width&amp;#039;, &amp;#039;175px&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;width&amp;#039;, type(args.boxsize) == &amp;#039;string&amp;#039; and (args.boxsize .. &amp;#039;px&amp;#039;) or nil)&lt;br /&gt;
 &lt;br /&gt;
	-- If no portals have been specified, display an error and add the page to a tracking category.&lt;br /&gt;
	if not portals[1] then&lt;br /&gt;
		root:wikitext(&amp;#039;&amp;lt;li&amp;gt;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;خطأ في استعمال [[قالب:بوابة]]: يلزم [[س:ق#وسيط فعلي|إعطاء]] [[ن:ق#وسيط شكلي|وسيط]] واحد على الأقل.&amp;lt;/strong&amp;gt;&amp;lt;/li&amp;gt;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
 	local isRedandant = false --متغير لاكتشاف البوابات المكررة في شريط البوابات&lt;br /&gt;
	local redundantPortals = &amp;quot;&amp;quot; --متغير آخر لتخزين البوابات&lt;br /&gt;
	&lt;br /&gt;
	-- Display the portals specified in the positional arguments.&lt;br /&gt;
	for _, portal in ipairs(portals) do&lt;br /&gt;
		local image = getImageName(portal)&lt;br /&gt;
		portal = getAlias(portal);&lt;br /&gt;
		&lt;br /&gt;
		if string.match(redundantPortals, &amp;quot;ااا&amp;quot; .. portal .. &amp;quot;ااا&amp;quot;) then --إذا كانت البوابة الثانية موجودة فعلا&lt;br /&gt;
			isRedandant = true&lt;br /&gt;
		else&lt;br /&gt;
			redundantPortals = redundantPortals .. &amp;quot;ااا&amp;quot; .. portal .. &amp;quot;ااا&amp;quot;&lt;br /&gt;
		-- Generate the html for the image and the portal name.&lt;br /&gt;
			tableroot&lt;br /&gt;
				:newline()&lt;br /&gt;
				:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
					:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;middle&amp;#039;)&lt;br /&gt;
					:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
						:css(&amp;#039;text-align&amp;#039;, &amp;#039;center&amp;#039;)&lt;br /&gt;
						:wikitext(string.format(&amp;#039;[[File:%s|32x28px|alt=بوابة %s|class=noviewer|link=بوابة:%s]]&amp;#039;, image, portal, portal))&lt;br /&gt;
						:done()&lt;br /&gt;
					:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
						:css(&amp;#039;padding&amp;#039;, &amp;#039;0 0.2em&amp;#039;)&lt;br /&gt;
						:css(&amp;#039;vertical-align&amp;#039;, &amp;#039;middle&amp;#039;)&lt;br /&gt;
						:css(&amp;#039;font-style&amp;#039;, &amp;#039;italic&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;[[بوابة:%s|بوابة%s%s]]&amp;#039;, portal, args[&amp;#039;break&amp;#039;] and &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; or &amp;#039; &amp;#039;, portal))&lt;br /&gt;
					:allDone()	&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if (isRedandant) then --إذا كان هناك بوابات مكررة&lt;br /&gt;
		return tostring(root) .. &amp;#039;[[تصنيف:صفحات_تحتوي_بوابات_مكررة_باستخدام_قالب_بوابة]]&amp;#039;;&lt;br /&gt;
	else&lt;br /&gt;
		return tostring(root)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._hPortal(portals, args)&lt;br /&gt;
	-- This function builds the horizontal portal box used by the {{شريط بوابات}} template.&lt;br /&gt;
	local root = mw.html.create(&amp;#039;ul&amp;#039;)&lt;br /&gt;
    if args[&amp;#039;نمط&amp;#039;] == &amp;#039;قائمة&amp;#039; then&lt;br /&gt;
               root:addClass(&amp;#039;liste-portail&amp;#039;)&lt;br /&gt;
               root:attr( &amp;#039;id&amp;#039;, &amp;#039;liste-portail&amp;#039; )&lt;br /&gt;
        else&lt;br /&gt;
               root:addClass(&amp;#039;bandeau-portail إعلام&amp;#039;)&lt;br /&gt;
               root:attr( &amp;#039;id&amp;#039;, &amp;#039;bandeau-portail&amp;#039; )&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
	-- If no portals have been specified, display an error and add the page to a tracking category.&lt;br /&gt;
	if not portals[1] then&lt;br /&gt;
		root:wikitext(&amp;#039;&amp;lt;li&amp;gt;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;خطأ في استعمال [[قالب:شريط بوابات]]: يلزم [[س:ق#وسيط فعلي|إعطاء]] [[ن:ق#وسيط شكلي|وسيط]] واحد على الأقل.&amp;lt;/strong&amp;gt;&amp;lt;/li&amp;gt;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local portalcats = &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local isRedandant = false --متغير لاكتشاف البوابات المكررة في شريط البوابات&lt;br /&gt;
	local redundantPortals = &amp;quot;&amp;quot; --متغير آخر لتخزين البوابات&lt;br /&gt;
&lt;br /&gt;
	-- Display the portals specified in the positional arguments.&lt;br /&gt;
	for _, portal in ipairs(portals) do&lt;br /&gt;
		local image = getImageName(portal)&lt;br /&gt;
		local portalname = getAlias(portal);&lt;br /&gt;
		if string.match(redundantPortals, &amp;quot;ااا&amp;quot; .. portalname .. &amp;quot;ااا&amp;quot;) then --إذا كانت البوابة الثانية موجودة فعلا&lt;br /&gt;
			isRedandant = true&lt;br /&gt;
		else --إذا لم تكن البوابة موجودة في المتغير&lt;br /&gt;
			redundantPortals = redundantPortals .. &amp;quot;ااا&amp;quot; .. portalname .. &amp;quot;ااا&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            portalcats = portalcats .. string.format(&amp;#039;[[تصنيف:بوابة %s/مقالات متعلقة]]&amp;#039;, portalname);&lt;br /&gt;
&lt;br /&gt;
			-- Generate the html for the image and the portal name.&lt;br /&gt;
			root&lt;br /&gt;
				:newline()&lt;br /&gt;
				:tag(&amp;#039;li&amp;#039;)&lt;br /&gt;
					:addClass(&amp;#039;bandeau-portail-element&amp;#039;)&lt;br /&gt;
					:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
	                    :addClass(&amp;#039;bandeau-portail-icone&amp;#039;)&lt;br /&gt;
	                    :css(&amp;#039;margin-right&amp;#039;, &amp;#039;1em&amp;#039;)&lt;br /&gt;
						:wikitext(string.format(&amp;#039;[[File:%s|32x28px|alt=أيقونة بوابة|class=noviewer|link=بوابة:%s]]&amp;#039;, image, portalname))&lt;br /&gt;
						:done()&lt;br /&gt;
					:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
						:addClass(&amp;#039;bandeau-portail-texte&amp;#039;)&lt;br /&gt;
						:wikitext(string.format(&amp;#039;[[بوابة:%s|بوابة %s]]&amp;#039;, portalname, portalname))&lt;br /&gt;
				:allDone()&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if fPagetype() == &amp;#039;مقالة&amp;#039; then&lt;br /&gt;
		portalcats = portalcats .. &amp;#039;[[تصنيف:جميع_المقالات_التي_تستخدم_شريط_بوابات]]&amp;#039;;&lt;br /&gt;
		if (isRedandant) then --إذا كان هناك بوابات مكررة&lt;br /&gt;
			portalcats = portalcats .. &amp;#039;[[تصنيف:مقالات_تحوي_بوابات_مكررة]]&amp;#039;;&lt;br /&gt;
		end&lt;br /&gt;
		return tostring(root) .. portalcats&lt;br /&gt;
	else&lt;br /&gt;
		return tostring(root)	&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._relatedPortal2(portals, args)&lt;br /&gt;
	local root = mw.html.create(&amp;#039;ul&amp;#039;)&lt;br /&gt;
        root:cssText(&amp;#039;margin:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;&amp;#039;&lt;br /&gt;
                     ..&amp;#039;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-justify-content:space-around;-ms-flex-pack:distribute;&amp;#039;&lt;br /&gt;
                     ..&amp;#039;justify-content:space-around;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;&amp;#039;&lt;br /&gt;
                     ..&amp;#039;text-align:center;font-weight:bold;list-style:none none&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
        local iconeSize = &amp;#039;60x60&amp;#039;&lt;br /&gt;
        dims = {}&lt;br /&gt;
        if args[&amp;#039;حجم&amp;#039;] then&lt;br /&gt;
           iconeSize= args[&amp;#039;حجم&amp;#039;]&lt;br /&gt;
        end&lt;br /&gt;
        local per_row = #portals&lt;br /&gt;
        if args[&amp;#039;في_سطر&amp;#039;] then&lt;br /&gt;
           per_row= tonumber(args[&amp;#039;في_سطر&amp;#039;])&lt;br /&gt;
        end&lt;br /&gt;
        local width = math.floor( 100/per_row )&lt;br /&gt;
&lt;br /&gt;
	-- If no portals have been specified, display an error and add the page to a tracking category.&lt;br /&gt;
	if not portals[1] then&lt;br /&gt;
		root:wikitext(&amp;#039;&amp;lt;li&amp;gt;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;خطأ في استعمال [[قالب:بوابات متعلقة]]: يلزم [[س:ق#وسيط فعلي|إعطاء]] [[ن:ق#وسيط شكلي|وسيط]] واحد على الأقل.&amp;lt;/strong&amp;gt;&amp;lt;/li&amp;gt;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	-- Display the portals specified in the positional arguments.&lt;br /&gt;
	for _, portal in ipairs(portals) do&lt;br /&gt;
		local image = getImageName(portal)&lt;br /&gt;
		local portalname = getAlias(portal);&lt;br /&gt;
&lt;br /&gt;
		-- Generate the html for the image and the portal name.&lt;br /&gt;
		root&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;li&amp;#039;)&lt;br /&gt;
				:cssText(&amp;#039;box-sizing:border-box;margin:0;padding:1em .5em 0;display:inline-block;min-width:9em;&amp;#039;&lt;br /&gt;
				        ..&amp;#039;width:&amp;#039;..width..&amp;#039;%;vertical-align:middle&amp;#039;)&lt;br /&gt;
				:wikitext(string.format(&amp;#039;[[File:%s|%spx|link=بوابة:%s]]&amp;#039; , image, iconeSize, portalname)) &lt;br /&gt;
				:wikitext(string.format(&amp;#039;&amp;lt;br /&amp;gt;&amp;lt;strong&amp;gt;[[بوابة:%s|%s]]&amp;lt;/strong&amp;gt;&amp;#039;, portalname, portalname))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return tostring(root)	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._relatedPortal(portals, args)&lt;br /&gt;
	-- This function builds the portal box used by the {{portal}} template.&lt;br /&gt;
	local root = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
        root:addClass(&amp;#039;related-portals&amp;#039;)&lt;br /&gt;
        root:cssText(&amp;#039;margin-right: auto; margin-left: auto; display: table;text-align:center;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
    local iconeSize = &amp;#039;65x40&amp;#039;&lt;br /&gt;
    dims = {}&lt;br /&gt;
    if args[&amp;#039;حجم&amp;#039;] then&lt;br /&gt;
           iconeSize= args[&amp;#039;حجم&amp;#039;]&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    for s in string.gmatch(iconeSize,&amp;quot;%d+&amp;quot;) do table.insert(dims,s)  end&lt;br /&gt;
    if #dims == 1 then&lt;br /&gt;
    	newWidth = dims[1]&lt;br /&gt;
    	newHeight = dims[1]&lt;br /&gt;
	else&lt;br /&gt;
		newWidth = dims[1]&lt;br /&gt;
		newHeight = dims[2]&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
	-- If no portals have been specified, display an error and add the page to a tracking category.&lt;br /&gt;
	if not portals[1] then&lt;br /&gt;
		root:wikitext(&amp;#039;&amp;lt;li&amp;gt;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;خطأ في استعمال [[قالب:بوابات متعلقة]]: يلزم [[س:ق#وسيط فعلي|إعطاء]] [[ن:ق#وسيط شكلي|وسيط]] واحد على الأقل.&amp;lt;/strong&amp;gt;&amp;lt;/li&amp;gt;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	-- Display the portals specified in the positional arguments.&lt;br /&gt;
	for _, portal in ipairs(portals) do&lt;br /&gt;
		local image = getImageName(portal)&lt;br /&gt;
		local portalname = getAlias(portal);&lt;br /&gt;
&lt;br /&gt;
		-- Generate the html for the image and the portal name.&lt;br /&gt;
		root&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				:cssText(&amp;#039;text-align:center;width:100px;height:&amp;#039;..(newHeight+90)..&amp;#039;px;display:inline-block;&amp;#039;)&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
                    :cssText(&amp;#039;height:&amp;#039;..newHeight..&amp;#039;px;padding:8px 2px&amp;#039;)&lt;br /&gt;
					:wikitext(string.format(&amp;#039;[[File:%s|%spx|link=بوابة:%s]]&amp;#039; , image, iconeSize, portalname)) &lt;br /&gt;
					:done()&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					:cssText(&amp;#039;height:90px;padding:8px&amp;#039;)&lt;br /&gt;
					:wikitext(string.format(&amp;#039;&amp;lt;strong&amp;gt;[[بوابة:%s|%s]]&amp;lt;/strong&amp;gt;&amp;#039;, portalname, portalname))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return tostring(root)		&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._simplePortal(portals, args)&lt;br /&gt;
	-- If no portals have been specified, display an error and add the page to a tracking category.&lt;br /&gt;
	if not portals[1] then&lt;br /&gt;
		root:wikitext(&amp;#039;&amp;lt;li&amp;gt;&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;خطأ في استعمال [[قالب:بوابة بسيط]]: يلزم [[س:ق#وسيط فعلي|إعطاء]] [[ن:ق#وسيط شكلي|وسيط]] واحد فقط.&amp;lt;/strong&amp;gt;&amp;lt;/li&amp;gt;&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local image = getImageName(portals[1])&lt;br /&gt;
	local portalname = getAlias(portals[1]);&lt;br /&gt;
	return string.format(&amp;#039;[[File:%s|20px|link=بوابة:%s]]&amp;amp;nbsp;[[بوابة:%s|بوابة %s]]&amp;#039;, image, portalname, portalname, portalname)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._image(portals)&lt;br /&gt;
&lt;br /&gt;
	-- Wrapper function to allow getImageName() to be accessed through #invoke.&lt;br /&gt;
	return getImageName(portals[1])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getAllImageTables()&lt;br /&gt;
	-- Returns an array containing all image subpages (minus aliases) as loaded by mw.loadData.&lt;br /&gt;
	local images = {}&lt;br /&gt;
	for i, subpage in ipairs{&amp;#039;ا&amp;#039;, &amp;#039;أ&amp;#039;, &amp;#039;إ&amp;#039;, &amp;#039;آ&amp;#039;, &amp;#039;ب&amp;#039;, &amp;#039;ج&amp;#039;, &amp;#039;د&amp;#039;, &amp;#039;ه&amp;#039;, &amp;#039;و&amp;#039;, &amp;#039;ز&amp;#039;, &amp;#039;ح&amp;#039;, &amp;#039;ط&amp;#039;, &amp;#039;ي&amp;#039;, &amp;#039;ك&amp;#039;, &amp;#039;ل&amp;#039;, &amp;#039;م&amp;#039;, &amp;#039;ن&amp;#039;, &amp;#039;س&amp;#039;, &amp;#039;ع&amp;#039;, &amp;#039;ف&amp;#039;, &amp;#039;ص&amp;#039;, &amp;#039;ق&amp;#039;, &amp;#039;ر&amp;#039;, &amp;#039;ش&amp;#039;, &amp;#039;ت&amp;#039;, &amp;#039;ث&amp;#039;, &amp;#039;خ&amp;#039;, &amp;#039;ذ&amp;#039;, &amp;#039;ض&amp;#039;, &amp;#039;ظ&amp;#039;, &amp;#039;غ&amp;#039;, &amp;#039;other&amp;#039;} do&lt;br /&gt;
		images[i] = mw.loadData(&amp;#039;Module:Portal/images/&amp;#039; .. subpage)&lt;br /&gt;
	end&lt;br /&gt;
	return images&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._displayAll(portals, args)&lt;br /&gt;
	-- This function displays all portals that have portal images. This function is for maintenance purposes and should not be used in&lt;br /&gt;
	-- articles, for two reasons: 1) there are over 1500 portals with portal images, and 2) the module doesn&amp;#039;t record how the portal&lt;br /&gt;
	-- names are capitalized, so the portal links may be broken.&lt;br /&gt;
	local lang = mw.language.getContentLanguage()&lt;br /&gt;
	local count = 1&lt;br /&gt;
	for _, imageTable in ipairs(getAllImageTables()) do&lt;br /&gt;
		for portal in pairs(imageTable) do&lt;br /&gt;
			portals[count] = lang:ucfirst(portal)&lt;br /&gt;
			count = count + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return p._hPortal(portals, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._display1Table(portals, args)&lt;br /&gt;
	-- This function displays all portals that have portal images from one table. &lt;br /&gt;
	local lang = mw.language.getContentLanguage()&lt;br /&gt;
	local firstLetter = portals[1]&lt;br /&gt;
	local imagePage&lt;br /&gt;
        local imageTable&lt;br /&gt;
	if mw.ustring.find(firstLetter, &amp;#039;^[اأإآبجدهوزحطيكلمنسعفصقرشتثخذضظغ]&amp;#039;) then&lt;br /&gt;
		imagePage = &amp;#039;Module:Portal/images/&amp;#039; .. firstLetter&lt;br /&gt;
	else&lt;br /&gt;
		imagePage = &amp;#039;Module:Portal/images/other&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	local count = 1&lt;br /&gt;
        imageTable = mw.loadData(imagePage)&lt;br /&gt;
	for portal in pairs(imageTable) do&lt;br /&gt;
			portals[count] = lang:ucfirst(portal)&lt;br /&gt;
			count = count + 1&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return p._relatedPortal(portals, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._imageDupes()&lt;br /&gt;
	-- This function searches the image subpages to find duplicate images. If duplicate images exist, it is not necessarily a bad thing,&lt;br /&gt;
	-- as different portals might just happen to choose the same image. However, this function is helpful in identifying images that&lt;br /&gt;
	-- should be moved to a portal alias for ease of maintenance.&lt;br /&gt;
	local exists, dupes = {}, {}&lt;br /&gt;
	for _, imageTable in ipairs(getAllImageTables()) do&lt;br /&gt;
		for portal, image in pairs(imageTable) do&lt;br /&gt;
			if not exists[image] then&lt;br /&gt;
				exists[image] = portal&lt;br /&gt;
			else&lt;br /&gt;
				table.insert(dupes, string.format(&amp;#039;The image &amp;quot;[[:File:%s|%s]]&amp;quot; is used for both portals &amp;quot;%s&amp;quot; and &amp;quot;%s&amp;quot;.&amp;#039;, image, image, exists[image], portal))&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if #dupes &amp;lt; 1 then&lt;br /&gt;
		return &amp;#039;No duplicate images found.&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;The following duplicate images were found:\n* &amp;#039; .. table.concat(dupes, &amp;#039;\n* &amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function processPortalArgs(args)&lt;br /&gt;
	-- This function processes a table of arguments and returns two tables: an array of portal names for processing by ipairs, and a table of&lt;br /&gt;
	-- the named arguments that specify style options, etc. We need to use ipairs because we want to list all the portals in the order&lt;br /&gt;
	-- they were passed to the template, but we also want to be able to deal with positional arguments passed explicitly, for example&lt;br /&gt;
	-- {{portal|2=Politics}}. The behaviour of ipairs is undefined if nil values are present, so we need to make sure they are all removed.&lt;br /&gt;
	args = type(args) == &amp;#039;table&amp;#039; and args or {}&lt;br /&gt;
	local portals = {}&lt;br /&gt;
	local namedArgs = {}&lt;br /&gt;
	for k, v in pairs(args) 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;
			table.insert(portals, k)&lt;br /&gt;
		elseif type(k) ~= &amp;#039;number&amp;#039; then&lt;br /&gt;
			namedArgs[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] = args[v]&lt;br /&gt;
	end&lt;br /&gt;
	return portals, namedArgs&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeWrapper(funcName)&lt;br /&gt;
	-- Processes external arguments and sends them to the other functions.&lt;br /&gt;
	return function (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;
		-- Trim whitespace and remove blank arguments.&lt;br /&gt;
		local args = {}&lt;br /&gt;
		for k, v in pairs(origArgs) do&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;
			if v ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				args[k] = v&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return p[funcName](processPortalArgs(args)) -- passes two tables to func: an array of portal names, and a table of named arguments.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
for _, funcName in ipairs{&amp;#039;portal&amp;#039;,&amp;#039;hPortal&amp;#039;, &amp;#039;relatedPortal&amp;#039;, &amp;#039;relatedPortal2&amp;#039;, &amp;#039;image&amp;#039;, &amp;#039;imageDupes&amp;#039;, &amp;#039;displayAll&amp;#039;, &amp;#039;display1Table&amp;#039;, &amp;#039;simplePortal&amp;#039;} do&lt;br /&gt;
	p[funcName] = makeWrapper(&amp;#039;_&amp;#039; .. funcName)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>عبد العزيز</name></author>
	</entry>
</feed>