Content deleted Content added
No edit summary
No edit summary
Line 7:
local BioboxPersonalPages = require('Module:BioboxPersonalPages')
local BioboxDatabases = require('Module:BioboxDatabases')
local BioboxSharing = require('Module:BioboxSharing')
 
local ALIAS_TO_PRIMARY = {}
Line 110 ⟶ 109:
 
local function getPBDIBValue(propertyId, args, options)
if not args.qid =or args.qid, == "" then
return PBDIB._getValue({
[1]return = propertyId,nil
end
qid = args.qid,
format = options and options.format,
local success, fpbdresult = "ALL"pcall(function()
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 not isEmpty(args.qid or args.qid == "") then
args.qidlocal success, entityId = pcall(mw.wikibase.getEntityIdForCurrentPage()
if success and entityId then
args.qid = entityId
else
args.qid = nil
end
end
Line 382 ⟶ 398:
local state = State:new()
 
local personalSection, rowIndex = BioboxPersonal.formatPersonalSection(state, args, title)
local success, result = 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 = result, select(2, result)
local databasesSection, dbRowIndex = BioboxDatabases.formatDatabasesSection(state, args, ppRowIndex)
else
local sharingSection, shRowIndex = BioboxSharing.formatSharingSection(state, args, dbRowIndex)
personalSection, rowIndex = "", 1
end
local bodySection = ""
success, result = pcall(function()
local bodySection = return BioboxBody.formatBodySection(state, args, rowIndex)
end)
if success then
bodySection = result
end
local personalPagesSection, ppRowIndex = {}, rowIndex
success, result = pcall(function()
local personalPagesSection, ppRowIndex = return BioboxPersonalPages.formatPersonalPagesSection(state, args, rowIndex)
end)
if success then
personalPagesSection, ppRowIndex = result, select(2, result)
end
local databasesSection, dbRowIndex = {}, ppRowIndex
success, result = pcall(function()
local databasesSection, dbRowIndex = return BioboxDatabases.formatDatabasesSection(state, args, ppRowIndex)
end)
if success then
databasesSection, dbRowIndex = result, select(2, result)
end
if isEmpty(personalSection) then
personalSection = string.format('{| %s\n|-\n! colspan="2" %s | \'\'\'%s\'\'\'',
STYLES.INFOBOX,
STYLES.HEADER,
title)
end
local result = personalSection .. '\n' .. bodySection
Line 397 ⟶ 451:
if #databasesSection > 0 then
result = result .. '\n' .. table.concat(databasesSection, '\n')
end
if #sharingSection > 0 then
result = result .. '\n' .. table.concat(sharingSection, '\n')
end
 
if not isEmpty(args.qid) then
local success, pbcLink = pcall(mw.wikibase.getSitelink(, args.qid)
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 ⟶ 465:
}
}
local imageRepoLink = PBDIB.getSiteLink(newFrame)
iflocal imageRepoLink and imageRepoLink ~= '' then
success, imageRepoLink = pcall(function()
local imageRepoLink = return PBDIB.getSiteLink(newFrame)
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 = PBDIB.getSiteLink(newFrame)
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 ⟶ 488:
result = result .. '\n|}'
 
local categories = BioboxPersonal.getPBDCategories(args){}
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 = {}