|
|
Ligne 115 : |
Ligne 115 : |
| local rows = part.rows | | local rows = part.rows |
| | | |
| -- expand parameters so that we have a list of tables | | if not rows then |
| local i = 1
| | return nil |
| | | end |
| while (i <= #rows) do
| |
| local l = rows[i]
| |
| if type(l) == 'function' then
| |
| l = l(localdata, localdata.item)
| |
| end
| |
| if (type(l) == 'table') and (l.type == 'multi') then
| |
| table.remove(rows, i)
| |
| for j, row in ipairs(l.rows) do
| |
| table.insert(rows, i + j - 1, row)
| |
| end
| |
| elseif type(l) == 'nil' then
| |
| table.remove(rows, i)
| |
| elseif type(l) ~= 'table' then | |
| return error('les lignes d\'infobox ("rows") doivent être des tables, est ' .. type(l))
| |
| else
| |
| i = i + 1
| |
| end
| |
| end | |
|
| |
|
| -- CREATE ROW | | -- CREATE ROW |