Anonimo

Modulo:DTGenerico: differenze tra le versioni

Da Wikitrek.
m
nessun oggetto della modifica
mNessun oggetto della modifica
mNessun oggetto della modifica
 
(10 versioni intermedie di uno stesso utente non sono mostrate)
Riga 107: Riga 107:
end
end
ExcludeP = {P3 = true, P7 = true, P8 = true, P11 = true, P21 = IsEpisode, P23 = true, P26 = true, P37 = true,  P46 = true, P58 = true, P68 = true, P52 = true, P79 = true, P90 = true, P104 = true, P162 = true}
ExcludeP = {P3 = true, P7 = true, P8 = true, P11 = true, P21 = IsEpisode, P23 = true, P26 = true, P37 = true,  P46 = true, P58 = true, P68 = true, P52 = true, P61 = true, P79 = true, P90 = true, P104 = true, P162 = true}
AllP = mw.wikibase.orderProperties(Item:getProperties())
AllP = mw.wikibase.orderProperties(Item:getProperties())
Riga 173: Riga 173:
POnTree = {{"P40", 3, false}, {"P41", 3, false}, {"P88", 3, false}}
POnTree = {{"P40", 3, false}, {"P41", 3, false}, {"P88", 3, false}}
for _, Prop in pairs(POnTree) do
for _, Prop in pairs(POnTree) do
local PropValue = table.concat(PropertiesOnTree(Prop[1], Prop[2], Prop[3], true))
--local PropValue = table.concat(PropertiesOnTree(Prop[1], Prop[2], Prop[3], true))
local PropValue = PropertiesOnTree(Prop[1], Prop[2], Prop[3], true)
if (PropValue ~= nil) and (PropValue ~= "") then
if (PropValue ~= nil) and (PropValue ~= "") then
local PropName = mw.wikibase.getLabelByLang(Prop[1], 'it') or mw.wikibase.getLabel(Prop[1])
local PropName = mw.wikibase.getLabelByLang(Prop[1], 'it') or mw.wikibase.getLabel(Prop[1])
Riga 330: Riga 331:
YearLink = LabelOrLink(SnakValue.qualifiers['P74'][1].datavalue.value['id'], nil, nil, PrintDate)
YearLink = LabelOrLink(SnakValue.qualifiers['P74'][1].datavalue.value['id'], nil, nil, PrintDate)
end
end
QualiString = " " .. "(" .. p.ProcessQualifiers(SnakValue) .. ")"
QualiString = " " .. p.ProcessQualifiers(SnakValue) --"(" .. p.ProcessQualifiers(SnakValue) .. ")"
end
end
Riga 518: Riga 519:
for _, Qualifier in pairs(SnakValue.qualifiers) do
for _, Qualifier in pairs(SnakValue.qualifiers) do
if Qualifier[1].property == "P4" then
if Qualifier[1].property == "P4" then
--Broadcaster
--Broadcaster
QualiValue[#QualiValue + 1] = Qualifier[1].datavalue.value
--QualiValue[#QualiValue + 1] = Qualifier[1].datavalue.value
table.insert(QualiValue, Qualifier[1].datavalue.value)
elseif Qualifier[1].property == "P19" then  --SnakValue.qualifiers['P19'] ~= nil then
-- Suffix
table.insert(QualiValue, Qualifier[1].datavalue.value)
end
end
end
end
Riga 538: Riga 542:
]=]
]=]
end
end
--- Function to launch template for DataBoxes
 
-- Specific for Template:IncipitUniversale
-- @param frame Data from MW session
function p.UniversalBoxes(frame)
local FinalString
FinalString = frame:expandTemplate{title = 'BoxSecInstallazioni'}
end
--- Function to query for HyperTrek migration data and to construct a proper box
--- Function to query for HyperTrek migration data and to construct a proper box
-- to show them, if present
-- to show them, if present
Riga 570: Riga 567:
ImageString = "[[File:Menu.png|left|middle|30px|HyperTrek logo]]"
ImageString = "[[File:Menu.png|left|middle|30px|HyperTrek logo]]"
DataString = "Informazioni originali lette dal database di <h2 class='hiddenheaderbold'>HyperTrek</h2> datato " .. frame:expandTemplate{title = 'TimeL', args = {Tipo='ITMedia', Istante=HTNodes.mainsnak.datavalue.value.time}} .. " con i seguenti dettagli: "
DataString = "Informazioni originali lette dal database di <h2 class='hiddenheaderbold'>HyperTrek</h2> datato " .. frame:expandTemplate{title = 'TimeL', args = {Tipo='ITMedia', Istante=HTNodes.mainsnak.datavalue.value.time}} .. " con i seguenti dettagli: "
if AddSemantic then
mw.smw.set(mw.wikibase.getLabelByLang('P79', 'it') .. "=" .. Item.claims['P79'][1].mainsnak.datavalue.value.time)
end
 
 
for _, Qualifier in pairs(HTNodes.qualifiers) do
for _, Qualifier in pairs(HTNodes.qualifiers) do
Riga 584: Riga 585:
mw.smw.set(QualiName .. "=" .. QualiValue)
mw.smw.set(QualiName .. "=" .. QualiValue)
end
end
--QualiString = QualiString .. "<li " .. "title='" .. QualiProp .. "'>'''" .. QualiName .. "''': " .. QualiValue .. "</li>"
if QualiProp == "P86" then
--Sezione ID, add link to page
QualiValue = frame:expandTemplate{title = 'HTSezioneID', args = {QualiValue}}
end
QualiString = QualiString .. "<li " .. "title='" .. QualiProp .. "'>'''" .. string.gsub(QualiName, "HyperTrek", "HT") .. "''': " .. QualiValue .. "</li>"
QualiString = QualiString .. "<li " .. "title='" .. QualiProp .. "'>'''" .. string.gsub(QualiName, "HyperTrek", "HT") .. "''': " .. QualiValue .. "</li>"
end
end