PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
This covers how modules interact with PostNuke.
All PostNuke modules must be placed within their own subdirectory of the 'modules' directory to be recognised. Modules placed anywhere else within the filesystem will not be located correctly.
A module might have administration or user functionality, or both. PostNuke works out which functionality each module has by looking for the files 'pnadmin.php' or 'pnadminapi.php' to confirm administration functionality, and 'pnuser.php' or 'pnuserapi.php' to confirm user functionality. Lack of these files results in PostNuke assuming that this specific module functionality does not exist.
Initialisation of modules is through the modname_init() in the 'pninit.php' file within the module's directory. No other function is called when the module is initialised.
Activation and deactivation of modules is done through field settings within the appropriate database table. Unlike earlier versions of PostNuke, no physical changes to the module directories is made to infer the activation status of the module.
Module functions are called through the pnModFunc() and pnModAPIFunc() functions. No direct calling of module functions is allowed, even from within the same module.
URLs for new-style modules go through the 'index.php' entry point, and are defined by a number of parameters. The parameters that currently decide which particular module function to call are as follows:
The name of the module. This corresponds to the well-known name of the module, which can be found through the modules administration interface
The type of the module function. This is currently either 'user' for user functions or 'admin' for administrative functions.
The name of the function itself. This is module-dependent.
If any of these parameters are undefined within a URL PostNuke will apply defaults to them. Note that both the names of the parameters and their default values might change, and as such it is not recommended to create direct URLs for anything but to either go through the PostNuke main page or to use the pnModURL() function to generate URLs that will always be internally consistent for any given version of PostNuke.
Previous |
Next |