<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl">
	<id>https://bajkowscy.pl/mw22/index.php?action=history&amp;feed=atom&amp;title=Modu%C5%82%3ADopracowa%C4%87</id>
	<title>Moduł:Dopracować - Historia wersji</title>
	<link rel="self" type="application/atom+xml" href="https://bajkowscy.pl/mw22/index.php?action=history&amp;feed=atom&amp;title=Modu%C5%82%3ADopracowa%C4%87"/>
	<link rel="alternate" type="text/html" href="https://bajkowscy.pl/mw22/index.php?title=Modu%C5%82:Dopracowa%C4%87&amp;action=history"/>
	<updated>2026-04-21T17:07:00Z</updated>
	<subtitle>Historia wersji tej strony wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://bajkowscy.pl/mw22/index.php?title=Modu%C5%82:Dopracowa%C4%87&amp;diff=238&amp;oldid=prev</id>
		<title>Admin: 1 wersja</title>
		<link rel="alternate" type="text/html" href="https://bajkowscy.pl/mw22/index.php?title=Modu%C5%82:Dopracowa%C4%87&amp;diff=238&amp;oldid=prev"/>
		<updated>2016-06-21T08:37:39Z</updated>

		<summary type="html">&lt;p&gt;1 wersja&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nowa strona&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local resources = mw.loadData( &amp;#039;Moduł:Dopracować/resources&amp;#039; )&lt;br /&gt;
return {&lt;br /&gt;
	test = function(frame)&lt;br /&gt;
		local pf = frame:getParent()&lt;br /&gt;
		&lt;br /&gt;
		-- scan reasons without dates&lt;br /&gt;
		local sectionParamIndex = resources.data.sectionParamIndex&lt;br /&gt;
		local sectionParamValue = resources.data.sectionParamValue&lt;br /&gt;
		for i = 1, 10 do&lt;br /&gt;
			local object = pf:getArgument(i)&lt;br /&gt;
			if object then&lt;br /&gt;
				local reason = object:expand()&lt;br /&gt;
				if reason and ((i ~= sectionParamIndex) or (reason ~= sectionParamValue)) then&lt;br /&gt;
					if #mw.text.trim(reason) &amp;gt; 0 then&lt;br /&gt;
						return &amp;quot;true&amp;quot;&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	&lt;br /&gt;
		-- scan well known reasons with optional date&lt;br /&gt;
		for _, v in ipairs(resources.reasons) do&lt;br /&gt;
			for _, k in ipairs(v.aliases) do&lt;br /&gt;
				local object = pf:getArgument(k)&lt;br /&gt;
				if object then&lt;br /&gt;
					local currentDate = object:expand()&lt;br /&gt;
					if currentDate then&lt;br /&gt;
						return &amp;quot;true&amp;quot;&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	&lt;br /&gt;
		return nil&lt;br /&gt;
	end,&lt;br /&gt;
	&lt;br /&gt;
	icon = function(frame)&lt;br /&gt;
		local pf = frame:getParent()&lt;br /&gt;
 &lt;br /&gt;
		local onlyReason = nil&lt;br /&gt;
 &lt;br /&gt;
		local mapParamToReason = {}&lt;br /&gt;
		for i, v in ipairs(resources.reasons) do&lt;br /&gt;
			for _, a in ipairs(v.aliases) do&lt;br /&gt;
				mapParamToReason[a] = i&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
 &lt;br /&gt;
		-- scan well known reasons with date&lt;br /&gt;
		for k, i in pairs(mapParamToReason) do&lt;br /&gt;
			local object = pf:getArgument(k)&lt;br /&gt;
			if object then&lt;br /&gt;
				local currentDate = object:expand()&lt;br /&gt;
				if currentDate then&lt;br /&gt;
					if not onlyReason then&lt;br /&gt;
						onlyReason = i&lt;br /&gt;
					elseif onlyReason ~= i then&lt;br /&gt;
						onlyReason = 0&lt;br /&gt;
						break&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
 &lt;br /&gt;
		-- scan reasons without dates&lt;br /&gt;
		if not onlyReason then&lt;br /&gt;
			for i = 1, 10 do&lt;br /&gt;
				local object = pf:getArgument(i)&lt;br /&gt;
				if object then&lt;br /&gt;
					local reason = object:expand()&lt;br /&gt;
					if reason and ((i ~= resources.data.sectionParamIndex) or (reason ~= resources.data.sectionParamValue)) then&lt;br /&gt;
						if mw.text.trim(reason) ~= &amp;quot;&amp;quot; then&lt;br /&gt;
							local known = mapParamToReason[reason]&lt;br /&gt;
							if known then&lt;br /&gt;
								if not onlyReason then&lt;br /&gt;
									onlyReason = known&lt;br /&gt;
								elseif onlyReason ~= known then&lt;br /&gt;
									onlyReason = 0&lt;br /&gt;
									break&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
 &lt;br /&gt;
		local icon = nil&lt;br /&gt;
		if onlyReason then&lt;br /&gt;
			local reasonData = resources.reasons[onlyReason]&lt;br /&gt;
			if reasonData then&lt;br /&gt;
				icon = reasonData.icon&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
 &lt;br /&gt;
		return icon or resources.default.icon&lt;br /&gt;
	end,&lt;br /&gt;
&lt;br /&gt;
	text = function(frame)&lt;br /&gt;
		local title = mw.title.getCurrentTitle()&lt;br /&gt;
		local pf = frame:getParent()&lt;br /&gt;
		local defaultDate = pf.args[resources.data.defaultDateIndex] or &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
		local complexCategories = {&lt;br /&gt;
			categories = function(result, date)&lt;br /&gt;
				local switch = title.nsText&lt;br /&gt;
--				if (switch == &amp;quot;Pomoc&amp;quot;) or (switch == &amp;quot;Wikipedia&amp;quot;) or (switch == &amp;quot;Portal&amp;quot;) or (switch == &amp;quot;Wikiproject&amp;quot;) then&lt;br /&gt;
--					table.insert(result, &amp;quot;[[Kategoria:WP?|&amp;quot;..title.text..&amp;quot;]]&amp;quot;)&lt;br /&gt;
--				else&lt;br /&gt;
				if switch == &amp;quot;Kategoria&amp;quot; then&lt;br /&gt;
					table.insert(result, &amp;quot;[[Kategoria:?|&amp;quot;..title.text..&amp;quot;]]&amp;quot;)&lt;br /&gt;
				elseif title.namespace == 0 then&lt;br /&gt;
					table.insert(result, &amp;quot;[[Kategoria:?]]&amp;quot;)&lt;br /&gt;
				end&lt;br /&gt;
			end,&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		function prepareTemplates(reason, date, section, comments)&lt;br /&gt;
			local c = reason[&amp;quot;?&amp;quot;] or {}&lt;br /&gt;
			local sourceTemplates = section and resources.sectionTemplates or ((title.namespace == 0) and resources.articleTemplates or resources.otherTemplates)&lt;br /&gt;
&lt;br /&gt;
			local templates = {}&lt;br /&gt;
			for k, v in pairs(sourceTemplates) do&lt;br /&gt;
				templates[k] = v&lt;br /&gt;
			end&lt;br /&gt;
&lt;br /&gt;
			templates[resources.data.dateTemplate] = date or &amp;quot;&amp;quot;&lt;br /&gt;
			if title.talkPageTitle then&lt;br /&gt;
				templates[resources.data.talkNameTemplate] = title.talkPageTitle.fullText&lt;br /&gt;
			end&lt;br /&gt;
			&lt;br /&gt;
			templates[&amp;quot;{{FULLPAGENAMEE}}&amp;quot;] = mw.uri.encode(title.fullText, &amp;quot;WIKI&amp;quot;)&lt;br /&gt;
			templates[&amp;quot;{{PAGENAMEE}}&amp;quot;] = mw.uri.encode(title.text, &amp;quot;WIKI&amp;quot;)&lt;br /&gt;
			templates[&amp;quot;{{BASEPAGENAMEE}}&amp;quot;] = mw.uri.encode(title.baseText, &amp;quot;WIKI&amp;quot;)&lt;br /&gt;
			templates[&amp;quot;{{SUBPAGENAMEE}}&amp;quot;] = mw.uri.encode(title.subpageText, &amp;quot;WIKI&amp;quot;)&lt;br /&gt;
			templates[&amp;quot;{{FULLPAGENAME}}&amp;quot;] = title.fullText&lt;br /&gt;
			templates[&amp;quot;{{PAGENAME}}&amp;quot;] = title.text&lt;br /&gt;
			templates[&amp;quot;{{BASEPAGENAME}}&amp;quot;] = title.baseText&lt;br /&gt;
			templates[&amp;quot;{{SUBPAGENAME}}&amp;quot;] = title.subpageText&lt;br /&gt;
			templates[resources.data.pageUrlTemplate] = title:fullUrl()&lt;br /&gt;
 			templates[resources.data.talkSectionTemplate] = pf.args[resources.data.talkPageSectionParamIndex] or &amp;quot;&amp;quot;&lt;br /&gt;
			local defaultComment, _ = string.gsub(c.default or &amp;quot;&amp;quot;, resources.data.templatePattern, templates)&lt;br /&gt;
			templates[resources.data.infoTemplate] = #comments &amp;gt; 0 and ((c.prefix or &amp;quot;&amp;quot;)..table.concat(comments, c.separator or &amp;quot;, &amp;quot;)..(c.suffix or &amp;quot;&amp;quot;)) or defaultComment&lt;br /&gt;
&lt;br /&gt;
			-- prepare &amp;quot;talk&amp;quot; hint&lt;br /&gt;
			local talk = &amp;quot;&amp;quot;&lt;br /&gt;
			if title.talkPageTitle and title.talkPageTitle.exists then&lt;br /&gt;
				talk, _ = string.gsub(reason.talk or &amp;quot;&amp;quot;, resources.data.templatePattern, templates)&lt;br /&gt;
			end&lt;br /&gt;
			templates[resources.data.talkTemplate] = talk&lt;br /&gt;
			return templates&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local mapParamToReason = {}&lt;br /&gt;
		for i, v in ipairs(resources.reasons) do&lt;br /&gt;
			for _, a in ipairs(v.aliases) do&lt;br /&gt;
				mapParamToReason[a] = i&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local reasonDates = {}&lt;br /&gt;
&lt;br /&gt;
		-- scan well known reasons with date&lt;br /&gt;
		for k, i in pairs(mapParamToReason) do&lt;br /&gt;
			local object = pf:getArgument(k)&lt;br /&gt;
			if object then&lt;br /&gt;
				local currentDate = object:expand()&lt;br /&gt;
				if currentDate then&lt;br /&gt;
					local previousDate = reasonDates[i]&lt;br /&gt;
					if not previousDate or (previousDate == &amp;quot;&amp;quot;) or ((currentDate ~= &amp;quot;&amp;quot;) and (currentDate &amp;lt; previousDate)) then&lt;br /&gt;
						reasonDates[i] = currentDate&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local onlyReason = nil&lt;br /&gt;
		local allMessages = {}&lt;br /&gt;
		local customMessages = {}&lt;br /&gt;
&lt;br /&gt;
		-- collect messages with dates&lt;br /&gt;
		for i, v in ipairs(resources.reasons) do&lt;br /&gt;
			local date = reasonDates[i]&lt;br /&gt;
			if date then&lt;br /&gt;
				table.insert(allMessages, (#date &amp;gt; 0) and string.format(resources.data.messageWithDatePrefix, date, v.message) or v.message)&lt;br /&gt;
				if not onlyReason then&lt;br /&gt;
					onlyReason = i&lt;br /&gt;
				else&lt;br /&gt;
					onlyReason = 0&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- scan reasons without dates&lt;br /&gt;
		local scanReasonWithoutDate = function(index)&lt;br /&gt;
			local object = pf:getArgument(index)&lt;br /&gt;
			if object then&lt;br /&gt;
				local reason = object:expand()&lt;br /&gt;
				if reason then&lt;br /&gt;
					reason = mw.text.trim(reason)&lt;br /&gt;
					if (index ~= resources.data.sectionParamIndex) or (reason ~= resources.data.sectionParamValue) then&lt;br /&gt;
						if #reason &amp;gt; 0 then&lt;br /&gt;
							local known = mapParamToReason[reason]&lt;br /&gt;
							if not known then&lt;br /&gt;
								table.insert(allMessages, reason)&lt;br /&gt;
								table.insert(customMessages, reason)&lt;br /&gt;
							else&lt;br /&gt;
								if not onlyReason then&lt;br /&gt;
									onlyReason = known&lt;br /&gt;
								elseif onlyReason ~= known then&lt;br /&gt;
									onlyReason = 0&lt;br /&gt;
								end&lt;br /&gt;
								if not reasonDates[known] then&lt;br /&gt;
									reasonDates[known] = defaultDate&lt;br /&gt;
									local v = resources.reasons[known].message&lt;br /&gt;
									table.insert(allMessages, (#defaultDate &amp;gt; 0) and string.format(resources.data.messageWithDatePrefix, defaultDate, v) or v)&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				return reason&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local sectionParam = scanReasonWithoutDate(resources.data.sectionParamValue)&lt;br /&gt;
		for i = 1, 10 do&lt;br /&gt;
			scanReasonWithoutDate(i)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- collect categories&lt;br /&gt;
		local categories = {}&lt;br /&gt;
		for i, v in ipairs(resources.reasons) do&lt;br /&gt;
			local date = reasonDates[i]&lt;br /&gt;
			if date and v.cat then&lt;br /&gt;
				local complexCat = complexCategories[v.cat]&lt;br /&gt;
				if complexCat then&lt;br /&gt;
					complexCat(categories, date)&lt;br /&gt;
				elseif title.namespace == 0 then&lt;br /&gt;
					table.insert(categories, (v.catDate and (#date &amp;gt; 0)) and string.format(v.catDate, date) or v.cat)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
 &lt;br /&gt;
		if (#categories == 0) and (title.namespace == 0) then&lt;br /&gt;
			table.insert(categories, resources.data.defaultCategory)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- prepare date hints&lt;br /&gt;
		local hints = {}&lt;br /&gt;
		local currentDate = nil&lt;br /&gt;
		for i, v in ipairs(resources.reasons) do&lt;br /&gt;
			local date = reasonDates[i]&lt;br /&gt;
			if date and (#date == 0) and v.catDate then&lt;br /&gt;
				if not currentDate then&lt;br /&gt;
					currentDate = mw.getContentLanguage():formatDate(resources.data.dateFormat, nil, true)&lt;br /&gt;
				end&lt;br /&gt;
				table.insert(hints, string.format(resources.data.dateExample, v.aliases[1], currentDate))&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	 	local result = {}&lt;br /&gt;
		local section = (pf.args[resources.data.sectionParamIndex] == resources.data.sectionParamValue) or sectionParam&lt;br /&gt;
		local onlyReasonData = resources.reasons[onlyReason]&lt;br /&gt;
		local mainText = nil&lt;br /&gt;
		local templates = {}&lt;br /&gt;
		if onlyReasonData and onlyReasonData.simple and ((#customMessages == 0) or onlyReasonData[&amp;quot;?&amp;quot;]) then&lt;br /&gt;
			local date = reasonDates[onlyReason]&lt;br /&gt;
			if #date &amp;gt; 0 then&lt;br /&gt;
				date = string.format(resources.data.dateInfix, date)&lt;br /&gt;
			end&lt;br /&gt;
			templates = prepareTemplates(onlyReasonData, date, section, customMessages)&lt;br /&gt;
			mainText, _ = string.gsub(onlyReasonData.simple, resources.data.templatePattern, templates)&lt;br /&gt;
		end&lt;br /&gt;
		if not mainText and not onlyReason then&lt;br /&gt;
			local date = pf.args[resources.data.defaultDateIndex] or &amp;quot;&amp;quot;&lt;br /&gt;
			if #date &amp;gt; 0 then&lt;br /&gt;
				date = string.format(resources.data.dateInfix, date)&lt;br /&gt;
			end&lt;br /&gt;
			templates = prepareTemplates(resources.default, date, section, customMessages)&lt;br /&gt;
			mainText, _ = string.gsub(resources.default.simple, resources.data.templatePattern, templates)&lt;br /&gt;
		end&lt;br /&gt;
		if not mainText then&lt;br /&gt;
			templates = prepareTemplates(resources.default, &amp;quot;&amp;quot;, section, allMessages)&lt;br /&gt;
			mainText, _ = string.gsub(resources.default.message, resources.data.templatePattern, templates)&lt;br /&gt;
 		end&lt;br /&gt;
&lt;br /&gt;
		table.insert(result, mainText)&lt;br /&gt;
	 	table.insert(result, table.concat(categories,&amp;quot;&amp;quot;))&lt;br /&gt;
	 	if title.talkPageTitle and title.talkPageTitle.exists and ((#templates[resources.data.talkTemplate] == 0) or (#templates[resources.data.talkSectionTemplate] &amp;gt; 0))  then&lt;br /&gt;
	 		local talkPageMessage, _ = string.gsub((#templates[resources.data.talkSectionTemplate] == 0) and resources.data.talkPage or resources.data.talkSection, resources.data.templatePattern, templates)&lt;br /&gt;
 			table.insert(result, talkPageMessage)&lt;br /&gt;
	 	end&lt;br /&gt;
&lt;br /&gt;
	 	local articleInstruction, _ = string.gsub(resources.data.articleInstruction, resources.data.templatePattern, templates)&lt;br /&gt;
	 	table.insert(result, articleInstruction)&lt;br /&gt;
		if #hints &amp;gt; 0 then&lt;br /&gt;
		 	table.insert(result, string.format(resources.data.templateInstruction, table.concat(hints, &amp;quot;, &amp;quot;)))&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		return table.concat(result, &amp;quot;&amp;quot;)&lt;br /&gt;
	end,&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>