Bureaucrats, Moderators (CommentStreams), Interface administrators, Push subscription managers, Suppressors, Administrators
4,204
edits
(copy from https://support.wiki.gg/wiki/Module:Infobox) |
(tweak) |
||
Line 44: | Line 44: | ||
h.setMainImage(args.images[1]) | h.setMainImage(args.images[1]) | ||
-- suggest to use HIDDENCAT here; will be used for maintenance & gadget imports | -- suggest to use HIDDENCAT here; will be used for maintenance & gadget imports | ||
return h.makeInfobox(args, sep), '[[Category:Pages with | return h.makeInfobox(args, sep), '[[Category:Pages with Monk infoboxes]]' | ||
end | end | ||
function h.registerHooks() | function h.registerHooks() | ||
if not mw.title.new('Module:Infobox/Hooks').exists then return end | if not mw.title.new('Module:Infobox (Monk)/Hooks').exists then return end | ||
hooks = require('Module:Infobox/Hooks') | hooks = require('Module:Infobox (Monk)/Hooks') | ||
end | end | ||
Line 62: | Line 62: | ||
local VariablesLua = mw.ext.VariablesLua | local VariablesLua = mw.ext.VariablesLua | ||
if VariablesLua == nil then | if VariablesLua == nil then | ||
h.counter = mw.getCurrentFrame():callParserFunction('#var', {' | h.counter = mw.getCurrentFrame():callParserFunction('#var', {'Monk_INFOBOX_ID', 0}) + 1 | ||
mw.getCurrentFrame():callParserFunction('#vardefine', {' | mw.getCurrentFrame():callParserFunction('#vardefine', {'Monk_INFOBOX_ID', h.counter}) | ||
else | else | ||
h.counter = VariablesLua.var(' | h.counter = VariablesLua.var('Monk_INFOBOX_ID', 0) + 1 | ||
VariablesLua.vardefine(' | VariablesLua.vardefine('Monk_INFOBOX_ID', h.counter) | ||
end | end | ||
end | end |