Module:Biobox: Difference between revisions
Content deleted Content added
PeaceDeadC (talk | contribs) No edit summary |
PeaceDeadC (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
Line 7:
local BioboxPersonalPages = require('Module:BioboxPersonalPages')
local BioboxDatabases = require('Module:BioboxDatabases')
local ALIAS_TO_PRIMARY = {}
Line 110 ⟶ 109:
local function getPBDIBValue(propertyId, args, options)
return PBDIB._getValue({▼
end▼
▲ qid = args.qid,
format = options and options.format,▼
local success,
▲ return PBDIB._getValue({
[1] = propertyId,
qid = args.qid,
▲ format = options and options.format,
fpbd = "ALL"
▲ })
end)
if success then
return result
else
return nil
end
end
Line 375 ⟶ 386:
args = normalizeKeys(args)
if
if success and entityId then
args.qid = entityId
else
args.qid = nil
end
end
Line 382 ⟶ 398:
local state = State:new()
local personalSection, rowIndex
local success, result1, result2 = pcall(function()
local bodySection = BioboxBody.formatBodySection(state, args, rowIndex)▼
return BioboxPersonal.formatPersonalSection(state, args, title)
end)
if success then
local personalPagesSection, ppRowIndex = BioboxPersonalPages.formatPersonalPagesSection(state, args, rowIndex)▼
personalSection, rowIndex = result1, result2
local databasesSection, dbRowIndex = BioboxDatabases.formatDatabasesSection(state, args, ppRowIndex)▼
else
personalSection = string.format('{| %s\n|-\n! colspan="2" %s | \'\'\'%s\'\'\'',
STYLES.INFOBOX,
STYLES.HEADER,
title)
rowIndex = 1
end
local bodySection = ""
success, result1 = pcall(function()
end)
if success then
bodySection = result1
end
local personalPagesSection, ppRowIndex = {}, rowIndex
success, result1, result2 = pcall(function()
▲
end)
if success then
personalPagesSection, ppRowIndex = result1, result2
end
local databasesSection, dbRowIndex = {}, ppRowIndex
success, result1, result2 = pcall(function()
▲
end)
if success then
databasesSection, dbRowIndex = result1, result2
end
if isEmpty(personalSection) or not string.find(personalSection, '{|%s+class="infoboxnew"') then
personalSection = string.format('{| %s\n|-\n! colspan="2" %s | \'\'\'%s\'\'\'',
STYLES.INFOBOX,
STYLES.HEADER,
title)
end
local result = personalSection .. '\n' .. bodySection
Line 397 ⟶ 455:
if #databasesSection > 0 then
result = result .. '\n' .. table.concat(databasesSection, '\n')
▲ end
end
if not isEmpty(args.qid) then
local success, pbcLink = pcall(mw.wikibase.getSitelink
if success and pbcLink then
result = result .. '\n|-class="stop-section-collapse"\n! colspan="2" style="background:#F0E68C;text-align:center;" | [[File:Pbd.svg | 45px | alt=' .. args.qid .. ' | link=pbd:' .. args.qid .. ']] [[:pbd:' .. args.qid .. '|' .. pbcLink .. ']] ([[:pbd:' .. args.qid .. '|' .. args.qid .. ']])'
end
Line 415 ⟶ 469:
}
}
local imageRepoLink = PBDIB.getSiteLink(newFrame)▼
success, imageRepoLink = pcall(function()
end)
if success and imageRepoLink and imageRepoLink ~= '' then
result = result .. '\n|-class="stop-section-collapse"\n! colspan="2" style="background:#F0E68C;text-align:center;" | [[File:Image-icon.svg | 18px | link=:' .. imageRepoLink .. ']] [[:' .. imageRepoLink .. '| PBC Image Repository]]'
end
newFrame.args.wiki = "pbcvideorepo"
local videoRepoLink
success, videoRepoLink = pcall(function()
return PBDIB.getSiteLink(newFrame)
end)
if success and videoRepoLink and videoRepoLink ~= '' then
result = result .. '\n|-class="stop-section-collapse"\n! colspan="2" style="background:#F0E68C;text-align:center;" | [[File:Video-icon.svg | 18px | link=:' .. videoRepoLink .. ']] [[:' .. videoRepoLink .. '| PBC Video Repository]]'
end
Line 431 ⟶ 492:
result = result .. '\n|}'
local categories =
if not isEmpty(args.qid) then
success, categories = pcall(function()
return BioboxPersonal.getPBDCategories(args)
end)
if not success then
categories = {}
end
end
if #categories > 0 then
local categoryStrings = {}
| |||