Module:Common

-- This module contains common objects that could be used by many other modules    Therefore it cannot be invoked by templates --- -- Functions: + setDefault(argument, value) + colorLink(argument) + check(argument) --- local common = {}

function common.setDefault(arg, val) if(arg == nil and value == nil) then arg = 'test' elseif(arg == nil and value ~= nil) then arg = value end return arg end

function common.colorLinks(arg) local n, class local games = { 6, 8, 9, 10, 12, 13, 14 } if(type(arg) == 'string') then n = tonumber(string.sub(arg, 3)) else n = arg end for i = 0, #games do       if(n == games[i]) then class = 'light' break else class = '' end end return class end

function common.check(arg) if(arg == nil) then return false else return true end end

return common --