Table of Contents
|
by Torben Dannhauer
The process of populating the new module with content/functionality is fairly straight forward and after learning how the Horde API' s work, you should be able to produce new modules in a minimum amount of time.
Jan Schneider talked about this at FOSDEM 2005. You can find his slides at http://www.horde.org/papers/fosdem2005/.
The new module's functionality could by separated in the following aspects:
usually it is useful to nalyse another horde Module to learn how this work. I analysed Kronolith and it helped me a lot.
Obviously it is neccesarry to know the provied horde API zu wirte a horde module. Because a beginner (and this tutorial is adressed to them) has no clue about it, it is very usefull to read the package-documentation at http://dev.horde.org/api/framework/.
In Horde there are two standard menus: The Top Menu an the Side Menu.
ToDo?: Add Links to Wikipages describing menus in detail.
The Top MenĂ¼ is devided in to 4 sections:
the Menuitmes this module intentionally provide are located in the file <module>/lib/Module.php in the function ::getMenu()
Add Items like this:
<?php $menu->add(Horde::applicationUrl('pagetoshow.php'), _("MenuItemName"), 'icon.png', $registry->getImageDir() ); ?>
Items ar added in <module>/config/menu.php:
<?php $_menu[] = array( 'url' => 'http://www.example.com/', 'text' => 'Example, Inc.', 'icon' => 'example.png', 'icon_path' => 'http://www.example.com/images/', 'target' => '_blank', 'onclick' => '' ); ?>
If a module is entered via the side-menu, usualy the url to the module-folder was provided. The link ist http://<myHordeInstallation>/<mymodule> without any file. So the calling Procedure starts by executing the index.php oh the webserver.
Procedure:
The module's permissiontree which includes the logical structure of all permissions available in this module is defined in <module>/lib/api.php
Further information about permissions is available at http://wiki.horde.org/Doc/Dev/PermsPackage
Basic Procedure to create Content-Pages:
It is a good point to start a contentpage by copying the Skeleton's list.php
All viewable pages ar located in the module's root-folder. All businesslogic (classes etc) are located in separate files in <module>/lib.