Modulo:Cita Wikidata: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m Horcrux ha spostato la pagina Modulo:Sandbox/Horcrux/Cita Wikidata a Modulo:Cita Wikidata senza lasciare redirect |
fix vari |
||
Riga 3:
local p = {}
local propertyId
local errorMsg = '<span style="font-size:100%" class="error citation-comment">Errore: parametro <code style="color:red;">$1</code> mancante.</span>'
local getArgs = require('Modulo:Arguments').getArgs
Riga 14 ⟶ 15:
end
local function
return is_set(str) and str:find('$1')
end
local function
return mWikidata.
end
Riga 26 ⟶ 27:
local autoriStringa = getQualifier('P2093')
if is_set(autoriStringa) then
local autoriConLink = getQualifier('P50',
if is_set(autoriConLink) then
return autoriConLink .. ', ' .. autoriStringa
Riga 50 ⟶ 51:
local args = getArgs(frame)
--
if not is_set(medium) then return errorMsg:gsub('$1', 'medium') end
if not is_set(prop) then return errorMsg:gsub('$1', 'prop') end
propertyId = args.prop
local identifierFromWD = mWikidata._getProperty( { propertyId } )
local
local urlType
urlType = 'titolo'
args.url = args.url:gsub('$1', identifier)
urlType = 'capitolo'
args.urlcapitolo = args.urlcapitolo:gsub('$1', identifier)
elseif is_pattern(args.url_capitolo) then
urlType = 'capitolo'
args.url_capitolo = args.url_capitolo:gsub('$1', identifier)
-- Se un identificatore è specificato, allora si sta forzando l'inserimento manuale;
-- in tal caso, nessun dato va ricavato da Wikidata, altrimenti si rischierebbero incongruenze fra i dati manuali e quelli automatici
if
if not is_set(args.autore) then
args.autore = getAutori()
Riga 68 ⟶ 82:
if not is_set(args.titolo) then
args.titolo = getTitolo()
▲ end
▲ if not is_set(args.url) then
end
elseif urlType == 'capitolo' then
if not is_set(args.capitolo) then
args.capitolo = getTitolo()
end▼
▲ if not is_set(args.urlcapitolo) then
end
end
Riga 87 ⟶ 95:
if not is_set(args.vol) and not is_set(args.volume) then
args.volume = getQualifier('P478')
else
if urlType == 'titolo' and not is_set(args.titolo) then
args.titolo = pipetrick()
elseif urlType == 'capitolo' and not is_set(args.capitolo) then
args.capitolo = pipetrick()
end
end
args.cid = args.cid:gsub('$1', identifier)
return mCitazione.cita_da_modulo(args.medium, args)
end
|