Anonimo

Modulo:DTFunzioniComuni: differenze tra le versioni

Da Wikitrek.
nessun oggetto della modifica
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 1: Riga 1:
-- Keyword: wikitrek
-- Keyword: wikitrek
local LabelOrLink = require('Modulo:DTBase').LabelOrLink
local p = {}
local p = {}
function p.ImmagineDaFile(Frame)
function p.ImmagineDaFile(Frame)
Riga 79: Riga 82:
local InstanceItem = nil
local InstanceItem = nil
local InstanceInstanceItem = nil
local InstanceInstanceItem = nil
local ResultsArray = {}
--local ItemQ = mw.wikibase.getEntityIdForCurrentPage()
--local ItemQ = mw.wikibase.getEntityIdForCurrentPage()
if not CurrentItem then
if not CurrentItem then
Riga 89: Riga 93:
if Depth > 3 then
if Depth > 3 then
Depth = 3
Depth = 3
end
if not Aggregate then
Aggregate = true
end
end
if Depth > 1 and CurrentItem['claims']['P14'] then
if Depth > 1 and CurrentItem['claims']['P14'] then
--Set instance of
--Set instance of
InstanceItem = mw.wikibase.getEntity(CurrentItem['claims']['P14'][1].mainsnak.datavalue.value['id'])
if Depth > 2 and InstanceItem['claims']['P14'] then
if Depth > 2 and InstanceItem['claims']['P14'] then
--Set instance of instance
--Set instance of instance
InstanceInstanceItem = mw.wikibase.getEntity(InstanceItem['claims']['P14'][1].mainsnak.datavalue.value['id'])
end
end
--[=[if CurrentItem.claims[Property] then
ResultsArray[#ResultsArray + 1] = LabelOrLink(CurrentItem.claims[Property][1].mainsnak.datavalue.value.id)
if not Aggregate then
return resultsArray
end
end]=]
for _, Item in pairs({CurrentItem, InstanceItem, InstanceInstanceItem}) do
if Item ~= nil and CurrentItem.claims[Property] then
ResultsArray[#ResultsArray + 1] = Item.id .. " - " .. Property
--ResultsArray[#ResultsArray + 1] = LabelOrLink(Item.claims[Property][1].mainsnak.datavalue.value.id)
if not Aggregate then
return resultsArray
end
end
end
end
end
return resultsArray
end
end