Module:Common
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Common/doc
-- Keyword: wikitrek
local p = {}
function p.SiteAllP(frame)
local MaxP
local Separator = "|"
local AllP = {}
local PDetails = {}
if frame.args[1] < 1 then
MaxP = 10
else
MaxP = frame.args[1]
end
for PNumber = 1, MaxP, 1 do
if mw.wikibase.entityExists('P' .. PNumber) then
local PDetails = {}
local Property = mw.wikibase.getEntity('P' .. PNumber)
PDetails[#PDetails + 1] = Property.id
PDetails[#PDetails + 1] = Property.datatype
if Property.labels["it"] then
PDetails[#PDetails + 1] = Property.labels["it"].value
else
PDetails[#PDetails + 1] = ""
end
--[[if Property.labels["en"] then
PDetails[#PDetails + 1] = Property.labels["en"].value
else
PDetails[#PDetails + 1] = ""
end]]
PDetails[#PDetails + 1] = Property.modified
--AllP[#AllP + 1] = 'P' .. PNumber
AllP[#AllP + 1] = table.concat(PDetails, Separator)
end
end
return table.concat(AllP, "<br />" .. string.char(10))
end
return p