Module:Common: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 18: | Line 18: | ||
local Property = mw.wikibase.getEntity('P' .. PNumber) | local Property = mw.wikibase.getEntity('P' .. PNumber) | ||
PDetails[#PDetails + 1] = "Primo testo" | --PDetails[#PDetails + 1] = "Primo testo" | ||
--PDetails[#PDetails + 1] = Property.lastrevid | --PDetails[#PDetails + 1] = Property.lastrevid | ||
--PDetails[#PDetails + 1] = Property.modified | --PDetails[#PDetails + 1] = Property.modified | ||
PDetails[#PDetails + 1] = Property.id | PDetails[#PDetails + 1] = Property.id | ||
PDetails[#PDetails + 1] = "Secondo testo" | --PDetails[#PDetails + 1] = "Secondo testo" | ||
PDetails[#PDetails + 1] = Property.datatype | PDetails[#PDetails + 1] = Property.datatype | ||
--PDetails[#PDetails + 1] = Property.title | --PDetails[#PDetails + 1] = Property.title | ||
Line 29: | Line 29: | ||
PDetails[#PDetails + 1] = Property.labels["it"].value | PDetails[#PDetails + 1] = Property.labels["it"].value | ||
else | else | ||
PDetails[#PDetails + 1] = "" | PDetails[#PDetails + 1] = "[IT]" | ||
end | end | ||
if Property.labels["en"] then | if Property.labels["en"] then | ||
PDetails[#PDetails + 1] = Property.labels["en"].value | PDetails[#PDetails + 1] = Property.labels["en"].value | ||
else | else | ||
PDetails[#PDetails + 1] = "" | PDetails[#PDetails + 1] = "[EN]" | ||
end | end | ||
if Property.modified then | if Property.modified then | ||
PDetails[#PDetails + 1] = Property.modified | PDetails[#PDetails + 1] = Property.modified | ||
else | else | ||
PDetails[#PDetails + 1] = " | PDetails[#PDetails + 1] = "[MODIFIED]" | ||
end | end | ||
PDetails[#PDetails + 1] = "Terzo e ultimo testo" | --PDetails[#PDetails + 1] = "Terzo e ultimo testo" | ||
PDetails[#PDetails + 1] = Property.id | --PDetails[#PDetails + 1] = Property.id | ||
--AllP[#AllP + 1] = 'P' .. PNumber | --AllP[#AllP + 1] = 'P' .. PNumber |
Revision as of 01:02, 10 June 2020
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 tonumber(frame.args[1]) < 1 then
MaxP = 10
else
MaxP = tonumber(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] = "Primo testo"
--PDetails[#PDetails + 1] = Property.lastrevid
--PDetails[#PDetails + 1] = Property.modified
PDetails[#PDetails + 1] = Property.id
--PDetails[#PDetails + 1] = "Secondo testo"
PDetails[#PDetails + 1] = Property.datatype
--PDetails[#PDetails + 1] = Property.title
--PDetails[#PDetails + 1] = Property.lastrevid
if Property.labels["it"] then
PDetails[#PDetails + 1] = Property.labels["it"].value
else
PDetails[#PDetails + 1] = "[IT]"
end
if Property.labels["en"] then
PDetails[#PDetails + 1] = Property.labels["en"].value
else
PDetails[#PDetails + 1] = "[EN]"
end
if Property.modified then
PDetails[#PDetails + 1] = Property.modified
else
PDetails[#PDetails + 1] = "[MODIFIED]"
end
--PDetails[#PDetails + 1] = "Terzo e ultimo testo"
--PDetails[#PDetails + 1] = Property.id
--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