PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
A copy of the PostNuke API reference guide is essential when developing a module. This guide covers all of the core functionality that the PostNuke system provides and provides example code for every API function available.
The PostNuke API Command Reference is included in this help system.
Understanding the difference between GUI and operational functions is critical when building a good module. Proper separation of these functions will allow other modules to be able to access the functionality of your module and incorporate it into their modules. It will also allow methods of access apart from those that the standard web-based PostNuke system.
Understanding the difference between user and administrative functions is very important when building a good module. The separation of these types of actions allows for work one one area of the code (e.g. an admin GUI redesign) to take place without affecting the other areas.
The PostNuke security model is a very important area to understand before coding a module. Developers should understand which parts of their module need to be protected, and exactly how this is accomplished.
Every well-defined module function must return the appropriate return codes. Return codes are the main way in which a module communicates with the PostNuke core, and as such it is vital that the correct return codes are used.
The following return codes should be used when returning control to the PostNuke core from any module function:
Returning a text string implies that the module function has finished its work and has output to be displayed in the appropriate place on the PostNuke web page. PostNuke will take the returned output and display it as appropriate. Note that all output from modules is displayed verbatim, with no escaping of HTML characters. This is to allow for formatted output from the module functions.
Returning boolean true implies that the module function has finished its work and set up an appropriate redirect to send the user to a page that will have display output. The PostNuke core will take no further action as far as this module is concerned.
Returning boolean false implies that the module function has finished its work but not set up an appropriate redirect to send the user to a page that will have display output. The PostNuke core will set an appropriate redirect for this module.
Note that none of these functions carry any information about the success or failure of the attempted operation that the module function was undertaking.
Modules cover two separate areas of PostNuke. The first is administration of core functions, (e.g. users, permissions), and the second is extension of system functionality (e.g. downloads, web links). As each of these areas are not core this implies two things. First is that no module is actually required - the PostNuke system would work without anything in its modules directory, although its functionality would be severely limited and there would be no configuration options available. Second is that modules should not remove any core functionality when they are installed, operated, or removed.
Previous |
Next |