Modification de Module:Infobox

Attention : vous n’êtes pas connecté(e). Votre adresse IP sera visible de tout le monde si vous faites des modifications. Si vous vous connectez ou créez un compte, vos modifications seront attribuées à votre propre nom d’utilisateur(rice) et vous aurez d’autres avantages.

La modification peut être annulée. Veuillez vérifier les différences ci-dessous pour voir si c’est bien ce que vous voulez faire, puis publier ces changements pour finaliser l’annulation de cette modification.

Version actuelle Votre texte
Ligne 1 : Ligne 1 :
-- Module https://fallout-wiki.com/Module:Infobox utilisé comme source et
local p = {}
-- lui-même inspiré de https://fr.wikipedia.org/wiki/Module:Infobox
-- Gère la construction des infobox dans le paramétrage doit être défini
-- un sous-module.


local p = {}
--[[
Chargement des informations des données passés au modèle et des variables globales
]]


-- données concernant les paramètres passés au modèle
-- données concernant les paramètres passés au modèle
local localdata = {}
local localdata = {}


-- données concernant la page où est affichée l"infobox
-- données concernant la page où est affichée l'infobox
local page = {
local page = {
name = mw.title.getCurrentTitle().prefixedText,
name = mw.title.getCurrentTitle().prefixedText,
Ligne 15 : Ligne 14 :
}
}


-- l"objet principal à retourner
local abb = require('Module:Abréviation')
local infobox = mw.html.create("div")


--[[ Outils ]]
-- l'objet principal à retourner
local infobox = mw.html.create('div')


local function get_value(value, part)
--[[
if type(value) == "string" then
Outils
]]
 
local function getValue(value, part)
if type(value) == 'string' then
return localdata[value]
return localdata[value]
elseif type(value) == "function" then
elseif type(value) == 'function' then
return value(localdata, part)
return value(localdata, part)
elseif type(value) == "table" then
elseif type(value) == 'table' then
         -- si plusieurs paramètres possibles (legacy de vieux code),
         -- si plusieurs paramètres possibles (legacy de vieux code), prendre le premier non vide
        -- prendre le premier non vide
for i, j in pairs(value) do
for i, j in pairs(value) do
if localdata[j] then
if localdata[j] then
Ligne 37 : Ligne 39 :


function p.separator()
function p.separator()
return mw.html.create("hr"):addClass("separator")
return mw.html.create('hr'):addClass('separator')
end
end


--[[ Construction des blocs ]]
--[[
Construction des blocs
]]


function p.build_title(part)
function p.buildtitle(part)
local text = get_value(part.value, part) or part.textdefaultvalue or mw.title.getCurrentTitle().text
local text = getValue(part.value, part) or part.textdefaultvalue or mw.title.getCurrentTitle().text
local subtext = get_value(part.subtitle, part) or part.subtitledefaultvalue
local subtext = getValue(part.subtitle, part) or part.subtitledefaultvalue
local classes = "avt-infobox-header " .. (part.class or "")
-- Supprime l"indication d"homonymie
text = mw.ustring.gsub(text, " [(][^()]*[)]$", "")
text = mw.ustring.gsub(text, " [(][^()]*[)]$", "")
if subtext and (subtext ~= text) then
if subtext and (subtext ~= text) then
text = text .. "<br/><small>" .. subtext .. "</small>"
text = text .. '<br/><small>' .. subtext .. '</small>'
end
local class = 'avt-infobox-header'
    local style = {}
if part.style then
for i, j in pairs(part.style) do
style[i] = j
end
end
local subhead = nil
if part.subhead then
local subheadText = abb.links({
getValue(part.subhead.games, part),
part.subhead.link,
part.subhead.subject
})
if subheadText then
subhead = tostring(mw.html.create('div')
:addClass('avt-infobox-header-subhead')
:wikitext(subheadText)
:allDone())
end
end
end


local title = mw.html.create("div")
local title = mw.html.create('div')
:addClass(classes)
:addClass(class)
:tag("div")
:css(style)
:addClass("avt-infobox-header-title")
:node(subhead)
:tag('div')
:addClass('avt-infobox-header-title')
:wikitext(text)
:wikitext(text)
:allDone()
:allDone()
Ligne 63 : Ligne 90 :
return title
return title
end
end
p.build_title = p.build_title
p.buildTitle = p.buildtitle


