Module:Portail

De Starfield Wiki
Documentation[voir] [modifier] [purger]
local p = {}

------------------------------------------------------
-- Fonctions communes
------------------------------------------------------

function getArgs(frame)
 local args = {}
 local argsParent = frame:getParent().args
 for cle, val in pairs(argsParent) do
  if val then
   args[cle] = mw.text.trim(val)
  end
 end
 return args
end

------------------------------------------------------
-- p._
------------------------------------------------------

function p._buildGameContentGroup(args)
 local items = mw.html.create( 'ul' )
	
 for i, item in ipairs(args) do
  items :tag( 'li' ):wikitext( item ):done()
 end
	
 items :done()
	
 return tostring(mw.html.create( 'div' )
  :addClass( 'liste-horizontale portal-content-group' )
  :tag( 'div' )
   :addClass( 'portal-content-group-title' )
   :wikitext( args.titre or 'Titre ?' )
   :done()
  :node( items )
 )
end

------------------------------------------------------
-- p.
------------------------------------------------------

function p.buildGameContentGroup(frame) return p._buildGameContentGroup(getArgs(frame)) end

------------------------------------------------------
-- returning module
------------------------------------------------------

return p