Table of Contents
This chapter has reusable code for common tasks one needs to code when working on a module. The code is not only reusable, but shows best-practice examples for using the moregroupware framework and the libraries we use.
Note | |
---|---|
Coding the way described herein reduces your work, avoids errors and makes the code easier to read afterwards! |
Modules have some important information associated with them. This information is stored in a file named defintion.xml in the modules root directory.
The type defines whether the module is a core module (type 1, always installed, not shown for selection), currently there is only one core module, the 'general' module. Modules with type 2 are base modules, and are shown on the module selection screen, but are always installed. Type 3 denotes user modules, they are selectable at the user's will.
Example 21.1. The defintion.xml of the notes module.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mgw PUBLIC "-//MGW//DTD Moregroupware DTD V1.0//EN" "http://130.89.166.186/mgw/mgw.dtd"> <mgw> <moduleDefinition> <module type="3"> <name>notes</name> <version>0.8</version> <date>2003-02-28</date> <author>Karsten Dambekalns</author> <email>k.dambekalns@fishfarm.de</email> <description>A module for managing notes.</description> <compatibility> <version>0.6.6</version> </compatibility> <updates> </updates> <dependancies> </dependancies> <cache> </cache> </module> </moduleDefinition> </mgw>