Anonimo

Modulo:DTFunzioniComuni: differenze tra le versioni

Da Wikitrek.
nessun oggetto della modifica
mNessun oggetto della modifica
Nessun oggetto della modifica
Riga 68: Riga 68:
end
end
return table.concat(results, ', ')
return table.concat(results, ', ')
end
--- Three dashes indicate the beginning of a function or field documented
-- using the LDoc format
-- @param Property The property whose values are returned
-- @param Depth How far to go on the tree: 1 - item only, 2 - item and Instance, 3 - item, Instance and Instance of Instance
-- @param Aggregate Wether to aggregate results or return the first found
-- @return Table withs strings or wikilinks
function p.PropertiesOnTree(Property, Depth, Aggregate)
local CurrentItem = mw.wikibase.getEntity()
local InstanceItem = nil
local InstanceInstanceItem = nil
--local ItemQ = mw.wikibase.getEntityIdForCurrentPage()
if not CurrentItem then
CurrentItem = mw.wikibase.getEntity('Q1')
end
if not Depth or Depth < 1 then
Depth = 1
end
if Depth > 3 then
Depth = 3
end
if not Aggregate then
Aggregate = true
end
if Depth > 1 and CurrentItem['claims']['P14'] then
--Set instance of
if Depth > 2 and InstanceItem['claims']['P14'] then
--Set instance of instance
end
end
end
end