PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
With your database tables in place the next step is to write some administration functions. The administration functions that you will write depend on the nature of your module, however most modules have at least the following items:
add a new item
modify an existing item
delete an existing item
Each of these items is normally broken down into three separate pieces. The first piece is part of the GUI and displays a form with suitable fields for user input. The second piece is part of the API and carries out the requested operation. The third piece is another part of the GUI and gathers information from the form displayed by the first piece and passes it as arguments to the second piece.
As mentioned earlier in the document, it is vital that the separation between the GUI and API functions is clear. If you are unsure about whether part of a function should be in the GUI or the API, take a look at what it does. If it is directly involved with user interaction (gathering information from the user or displaying information to the user) then it is a GUI function. If it is involved with obtaining or updating information in the PostNuke system itself (normally in a database table) then it is an API function.
Annotated copies of the template pnadmin.php and pnadminapi.php files are available in the standard PostNuke distribution in the Template module.
Once the administration functions are in place they should be tested by using the administration area of your module to carry out the basic functionality that you have created. The operation of the module functions should be checked against the information in the database to ensure that they are storing and displaying the data correctly.
Previous |
Next |