Module:Layout/Production/Model/Call

 Deze module is nog in ontwikkeling (versie 0.0) en wordt getest.

De Module:Layout is bedoeld om snel, consistent en uitgebreid een pagina op te maken.
Er is een op de module afgestemde handleiding over deze onderwijswiki beschikbaar.

De module wordt geïnitialiseerd met de configuratie in Module:Layout/Production/Configuration.

Controleer op scriptfouten of opmaak notificaties.




-- The interface forms a call object which will contain valid inputdata for the system
local call = {}

-- The note object delivers functions that handles notes 
local note = {};

-- Initialize parameters to the call object
call.debugging, call.help, call.mistake, call.named, call.unnamed = {}, {}, {}, {}, {};
call.content, call.style      = "", "";
call.environment  = "production";
call.include      = function ( ... ) return false end;
call.debugging[1] = "The Call object has been initialized";
call.pass         = true;

function call.add_debug( ... ) -- : boolean
	if #call.debugging < 1 or not note.composition( ... ) then return false; end
	call.debugging[ #call.debugging ] = call.debugging[ #call.debugging ] .. "<br><br>" .. note.composition( ... );
	return true;
end

function call.add_mistake( ... ) -- : boolean
	call.pass = false;
	if #call.mistake < 1 or not note.composition( ... ) then return false; end
	call.mistake[ #call.mistake ] = call.mistake[ #call.mistake ] .. "<br><br>" .. note.composition( ... );
	return true;
end

function call.add_new_debug( ... ) -- : boolean
	if not note.composition( ... ) then return false; end
	call.debugging[ #call.debugging + 1 ] = note.composition( ... );
	return true;
end

function call.add_new_mistake( ... ) -- : boolean
	call.pass = false;
	if not note.composition( ... ) then return false; end
	call.mistake[ #call.mistake + 1 ] = note.composition( ... );
	return true;
end

function call.init ( CFG, environment )
    call.environment = environment;
    call.include     = function ( ... ) return CFG.INCLUDE( call.environment, ... ) end;
end

function note.composition( ... )
	local result = "";
	local arguments = { ... };
	if #arguments == 0 then return false; end
	if #arguments == 1 then 
		result = arguments[1];
	else
		result = string.format( ... );
	end;
	return result;
end

return call;
Informatie afkomstig van https://nl.wikibooks.org Wikibooks NL.
Wikibooks NL is onderdeel van de wikimediafoundation.