Modul:Further

S Wikipedije, slobodne enciklopedije

Dokumentaciju za ovaj modul možete napraviti na stranici Modul:Further/dok

--[[
-- This module produces a "Further information: a, b and c" link. It implements
-- the {{further}} template.
--]]

local mHatnote = require('Modul:Hatnote')
local mHatlist = require('Modul:Hatnote list')
local mTableTools -- lazily initialise
local mArguments -- lazily initialise
local p = {}

function p.further(frame)
	mTableTools = require('Modul:TableTools')
	mArguments = require('Modul:Arguments')
	local args = mArguments.getArgs(frame, {parentOnly = true})
	local pages = mTableTools.compressSparseArray(args)
	if #pages < 1 then
		return mHatnote.makeWikitextError(
			'niste naveli stranice',
			'Šablon:Dodatne informacije#Greške',
			args.category
		)
	end
	local options = {
		selfref = args.selfref
	}
	return p._further(pages, options)
end

function p._further(pages, options)
	local text = 'Dodatne informacije: ' .. mHatlist.andList(pages, true)
	return mHatnote._hatnote(text, options)
end

return p