Module:NavItem

local p = {}

local g = require("Module:Common") local s = require("Module:Sprite")

function p.makeNavItem(name, image, link, text) name = name or "Unknown" image = image or ("Grid " .. name .. ".png") link = link or name text = text or name local out = ' ' out = out .. g.img(image, "16px", link, text) out = out .. " "	out = out .. g.link(link, text) out = out .. " "	return out end

function p.makeSpriteNavItem(name, spriteSheet, spriteIdx, link, text) name = name or "Unknown" link = link or name text = text or name local out = ' ' out = out .. s.makeSprite(spriteSheet, spriteIdx, 16, 256, link, text, nil) out = out .. " "	out = out .. g.link(link, text) out = out .. " "	return out end

function p.main(frame) local frame, args = g.getFrameAndArgs(frame) return p.makeNavItem(args[1], args[2], args[3], args.text) end

return p