function p.build_images(part)
function p.buildimages(part)
local images = {}
local images = {}
local upright, link, caption, alt
local upright, link, caption, alt
if type(part.imageparameters) == "string" then
if type(part.imageparameters) == 'string' then
part.imageparameters = { part.imageparameters }
part.imageparameters = { part.imageparameters }
end
end
if not part.imageparameters then -- s"il n"y a pas de paramètre image, continuer, peut-être y a-t-il une image par défaut définie dans le module d"infobox
if not part.imageparameters then -- s'il n'y a pas de paramètre image, continuer, peut-être y a-t-il une image par défaut définie dans le module d'infobox
part.imageparameters = {}
part.imageparameters = {}
end
end
Ligne 80 : Ligne 107 :
-- Images par défaut
-- Images par défaut
if #images == 0 then
if #images == 0 then
-- if part.maintenancecat then
-- addMaintenanceCat(part.maintenancecat, part.sortkey)
-- end
if part.defaultimages then
if part.defaultimages then
images = part.defaultimages
images = part.defaultimages
if type(images) == "string" then
if type(images) == 'string' then
images = { images }
images = { images }
end
end
Ligne 90 : Ligne 120 :
alt = part.defaultimagealt
alt = part.defaultimagealt
if not alt then
if not alt then
alt = "une illustration pour cette infobox serait bienvenue"
alt = 'une illustration pour cette infobox serait bienvenue'
end
end
end
end
Ligne 99 : Ligne 129 :
end
end
upright = upright or get_value(part.uprightparameter) or part.defaultupright or "1.2"
upright = upright or getValue(part.uprightparameter) or part.defaultupright or "1.2"
link = link or get_value(part.linkparameter) or part.defaultlink
link = link or getValue(part.linkparameter) or part.defaultlink
caption = caption or get_value(part.captionparameter) or part.defaultcaption
caption = caption or getValue(part.captionparameter) or part.defaultcaption
alt = alt or get_value(part.altparameter) or part.defaultalt
alt = alt or getValue(part.altparameter) or part.defaultalt
if tonumber(upright) then
if tonumber(upright) then
Ligne 112 : Ligne 142 :
-- Partie image
-- Partie image


