Skip to content

Adding A Module

akersten edited this page Oct 23, 2012 · 2 revisions

The design of the Webfront is fairly modular in that you can extend the module class in /modules and easily create a new 'tab' on the navbar with your custom content. This is fairly straightforward (and 'nicely' documented in /modules/modules) but the process is as follows:

  1. Create a new module file in /modules named yourModule.php (look at the others for an idea of the convention)
  2. Extend module by class yourModule extends module. No need to include or require /modules/module.php - it's taken care of by globalHeader.php
  3. Add your module to the initialization of the module array in /php/session.php - the order that these are initialized in is the order in which they will display on the navbar. See the other entries for an example of how this is done (at the most basic level, it's just new yourModule() in the array initialization).

If your module is extending another module other than module, then you'll need to add that other module explicitly to the require list in /php/imports.php, just like /modules/module.php in that file.