Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. Module:Blog officiel — Wikipédia
Module:Blog officiel — Wikipédia 👆 Click Here! Read More..
Une page de Wikipédia, l'encyclopédie libre.

 Documentation[voir] [modifier] [historique] [purger]


    • Projet Scribunto Projet Scribunto

La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis sa sous-page de documentation. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.

local Lien = { }

local Outils = require "Module:Outils"
local Verif = require "Module:Correction syntaxique"

local function caterreur(param)
	if mw.title.getCurrentTitle().namespace == 0 then
		return '[[Catégorie:Page du modèle Blog officiel comportant une erreur|' .. string.upper(param or '?') .. ']]'
	else
		return ''
	end
end

function Lien.blogOfficiel( frame )
	local oldargs = Outils.extractArgs( frame )
	local args = {}
	for i, j in pairs(oldargs) do
		local trimmed = mw.text.trim(j)
		if trimmed ~= '' then
			args[i] = trimmed
		end
	end
	local nocaturl = args.nocaturl

	local erreurs = '' -- les messages d'erreurs sont ajoutés ici

	local erreursarguments = Verif.verif(args, {'titre', 'title', 1, 2, 'langue', 'lang', 'url', 'wikidata', 'nocaturl'}, 'Modèle Blog officiel avec un paramètre inconnu‎')
	if erreursarguments then
		erreurs = erreurs .. erreursarguments
	end

	local titredefaut = 'Blog officiel'
	local titre = args['titre'] or args['title'] or titredefaut
	local langue = args['langue'] or args['lang']
	local url = args['url'] or args[2] or args[1]


	if (not langue) and (args[2]) then
		langue = args[1]
	end
	
	-- si pas d'URL, essayer Wikidata, et si ça marche, sortir de ce module
	if not url and (args.wikidata ~= '-') then
		local Wikidata = require "Module:Wikidata"
		local links = Wikidata.getClaims{entity = args.wikidata, property = 'P1581', excludespecial = true}
		if links and (#links > 1) then
			if titre == titredefaut then
				titre = nil
			end
			return "Blogs officiels : " .. Wikidata.formatAndCat{claims = links, property = 'P1581', displayformat = 'weblink', showlang = true, excludespecial = true} .. erreurs
		elseif links then
			return Wikidata.formatAndCat{claims = links, property = 'P1581', displayformat = 'weblink', showlang = true, text = titre} .. erreurs
		end
	end
	
	-- si toujours pas, ajouter les catégories d'erreur et sortir
	if not url then
		if not nocaturl then
			erreurs = erreurs .. caterreur('url')
		end
		return erreurs
	end

	-- nettoyage de l'URL
	url = url:gsub( '%[', '%%5B' ):gsub( '%]', '%%5D' )
	if not ( url:match( '^http' ) or url:match( '^//' ) ) then
			url = 'http://' .. url
	end
	
	-- formatage de la langue
	local indicLangue = ''  -- langue telle qu'affichée dans le rendu final
	if langue then
		if langue ~= 'fr' then
			local Langue = require "Module:Langue"
			indicLangue = Langue.indicationMultilingue{ langue } .. ' '
			if indicLangue:find('class="error"', nil, true) then
				erreurs = erreurs .. caterreur('langue')
			end
		end
	end

	return indicLangue .. '[' .. url .. ' ' .. titre .. ']' .. erreurs
end

return Lien
Ce document provient de « https://fr.teknopedia.teknokrat.ac.id/w/index.php?title=Module:Blog_officiel&oldid=210869049 ».
Catégorie :
  • Module en langage Lua

  • indonesia
  • Polski
  • الرية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصر
  • Nederlands
  • 本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українска
  • Tiếng Việt
  • Winaray
  • 中文
  • Русски
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id