local imagesString = ""
local imagesString = ''
for i,image in pairs(images) do
for i,image in pairs(images) do
if image == "-" then
if image == '-' then
return
return
end
end
imagesString = imagesString ..  "[[Fichier:" .. image .. "|frameless"
imagesString = imagesString ..  '[[Fichier:' .. image .. '|frameless'
if alt then
if alt then
imagesString = imagesString .. "|alt=" .. alt
imagesString = imagesString .. '|alt=' .. alt
end
end
if link then
if link then
imagesString = imagesString .. "|link=" .. link
imagesString = imagesString .. '|link=' .. link
end
end
if upright then
if upright then
imagesString = imagesString .. "|upright=" .. upright
imagesString = imagesString .. '|upright=' .. upright
elseif #images > 1 then
elseif #images > 1 then
imagesString = imagesString .. "|upright=" .. ( 1 / #images )
imagesString = imagesString .. '|upright=' .. ( 1 / #images )
end
end
imagesString = imagesString .. "]]"
imagesString = imagesString .. ']]'
end
end


local image = mw.html.create("div")
local image = mw.html.create('div')
:addClass("avt-infobox-images")
:addClass("avt-infobox-images")
:css(style)
:css(style)
Ligne 140 : Ligne 170 :
local captionobj
local captionobj
if caption then
if caption then
captionobj = mw.html.create("div")
captionobj = mw.html.create('div')
:wikitext(caption)
:wikitext(caption)
:css(part.legendstyle or {})
:css(part.legendstyle or {})
Ligne 152 : Ligne 182 :
separator = separator(part)
separator = separator(part)
end
end
return mw.html.create("div")
return mw.html.create('div')
:node(image)
:node(image)
:node(captionobj)
:node(captionobj)
Ligne 158 : Ligne 188 :
:done()
:done()
end
end
p.build_images = p.build_images
p.buildImages = p.buildimages


function p.build_text(part)
function p.buildtext(part)
local class = part.class or ""
local class = part.class or ''
local style = {
local style = {
["text-align"] = "center",
['text-align'] = 'center',
["font-weight"] = "bold",
['font-weight'] = 'bold'
}
}
if part.style then
if part.style then
Ligne 171 : Ligne 201 :
end
end
end
end
local text = get_value(part.value, part) or part.defaultvalue
local text = getValue(part.value, part) or part.defaultvalue
if text == "-" then
if text == '-' then
return
return
end
end
if not text then
if not text then
--addMaintenanceCat(part.maintenancecat, part.sortkey)
return nil
return nil
end
end
local formattedtext = mw.html.create("p")
local formattedtext = mw.html.create('p')
:addClass(class)
:addClass(class)
:css(style)
:css(style)
Ligne 185 : Ligne 216 :
return formattedtext
return formattedtext
end
end
p.build_text = p.build_text
p.buildText = p.buildtext


function p.build_row(part)
function p.buildrow(part)
local class = part.class or ""
local class = part.class or ''
local style = part.style or {}
local style = part.style or {}
local valueClass = part.valueClass or ""
local valueClass = part.valueClass or ''
local valueStyle = part.valueStyle or {}
local valueStyle = part.valueStyle or {}
local value, number = get_value(part.value, part)
local value, number = getValue(part.value, part)
if not value then
if not value then
Ligne 203 : Ligne 234 :
number = 0 -- == indéfini
number = 0 -- == indéfini
end
end
-- if not value then
-- if part.maintenancecat then
-- local maintenancecat = getValue(part.maintenancecat, part)
-- addMaintenanceCat(maintenancecat, part.sortkey)
-- end
-- return nil
-- end


local label = part.label
local label = part.label
Ligne 210 : Ligne 249 :
label = part.singularlabel
label = part.singularlabel
end
end
if type(label) == "function" then
if type(label) == 'function' then
label = label(localdata, localdata.item)
label = label(localdata, localdata.item)
end
end


-- format
-- format
local formattedvalue = mw.html.create("div")
local formattedvalue = mw.html.create('div')
-- Le "\n" est requis lorsque value est une liste  
:wikitext('\n' .. value) -- Le '\n' est requis lorsque value est une liste commençant par '*' ou '#'
-- commençant par "*" ou "#"
:wikitext("\n" .. value)
if part.hidden == true then
if part.hidden == true then
formattedvalue
formattedvalue
:attr({class="NavContent", style="display: none; text-align: left;"})
:attr({class="NavContent", style="display: none; text-align: left;"})
formattedvalue = mw.html.create("div")
formattedvalue = mw.html.create('div')
:attr({class="NavFrame", title="[Afficher]/[Masquer]", style="border: none; padding: 0;"})
:attr({class="NavFrame", title="[Afficher]/[Masquer]", style="border: none; padding: 0;"})
:node(formattedvalue)
:node(formattedvalue)
end
end
formattedvalue =  mw.html.create("td")
formattedvalue =  mw.html.create('td')
:node(formattedvalue)
:node(formattedvalue)
:addClass(valueClass)
:addClass(valueClass)
Ligne 235 : Ligne 272 :
local formattedlabel
local formattedlabel
if label then
if label then
formattedlabel = mw.html.create("th")
formattedlabel = mw.html.create('th')
:attr("scope", "row")
:attr('scope', 'row')
:wikitext(label)
:wikitext(label)
:done()
:done()
end
end
local row = mw.html.create("tr")
local row = mw.html.create('tr')
:addClass(class)
:addClass(class)
:css(style)
:css(style)
Ligne 249 : Ligne 286 :
return row
return row
end
end
p.build_row = p.build_row
p.buildRow = p.buildrow


function p.build_succession(part)
function p.buildsuccession(part)
if not part.value then
if not part.value then
return nil
return nil
Ligne 257 : Ligne 294 :
local values = part.value
local values = part.value
local before = get_value(values["before"], part)
local before = getValue(values['before'], part)
local center = get_value(values["center"], part)
local center = getValue(values['center'], part)
local after  = get_value(values["after"], part)
local after  = getValue(values['after'], part)
if not before and not center and not after then
if not before and not center and not after then
return nil
return nil
end
end
--local style = part.style or {}
--style['text-align'] = style['text-align'] or 'center'
--style['color'] = style['color'] or '#000000'
--style['background-color'] = style['background-color'] or '#F9F9F9'
local rowI = mw.html.create("tr")
local rowI = mw.html.create('tr')
local styleI = {}
local styleI = {}
local colspan = "2"
local colspan = '2'
styleI["padding"] = "1px"
styleI['padding'] = '1px'
cellI = mw.html.create("td")
cellI = mw.html.create('td')
:attr({colspan = colspan})
:attr({colspan = colspan})
:attr({align = "center"})
:attr({align = 'center'})
:css(styleI)
:css(styleI)
local styleT = {}
local styleT = {}
styleT["margin"] = "0px"
styleT['margin'] = '0px'
styleT["background-color"] = "transparent"
styleT['background-color'] = 'transparent'
styleT["width"] = "100%"
styleT['width'] = '100%'
tabC = mw.html.create("table")
tabC = mw.html.create('table')
:attr({cellspacing = "0"})
:attr({cellspacing = '0'})
:addClass("navigation-not-searchable")
:addClass('navigation-not-searchable')
:css(styleT)
:css(styleT)
local row = mw.html.create("tr")
local row = mw.html.create('tr')


local color = part.color
local color = part.color
Ligne 292 : Ligne 334 :
local arrowRight
local arrowRight
if color == "default" then
if color == 'default' then
arrowLeft = "[[Fichier:SCRWEST.png|13px|alt=Précédent|link=]]"
arrowLeft = '[[Fichier:SCRWEST.png|13px|alt=Précédent|link=]]'
arrowRight = "[[Fichier:SCREAST.png|13px|alt=Suivant|link=]]"
arrowRight = '[[Fichier:SCREAST.png|13px|alt=Suivant|link=]]'
else
else
arrowLeft = "[[Fichier:SCRWEST.png|13px|alt=Précédent|link=]]"
arrowLeft = '[[Fichier:SCRWEST.png|13px|alt=Précédent|link=]]'
arrowRight = "[[Fichier:SCREAST.png|13px|alt=Suivant|link=]]"
arrowRight = '[[Fichier:SCREAST.png|13px|alt=Suivant|link=]]'
style["background-color"] = color
style['background-color'] = color
end
end
local styleTrans = {}
local styleTrans = {}
local widthCell = "44%"
local widthCell = '44%'
if center then
if center then
widthCenter = "28%"
widthCenter = '28%'
widthCell = "29%"
widthCell = '29%'
end
end
local formattedbefore
local formattedbefore
if before then
if before then
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({align = "left"})
:attr({align = 'left'})
:attr({width = "5%"})
:attr({width = '5%'})
:css(style)
:css(style)
:wikitext(arrowLeft)
:wikitext(arrowLeft)
:done()
:done()
row:node(formattedbefore)
row:node(formattedbefore)
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({width = "1%"})
:attr({width = '1%'})
:css(style)
:css(style)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedbefore)
row:node(formattedbefore)
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({align = "left"})
:attr({align = 'left'})
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({width = widthCell})
:attr({width = widthCell})
:css(style)
:css(style)
Ligne 334 : Ligne 376 :
row:node(formattedbefore)
row:node(formattedbefore)
else
else
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({align = "left"})
:attr({align = 'left'})
:attr({width = "5%"})
:attr({width = '5%'})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedbefore)
row:node(formattedbefore)
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({width = "1%"})
:attr({width = '1%'})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedbefore)
row:node(formattedbefore)
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({align = "left"})
:attr({align = 'left'})
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({width = widthCell})
:attr({width = widthCell})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedbefore)
row:node(formattedbefore)
Ligne 359 : Ligne 401 :
local formattedcenter
local formattedcenter
formattedcenter = mw.html.create("td")
formattedcenter = mw.html.create('td')
:attr({width = "1%"})
:attr({width = '1%'})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedcenter)
row:node(formattedcenter)
if center then
if center then
formattedcenter = mw.html.create("td")
formattedcenter = mw.html.create('td')
:attr({align = "center"})
:attr({align = 'center'})
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({width = widthCenter})
:attr({width = widthCenter})
:css(style)
:css(style)
Ligne 375 : Ligne 417 :
:done()
:done()
row:node(formattedcenter)
row:node(formattedcenter)
formattedcenter = mw.html.create("td")
formattedcenter = mw.html.create('td')
:attr({width = "1%"})
:attr({width = '1%'})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedcenter)
row:node(formattedcenter)
Ligne 385 : Ligne 427 :
local formattedafter
local formattedafter
if after then
if after then
formattedafter = mw.html.create("td")
formattedafter = mw.html.create('td')
:attr({align = "right"})
:attr({align = 'right'})
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({width = widthCell})
:attr({width = widthCell})
:css(style)
:css(style)
Ligne 393 : Ligne 435 :
:done()
:done()
row:node(formattedafter)
row:node(formattedafter)
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({width = "1%"})
:attr({width = '1%'})
:css(style)
:css(style)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedbefore)
row:node(formattedbefore)
formattedafter = mw.html.create("td")
formattedafter = mw.html.create('td')
:attr({align = "right"})
:attr({align = 'right'})
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({width = "5%"})
:attr({width = '5%'})
:css(style)
:css(style)
:wikitext(arrowRight)
:wikitext(arrowRight)
Ligne 408 : Ligne 450 :
row:node(formattedafter)
row:node(formattedafter)
else
else
formattedafter = mw.html.create("td")
formattedafter = mw.html.create('td')
:attr({align = "right"})
:attr({align = 'right'})
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({width = widthCell})
:attr({width = widthCell})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedafter)
row:node(formattedafter)
formattedbefore = mw.html.create("td")
formattedbefore = mw.html.create('td')
:attr({width = "1%"})
:attr({width = '1%'})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedbefore)
row:node(formattedbefore)
formattedafter = mw.html.create("td")
formattedafter = mw.html.create('td')
:attr({align = "right"})
:attr({align = 'right'})
:attr({valign = "middle"})
:attr({valign = 'middle'})
:attr({width = "5%"})
:attr({width = '5%'})
:css(styleTrans)
:css(styleTrans)
:wikitext("")
:wikitext('')
:done()
:done()
row:node(formattedafter)
row:node(formattedafter)
Ligne 442 : Ligne 484 :
return rowI
return rowI
end
end
p.build_succession = p.build_succession
p.buildSuccession = p.buildsuccession


