Module:GalleryClass

local util_args = require('Module:ArgsUtil') local util_cargo = require("Module:CargoUtil") local util_html = require("Module:HtmlUtil") local util_map = require('Module:MapUtil') local util_table = require("Module:TableUtil") local util_text = require("Module:TextUtil") local util_vars = require("Module:VarsUtil") local i18n = require("Module:I18nUtil") local lang = mw.getLanguage('en') local LCS = require('Module:LuaClassSystem')

local h = {} local p = LCS.class

function p:init(images) self.images = images end

function p:run return mw.getCurrentFrame:extensionTag{ name = 'gallery', content = self:makeGalleryRows } end

function p:makeGalleryRows local galleryList = {} for _, row in ipairs(self.images) do		galleryList[#galleryList+1] = self:makeOneGalleryRow(row) end return util_table.concat(galleryList, '\n') end

function p:makeOneGalleryRow(row) return ('%s|%s'):format(		self:getFileName(row),		self:getCaption(row)	) end

function p:getFileName(row) return row.FileName or '' end

function p:getCaption(row) return row.Caption or '' end

return p