

This is a global built in package that provides information about the modules available and functions for their use.
Modules are package files placed locally in 'modules' subdirectory under the program installation folder.
Interface

activate

function activate(
name
)
Requests the activation of a specified module. For some modules, the process is asynchronous, requiring communication
with the host before the activation is completed.
Parameters
name (string)
The name of the module being targeted by the operation
deactivate

function deactivate(
name
)
Requests the deactivation of the given module. Host deactivation will not cause unloading of locally loaded client modules,
only shared data. See setModulePermissions for more information.
Parameters
name (string)
The name of the module being targeted by the operation
getModuleInfo

function getModuleInfo(
name
)
This function can be used to retrieve information about a particular module. The returned table contains information in
the following fields.
The fields name and author are string values containing the respective information.
The installed field will be true if the module is installed on the running computer, or
false otherwise. If the module has been activated, the loaded field will be
true. The loading field will be true if module data is being transferred
from the host to the client for loading. The loadpending field set to true indicates one or
more clients have made a request to load the module (and the permission setting to allow or disallow this has not been set) and
that these clients are waiting for host permission to complete the loading operation. The permission field
indicates the current setting for the module loading permissions, and has the possible values of "none"
(value not set), "disallow" (client loading prohibited), "allow" (client loading allowed)
or "autoload" (client load allowed and automatically performed).
Parameters
name (string)
The name of the module being targeted by the operation
Return values
(table)
A table containing information about the module, see above for details
getModules

function getModules(
)
This function returns a list of modules available. The list will include locally available modules compatible with the
current ruleset, as well as modules requested for use by clients (for the host) or loaded host modules with shared data
(for clients).
To get more information on a module, see getModuleInfo.
Return values
(table)
An integer indexed table of string values containing the names of the modules available.
onActivationRequested

handler
function onActivationRequested(
name
)
This event is fired when a client requests loading a module that does not have its permissions set. The request will remain
pending (with the module not loaded) on the client until the host acknowledges the request by blocking or allowing the operation.
Parameters
name (string)
The name of the module causing the event
onModuleAdded

handler
function onModuleAdded(
name
)
This event is fired when a new module is added to the list of modules. This might occur either due to clients requesting
to load a module not installed on the host computer (when running as host) or the host activating modules not found locally
on client computers and containing shared data (when running as a client).
Parameters
name (string)
The name of the module causing the event
onModuleRemoved

handler
function onModuleRemoved(
name
)
This event is fired when a module is removed from the list of modules. This will occur on clients when the host unloads
modules containing shared data not found as a local installation.
Parameters
name (string)
The name of the module causing the event
onModuleUpdated

handler
function onModuleUpdated(
name
)
This event is fired when some properties of a module are changed, typically requiring updating of a module listing interface.
See the getModuleInfo function for more information on module properties.
Parameters
name (string)
The name of the module causing the event
onUnloadedReference

handler
function onUnloadedReference(
name
)
This function is called when an attempt is made to open a new top level window for data contained in an unloaded module.
Returning a value other than true will cause the window creation to fail, as will not having the module
loaded after this function returns.
Parameters
name (string)
The name of the module causing the event
Return values
(boolean)
A value of true will force the engine to retry opening the window with the given module
data source. Otherwise, the creation of the requested top level window fails.
setModulePermissions

function setModulePermissions(
name, allow, autoload
)
Sets the loading permissions for the given module. This function will fail if called from a client mode script.
Parameters
name (string)
The name of the module being targeted by the operation
allow (boolean)
A value of true to allow clients to load the module, or false
to prohibit loading
autoload (boolean)
If true, all clients that can access the module will automatically load it.
The second parameter must be true for this parameter to have any effect.