Menu

HowTo write AddOn

Olaf Westrik

This HowTo applies to 1.4 only. For the 2.0 series there is no documentation (yet).

Interfaces defined for add-ons on 1.4

add-on language files

When you want to add your own language strings/entries to the ipcop language file, you should create a file with <PREFIX>.<LANG>.pl name installed into /var/ipcop/addon-lang directory.
<PREFIX> is free choosable but should be significant. An example might be "myAddonName"
<LANG> is the short language name like en, de, it, nl etc.
You can find a detailed list of supported langages in /var/ipcop/langs/list file.
A file could be named "myAddonName.en.pl" for example.

Language file is perl code and should be like this form:

%tr = (%tr,
    'key1' => 'value1',     # add all your entries key/values here 
    'key2' => 'value2'      # and end with :
);

key1, key2 has to be unique considering all keys (IPCop standard language file keys, yours, other add-ons)

Cache will be refreshed with execution of

/usr/bin/perl -e "require '/var/ipcop/lang.pl'; &Lang::BuildCacheLang"

Backup

All /var/ipcop (but a few files) are include in backup. Look at /var/ipcop/backup/(include|exclude).system files.
Unfortunately floppy backup and web/usbkey backup behave differently and nobody has asked to change that.

With web/usbkey backup, each add-on could add his own include.<add-on> and exclude.<add-on> files in /var/ipcop/backup. Code rely on "include." and "exclude." parts in the name.

With floppy backup, you should modify include.user to add new files (if they are not yet include by standard rules).

With web/usbkey backup, using --verbose option display the list of include files in backup.

ipcopbkcfg --mount sda1 (should be the dev number of the key)
ipcopbkcfg --write 'comment' --verbose
ipcopbkcfg --umount

With floppy backup, list of include files is always displayed.

GUI menu

With the GUI menu, this is all hacking, no interface.
The only thing you know is that update never replace header.pl and always patch it when needed.
You would better know looking at some add-ons installation script how to add a new menu entry.


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.