Aller au contenu

Module:Infobox/Artère

Une page de Wikipédia, l'encyclopédie libre.
Ceci est une version archivée de cette page, en date du 18 juillet 2015 à 21:05 et modifiée en dernier par Petit B (discuter | contributions) (Essai 7). Elle peut contenir des erreurs, des inexactitudes ou des contenus vandalisés non présents dans la version actuelle.

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

Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Artère.


local wikidata = require "Module:Wikidata"
local general = require "Module:Infobox/Fonctions"

local p = {}
p.getTAValue = function()
	local ent = mw.wikibase.getEntityObject()
	local props = ent:formatPropertyValues('P1323')
	local out = {}
	local t = {}
	for k, v in pairs(props) do
		if k == 'value' then
			t = mw.text.split( v, ", ")
			for k2, v2 in pairs(t) do
				out[#out + 1] = "[http://www.unifr.ch/ifaa/Public/EntryPage/TA98%20Tree/Entity%20TA98%20EN/" .. string.sub(v2, 2) .. "%20Entity%20TA98%20EN.htm " .. v2 .. "]"
			end
		end
	end
	local ret = table.concat(out, "<br> ")
	if #ret == 0 then
		ret = "Invalid TA"
	end
	return ret
end

return {
	maincolor = '#FFAAAA',
	parts = {
		general.title(),
		general.mainimage(),
		{type='table', rows =
			{
				{type = 'mixed', label = 'Nom latin', value = 'latin', value = 'latin'},
				{type = 'mixed', label = '[[Terminologie anatomique|TA]]', value = function(localdata) if localdata["TA"] then return "[http://www.unifr.ch/ifaa/Public/EntryPage/TA98%20Tree/Entity%20TA98%20EN/" .. string.sub(localdata["TA"],2) .. "%20Entity%20TA98%20EN.htm " .. localdata["TA"] .. "]" end end, wikidata = function() return getTAValue() end},
				{type = 'mixed', label = 'Origine', value = 'origine'},
				{type = 'mixed', label = 'Branches', value = 'branches'},
				{type = 'mixed', label = 'Veine associée', value = 'veine'}
			}
		}
	}
}