[checked revision] | [checked revision] |
RheingoldRiver (talk | contribs) (Syncing content across wikis, if something seems broken as a result let me know) |
No edit summary |
||
Line 21: | Line 21: | ||
function h.getTeamFromPlayer(title) |
function h.getTeamFromPlayer(title) |
||
local query = { |
local query = { |
||
− | tables = ' |
+ | tables = 'Players', |
fields = 'Team', |
fields = 'Team', |
||
where = string.format('_pageName="%s"', title) |
where = string.format('_pageName="%s"', title) |
Latest revision as of 15:41, 8 July 2019
To edit the documentation or categories for this module, click here.
local util_cargo = require('Module:CargoUtil')
local h = {}
function h.orgNavboxArgs(team)
return {
title = 'OrgNavbox',
events = { showAll = true },
args = { team, suffix = 'Yes' },
}
end
function h.clpnArgs(team, tabstype)
return {
title = 'CurrentLeagueParticipantNavbox',
events = { showAll = true },
args = { team, suffix = 'Yes' },
pagetype = tabstype
}
end
function h.getTeamFromPlayer(title)
local query = {
tables = 'Players',
fields = 'Team',
where = string.format('_pageName="%s"', title)
}
return util_cargo.getOneResult(query)
end
local p = {}
function p.navbox(tabstype, title)
if tabstype ~= 'Player' and tabstype ~= 'Team' then
return nil
end
local team = (tabstype == 'Team') and title or h.getTeamFromPlayer(title)
local clpnavbox = h.clpnArgs(team, tabstype)
local orgnavbox = h.orgNavboxArgs(team)
local navboxes = { clpnavbox, orgnavbox }
return navboxes
end
return p