Modulo:DTFunzioniComuni: differenze tra le versioni

Vai alla navigazione Vai alla ricerca
m
nessun oggetto della modifica
mNessun oggetto della modifica
mNessun oggetto della modifica
Riga 94: Riga 94:
local InstanceItem = nil
local InstanceItem = nil
local InstanceInstanceItem = nil
local InstanceInstanceItem = nil
local ResultsArray = {}
local ResultsArray = nil
if not CurrentItem then
if not CurrentItem then
CurrentItem = mw.wikibase.getEntity('Q1')
CurrentItem = mw.wikibase.getEntity('Q1')
Riga 141: Riga 141:
if Item ~= nil and Item.claims[Property] then
if Item ~= nil and Item.claims[Property] then
local Values = Item.claims[Property]
local Values = Item.claims[Property]
==[[
-- Only initialize ResultsArray if the Property exist at least once along the tree
if ResultsArray == nil then
if ResultsArray == nil then
ResultsArray = {}
ResultsArray = {}
end
end
]]
for _, SnakValue in pairs(Values) do
for _, SnakValue in pairs(Values) do
if SnakValue.mainsnak.datavalue.value.amount ~= nil then
if SnakValue.mainsnak.datavalue.value.amount ~= nil then
Riga 204: Riga 204:
AZCategory = "[[Category:" .. AZInstancesMember[CurrentQ] .. " - " .. FirstLetter .. "]]"
AZCategory = "[[Category:" .. AZInstancesMember[CurrentQ] .. " - " .. FirstLetter .. "]]"
return (p.PropertiesOnTree("P68", 1, false)) .. AZCategory
return p.PropertiesOnTree("P68", 1, false) .. AZCategory
else
else
UpperCategories = p.PropertiesOnTree("P68", 2, true)
UpperCategories = p.PropertiesOnTree("P68", 2, true)

Menu di navigazione