Modulo:Collegamenti esterni: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
+gestione spazi URL
aggiunta icona Modifica su Wikidata anche in modalità raggruppata
Riga 235:
self.categories = {}
self.catColon = ''
self.from = args.from
-- la pagina dei test utilizza uno stub del modulo Wikidata
if mw.title.getCurrentTitle().prefixedText ==
Line 240 ⟶ 241:
self:_setStubWikidata(args.stubwd)
end
self.extLinks = self:_getExtLinks(args.from)
 
return self
Line 260 ⟶ 261:
-- suddivisi per gruppo.
--
-- @param {string} from
-- @return {table}
function LinksManager:_getExtLinks(from)
local ret, groupSites = {}, {}
local cfg = readConfig()
Riga 269:
ret[groupName] = {}
for _, linkConf in ipairs(cfg[groupName]) do
if not linkConf.istanza or checkInstance(linkConf.istanza, self.from) then
local url = mWikidata._getProperty({ linkConf.pid, from = self.from, snaktype = 'value', pattern = linkConf.url }, true)
if url then
table.insert(ret[groupName], ExtLink:new(url, linkConf, self.from))
-- categorie
table.insert(self.categories, string.format('[[%sCategoria:%s letta da Wikidata]]',
Riga 332:
local groupTitle = groupName == 'Enciclopedie' and
groupName or 'Banche dati ' .. mw.ustring.lower(groupName)
table.insert(formattedGroups, string.format("* %s: %s%s", groupTitle,
table.concat(formattedLinks, '<span style="font-weight:bold;">&nbsp;·</span> '))),
mEditAtWikidata._showMessage({ sezione = 'identifiers', qid = self.from })))
end
end