PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
There are a number of standard module functions that allow a newly written module to interface with other parts of the PostNuke system. These functions have predefined inputs and outputs, allowing external modules and core functions to use them effectively without needing to tailor their operation to each separate module. The best example of these functions is the 'search' function, which passes in a simple text string and requires that an array is passed back about all items within the module that match the string.
If your module does not have these functions then it will not integrate fully with the other parts of the PostNuke system. It is recommended that these functions are supplied if they make any sense in the context of your module.
There are a number of function names that are considered standard i.e. they have well-known meanings and are used in a number of modules. Using the standard function names makes it easier for other module developers to use your module. Some of the standard functions are shown below.
Note: The below list is subject to addition as more standard functions are introduced - the template module supplied with your copy of PostNuke should have the most up-to-date set of standard functions available.
main() - the default function to call, normally just presents the user menu.
view() - display an overview of all items, normally paged output.
display() - display a single item in detail, given an identifier for that item.
getall() - get basic information on all items, can take optional parameters to obtain a subset of all items
get() - get detailed information on a specific item
main() - the default function to call, normally just presents the user menu
view() - display an overview of all items, normally paged output, with relevant administrative options. Note that it is possible to combine this function with the user view() function
new() - display a form to obtain enough information from the user to create a new item
create() - take the information from the form displayed by the administration new() function and pass it on to the administration API for creating the item
modify() - display the details of a current item given the item description, and present the relevant fields for modification
update() - take the information from the form displayed by the administration modify() function and pass it on to the administration API for modifying the item
delete() - display confirmation for deletion of an item, and if confirmed pass the relevant information on to the administration API for deleting the item
modifyconfig() - display the details of the module's current configuration, and present the relevant fields for modification
updateconfig() - take the information from the form displayed by the administration modifyconfig() function and update the relevant module configuration variables
create() - create a new item
delete() - delete a current item
update() - update the information about a current item
There are a number of utility modules available to carry out features that are required by many item modules within PostNuke. Examples of available utility modules are comments, ratings, and categorisation. Take a look at mods.postnuke.come to find out what other utility modules are available and if they can be used in lieu of parts of the code that you would otherwise be writing for your own module.
Previous |
Next |