<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://dansunegalaxie.ca/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtection</id>
	<title>Module:Protection - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://dansunegalaxie.ca/index.php?action=history&amp;feed=atom&amp;title=Module%3AProtection"/>
	<link rel="alternate" type="text/html" href="https://dansunegalaxie.ca/index.php?title=Module:Protection&amp;action=history"/>
	<updated>2026-04-05T04:27:21Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://dansunegalaxie.ca/index.php?title=Module:Protection&amp;diff=149&amp;oldid=prev</id>
		<title>Yuki : 1 version importée : Infobox</title>
		<link rel="alternate" type="text/html" href="https://dansunegalaxie.ca/index.php?title=Module:Protection&amp;diff=149&amp;oldid=prev"/>
		<updated>2023-11-15T07:11:06Z</updated>

		<summary type="html">&lt;p&gt;1 version importée : Infobox&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;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 15 novembre 2023 à 03:11&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key dugwiki:diff::1.12:old-148:rev-149 --&gt;
&lt;/table&gt;</summary>
		<author><name>Yuki</name></author>
	</entry>
	<entry>
		<id>https://dansunegalaxie.ca/index.php?title=Module:Protection&amp;diff=148&amp;oldid=prev</id>
		<title>wikipedia&gt;Od1n : le trim n&#039;est nécessaire que pour les paramètres non nommés (en plus, là ça faisait faux positif si la valeur contenait des espaces et rien d&#039;autre)&amp;nbsp;; en passant, c&#039;est bien error-prone ce cas particulier «&amp;nbsp;nsdoc == &lt;chaîne vide&gt;&amp;nbsp;»…</title>
		<link rel="alternate" type="text/html" href="https://dansunegalaxie.ca/index.php?title=Module:Protection&amp;diff=148&amp;oldid=prev"/>
		<updated>2021-08-28T11:56:33Z</updated>

		<summary type="html">&lt;p&gt;le trim n&amp;#039;est nécessaire que pour les paramètres non nommés (en plus, là ça faisait faux positif si la valeur contenait des espaces et rien d&amp;#039;autre) ; en passant, c&amp;#039;est bien error-prone ce cas particulier « nsdoc == &amp;lt;chaîne vide&amp;gt; »…&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Ce module implémente les modèles {{Protection}}, {{Semi-protection étendue}}, {{Semi-protection}}, {{Semi-protection longue}} et {{Nom protégé}}.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Chargement du module de données.&lt;br /&gt;
