Module Flags

From Achievo/ATK Wiki

Jump to: navigation, search

Intro

The module() method for loading modules has a $flags param. You can pass multiple flags by concatting them with a pipe symbol (|).

Example:

 module("users", "/path/to/your/usersmodule/", MF_NO_PRELOAD);
 or
 module("users", "", MF_NO_PRELOAD); // if the module is in default location

Available flags

This is a list of flags that you can use:

MF_NOMENU
If you use a module from an external application because you need some of its functionality, you may not want to use the menuitems that this module registers. Or you may have your own way of accessing the functionality instead of through the menu.
In both these cases, you can use the MF_NOMENU flag in the module() call to prevent it
MF_NORIGHTS
Similar to MF_NOMENU, you may have defined your own access scheme, and you don't want to use the registerNode calls that the module provides in its module.inc file. By passing MF_NORIGHTS, all registerNode calls of the module will be ignored.
MF_REFERENCE
If you don't need menuitems and privileges, you can pass MF_REFERENCE, which is an alias for using MF_NOMENU|MF_NORIGHTS
MF_NO_PRELOAD
This flag is similar to MF_REFERENCE, but goes one step further. Instead of just ignoring registerNode and menuitem calls, this flag disables loading of the module.inc file completely. This saves some performance if your using the module only for some of its source files. A module loaded with MF_NO_PRELOAD is completely in visible to the user, but you can still use its files using atkimport() etc., and you can create relationships with the nodes in this module.
MF_SPECIFIC_1 - MF_SPECIFIC_5
Some modules may define additional flags that influence their behaviour. These modules can use MF_SPECIFIC_1 to MF_SPECIFIC_5 to define up to 5 custom flags. If a module has any custom flags is often documented in the documentation for the module in question.

ATK Attribute Flags | Module Flags | Node Flags

Personal tools
Navigation