function p.build_row1col(part)
function p.buildrow1col(part)
if not part.value then
if not part.value then
return nil
return nil
end
end


local class = "row1col"
local class = 'row1col'
if part.class then
if part.class then
class = class .. " " .. part.class
class = class .. ' ' .. part.class
end
end
local text = get_value(part.value, part)
local text = getValue(part.value, part)
if not text then
if not text then
Ligne 461 : Ligne 503 :


local formattedlabel
local formattedlabel
formattedlabel = mw.html.create("th")
formattedlabel = mw.html.create('th')
:attr({ colspan = "2" })
:attr({ colspan = '2' })
:addClass(class)
:addClass(class)
:wikitext(text)
:wikitext(text)
:done()
:done()


local row = mw.html.create("tr")
local row = mw.html.create('tr')
:node(formattedlabel)
:node(formattedlabel)
:done()
:done()
Ligne 473 : Ligne 515 :
return row
return row
end
end
p.build_row1Col = p.build_row1col
p.buildRow1Col = p.buildrow1col


function p.buildtable(part)
function p.buildtable(part)
Ligne 479 : Ligne 521 :
if part.collapseparameters then
if part.collapseparameters then
if part.collapseparameters.collapsible == true then
if part.collapseparameters.collapsible == true then
class = "mw-collapsible"
class = 'mw-collapsible'
if part.collapseparameters.collapsed == true then
if part.collapseparameters.collapsed == true then
class = class .." mw-collapsed"
class = class ..' mw-collapsed'
end
end
end
end
end
end
local tab = mw.html.create("table")
local tab = mw.html.create('table')
:addClass(class)
:addClass(class)
:css(part.style or {})
:css(part.style or {})
Ligne 497 : Ligne 539 :
while (i <= #rows) do  
while (i <= #rows) do  
local l = rows[i]
local l = rows[i]
if type(l) == "function" then  
if type(l) == 'function' then  
l = l(localdata, localdata.item)
l = l(localdata, localdata.item)
end
end
if (type(l) == "table") and (l.type == "multi") then
if (type(l) == 'table') and (l.type == 'multi') then
table.remove(rows, i)   
table.remove(rows, i)   
for j, row in ipairs(l.rows) do
for j, row in ipairs(l.rows) do
table.insert(rows, i + j - 1, row)  
table.insert(rows, i + j - 1, row)  
end
end
elseif type(l) == "nil" then
elseif type(l) == 'nil' then
table.remove(rows, i)
table.remove(rows, i)
elseif type(l) ~= "table" then  
elseif type(l) ~= 'table' then  
return error("les lignes d'infobox ('rows') doivent être des tables, est " .. type(l))
return error('les lignes d\'infobox ("rows") doivent être des tables, est ' .. type(l))
else
else
i = i + 1
i = i + 1
Ligne 541 : Ligne 583 :
local style = part.titlestyle or {}
local style = part.titlestyle or {}


title = mw.html.create("caption")
title = mw.html.create('caption')
:attr({ colspan = "2" })
:attr({ colspan = '2' })
:css(style)
:css(style)
:wikitext(text)
:wikitext(text)
Ligne 566 : Ligne 608 :


--[[
--[[
Construction de l"infobox
Construction de l'infobox
]]
]]


function p.buildblock(block)
function p.buildblock(block)
if type(block) == "function" then
if type(block) == 'function' then
block = block(localdata)
block = block(localdata)
end
end
Ligne 576 : Ligne 618 :
-- list of functions for block buildings
-- list of functions for block buildings
local blocktypes = {
local blocktypes = {
["images"] = p.build_images,
['images'] = p.buildimages,
["table"] = p.buildtable,
['mixed'] = p.buildrow,
["row"] = p.build_row,
['table'] = p.buildtable,
["row1col"] = p.build_row1col,
['row'] = p.buildrow,
["succession"] = p.build_succession,
['row1col'] = p.buildrow1col,
["text"] = p.build_text,
['succession'] = p.buildsuccession,
["title"] = p.build_title,
['text'] = p.buildtext,
['title'] = p.buildtitle,
}
}
if type(block) ~= "table" or (not block.type) or (not blocktypes[block.type]) then
if type(block) ~= 'table' or (not block.type) or (not blocktypes[block.type]) then
return blocktypes["invalid"](block)
return blocktypes['invalid'](block)
end
end
return blocktypes[block.type](block)  
return blocktypes[block.type](block)  
Ligne 592 : Ligne 635 :


function p.build()
function p.build()
localdata = require("Module:Infobox/Localdata")
localdata = require('Module:Infobox/Localdata')
item = localdata.item
item = localdata.item


-- chargement du module de paramétrage
-- chargement du module de paramétrage
local moduledata = require("Module:Infobox/" .. localdata.modulename)
local moduledata = require('Module:Infobox/' .. localdata.modulename)
moduledata.name = localdata.modulename
moduledata.name = localdata.modulename
-- class
-- class
local class = "infobox avt-infobox"
local class = 'infobox avt-infobox'
if moduledata.class then
if moduledata.class then
class = class .. " " .. moduledata.class
class = class .. ' ' .. moduledata.class
end
end


Notez bien que toutes les contributions à Starfield Wiki sont considérées comme publiées sous les termes de la creative Commons - CC BY-NC-SA 3.0 (voir Starfield Wiki:Copyrights pour plus de détails). Si vous ne désirez pas que vos écrits soient modifiés et distribués à volonté, merci de ne pas les soumettre ici.
Vous nous promettez aussi que vous avez écrit ceci vous-même, ou que vous l’avez copié d’une source placée dans le domaine public ou d’une ressource libre similaire. N’utilisez aucun travail sous droits d’auteur sans autorisation expresse !
Annuler Aide pour la modification (s’ouvre dans une nouvelle fenêtre)