local donnees = mw.loadData(&amp;#039;Module:Protection/Données&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- Définition des tables de données.&lt;br /&gt;
local types = donnees.types&lt;br /&gt;
local cfg = donnees.configuration&lt;br /&gt;
&lt;br /&gt;
--Redéfinitions utiles.&lt;br /&gt;
local format = mw.ustring.format&lt;br /&gt;
local insert = table.insert&lt;br /&gt;
&lt;br /&gt;
local function protectionPage(typeProtection, modeProtection, titrePage)&lt;br /&gt;
	-- Retourne vrai si la page courante est protégée et correspond&lt;br /&gt;
	-- au type de protection.&lt;br /&gt;
	local action = types[typeProtection].action or &amp;#039;edit&amp;#039;&lt;br /&gt;
	local niveau = titrePage.protectionLevels[action] and titrePage.protectionLevels[action][1]&lt;br /&gt;
	return modeProtection.niveau == niveau&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function estSousPage(titrePage)&lt;br /&gt;
	-- Teste si la page actuelle est une sous-page /Documentation,&lt;br /&gt;
	-- /Bac à sable ou /Test de modèle ou de module. Retourne vrai&lt;br /&gt;
	-- si c&amp;#039;est le cas et faux sinon.&lt;br /&gt;
	local espaceNom = titrePage.nsText == &amp;#039;Modèle&amp;#039; or titrePage.nsText == &amp;#039;Module&amp;#039;&lt;br /&gt;
	local sousPage = titrePage.isSubpage and &lt;br /&gt;
		(titrePage.subpageText == &amp;#039;Documentation&amp;#039;&lt;br /&gt;
		or titrePage.subpageText == &amp;#039;Bac à sable&amp;#039;&lt;br /&gt;
		or titrePage.subpageText == &amp;#039;Test&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
	return espaceNom and sousPage&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
local function creerIconeTitre(modeProtection)&lt;br /&gt;
	local iconeTitre = require(&amp;#039;Module:Icône de titre&amp;#039;)._main&lt;br /&gt;
	local argsIcone = {&lt;br /&gt;
		image  = modeProtection.image,&lt;br /&gt;
		lien   = modeProtection.lien,&lt;br /&gt;
		texte  = modeProtection.texte,&lt;br /&gt;
		taille = 15,&lt;br /&gt;
		id     = modeProtection.id or &amp;#039;protection-edition&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
 &lt;br /&gt;
	return iconeTitre(argsIcone)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function insertionCategorie(typeProtection, nsPage)&lt;br /&gt;
	local nomCategorie = typeProtection.categorie[nsPage]&lt;br /&gt;
	local defautCategorie = typeProtection.categorie[&amp;#039;défaut&amp;#039;]&lt;br /&gt;
	local lienCategorie = &amp;#039;[[Catégorie:%s]]&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
	return format(lienCategorie, nomCategorie or defautCategorie)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function bandeauProtection(titrePage, args)&lt;br /&gt;
	local nsPage = args.nsdoc or titrePage.nsText&lt;br /&gt;
	local titre = cfg[nsPage] or cfg[&amp;#039;titreDéfaut&amp;#039;]&lt;br /&gt;
	local texte = mw.html.create(&amp;#039;span&amp;#039;)&lt;br /&gt;
	local pageDiscussion, lienAdmin, lienJournal&lt;br /&gt;
 &lt;br /&gt;
	-- Gestion du nombre d&amp;#039;inclusions pour les modèles/modules.&lt;br /&gt;
	if nsPage == &amp;#039;Modèle&amp;#039; or nsPage == &amp;#039;Module&amp;#039; then&lt;br /&gt;
		titre = format(titre, titrePage:partialUrl())&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	-- Gestion du paramètre &amp;#039;texte&amp;#039; et de ses liens internes&lt;br /&gt;
	pageDiscussion = tostring(titrePage.talkPageTitle)&lt;br /&gt;
	lienAdmin = mw.title.new(cfg[&amp;#039;lienAdmin&amp;#039;])&lt;br /&gt;
		:fullUrl(format(cfg[&amp;#039;optionAdmin&amp;#039;],&lt;br /&gt;
			mw.uri.encode(titrePage.fullText, &amp;#039;WIKI&amp;#039;)))&lt;br /&gt;
	if nsPage == &amp;#039;&amp;#039; then lienAdmin = lienAdmin .. cfg[&amp;#039;option2Admin&amp;#039;] end&lt;br /&gt;
	lienJournal = mw.title.new(cfg[&amp;#039;lienJournal&amp;#039;])&lt;br /&gt;
		:fullUrl(format(cfg[&amp;#039;optionJournal&amp;#039;],&lt;br /&gt;
			mw.uri.encode(titrePage.fullText, &amp;#039;WIKI&amp;#039;)))&lt;br /&gt;
 	&lt;br /&gt;
	texte&lt;br /&gt;
		:addClass(&amp;#039;plainlinks&amp;#039;)&lt;br /&gt;
		:wikitext(format(cfg[&amp;#039;texteBandeau&amp;#039;], &lt;br /&gt;
			pageDiscussion, pageDiscussion, lienAdmin, lienJournal))&lt;br /&gt;
 &lt;br /&gt;
	return require(&amp;#039;Module:Bandeau&amp;#039;)._bandeauAvertissement{&lt;br /&gt;
		niveau    = &amp;#039;information&amp;#039;,&lt;br /&gt;
		[&amp;#039;icône&amp;#039;] = types[&amp;#039;protection&amp;#039;].image,&lt;br /&gt;
		[&amp;#039;domaine public&amp;#039;] = true,&lt;br /&gt;
		titre     = args[1] or titre,&lt;br /&gt;
		texte     = tostring(texte)&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(args, typeProtection, titrePage)&lt;br /&gt;
	typeProtection = typeProtection or &amp;#039;protection&amp;#039;&lt;br /&gt;
	local modeProtection = types[typeProtection]&lt;br /&gt;
	local titrePage = titrePage or mw.title.getCurrentTitle()&lt;br /&gt;
	local res = {}&lt;br /&gt;
 &lt;br /&gt;
	if typeProtection == &amp;#039;protection&amp;#039; and args.nocat then&lt;br /&gt;
		return bandeauProtection(titrePage, args)&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	if protectionPage(typeProtection, modeProtection, titrePage) then&lt;br /&gt;
		-- Création de l&amp;#039;icône de titre selon le mode de protection.&lt;br /&gt;
		insert(res, creerIconeTitre(modeProtection))&lt;br /&gt;
		-- Création du bandeau de protection pour le mode &amp;#039;protection&amp;#039;.&lt;br /&gt;
		if typeProtection == &amp;#039;protection&amp;#039; then&lt;br /&gt;
			insert(res, bandeauProtection(titrePage, args))&lt;br /&gt;
		end&lt;br /&gt;
		-- Catégorisation selon le mode de protection.&lt;br /&gt;
		insert(res, insertionCategorie(modeProtection, titrePage.nsText))&lt;br /&gt;
	elseif not estSousPage(titrePage) then&lt;br /&gt;
		-- Catégorisation lorsque le niveau de protection en écriture ne&lt;br /&gt;
		-- correspond pas ou plus. Note : les sous-pages &amp;#039;/Documentation&amp;#039;,&lt;br /&gt;
		-- &amp;#039;/Bac à sable&amp;#039; ou &amp;#039;/Test&amp;#039; appartenant aux modèles ou aux modules&lt;br /&gt;
		-- ne sont pas – et ne doivent pas être – concernées.&lt;br /&gt;
		insert(res, &amp;#039;[[Catégorie:Page dont la protection est à vérifier]]&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	return table.concat(res)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function adaptateur(nomFonction)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = {}&lt;br /&gt;
		local argsParent = frame:getParent().args&lt;br /&gt;
 &lt;br /&gt;
		-- Paramètres vides interprétés par Lua.&lt;br /&gt;
		for cle, val in pairs(argsParent) do&lt;br /&gt;
			if type(cle) == number then&lt;br /&gt;
				val = mw.text.trim(val)&lt;br /&gt;
			end&lt;br /&gt;
			if val ~= &amp;#039;&amp;#039; or cle == &amp;#039;nsdoc&amp;#039; then&lt;br /&gt;
				args[cle] = val&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
 &lt;br /&gt;
		return p.main(args, nomFonction)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
-- Insertion dans la table p des fonctions appelées par les&lt;br /&gt;
-- modèles à l&amp;#039;aide d&amp;#039;un adaptateur de fonction.&lt;br /&gt;
local nomsFonction = {&amp;#039;protection&amp;#039;, &amp;#039;semiProtectionEtendue&amp;#039;, &amp;#039;semiProtection&amp;#039;, &amp;#039;semiProtectionLongue&amp;#039;, &amp;#039;nomProtégé&amp;#039;} &lt;br /&gt;
for _, nomFonction in ipairs(nomsFonction) do&lt;br /&gt;
	p[nomFonction] = adaptateur(nomFonction)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Od1n</name></author>
	</entry>
</feed>