Plugins and modularity
From Dokeos
It's possible to add small plugins, tools, etc to Dokeos. The support for this is not perfect, but it is slowly improving.
Contents |
General Remarks
- anything can be a plugin. A tool can be a plugin, but also a meta-tool like the HtmlArea could be a plugin.
- a plugin is a piece of code that takes care of all the actions that are needed for the script to work properly. For instance if your plugin-script needs a database you should add a database check into your script that checks weither the database is already created. If this is not the case it creates the database it needs. If you script needs images to be in a certain folder, the script should also take care of that.
- installing a plugin should be no harder that copying the files to the correct folder and providing a link to that page
- developments of third parties that do not make it into the official dokeos release can/should be released as plugins.
How to create plugins
We need some documentation here :-)
Examples
HtmlArea
All the code for the Wysiwyg editor has been moved into the plugin/htmlarea/ folder. We can further reduce the intertwining of this plugin with Dokeos by placing the language files for this also in the plugin/htmlarea/ directory.
API - Libraries and documentation
As the number of libraries increases, and they become better documented, it becomes easier for third parties to write new tools, or extend or replace existing ones.
Tool discussion
Some tools are more or less required to make Dokeos work. The groups are so integrated with Dokeos that making them a plugin would be very hard. Other tools have less problems. We could do a test by trying to make one tool a plugin, or offer more advanced versions of tools as an option: student publiations / dropbox, php chat / java or flash chat...
Problem areas
- Upgrading
- ...
Even though the system is not perfect, we are gradually evolving.
Experimental new plugin development
Yannick Warnier just added an interesting new development to the CVS. This allows to very easily add little plugins to Dokeos. (It reminds me very much of the linux doclets you can add to the bottom or top panel with the applications, calendar and so on... - Roan)
The system works as follows (and as specified on the forum here)
First, remember a few rules while developing a plugin
- try to always keep processing and display separated. The "date" plugin example gives a good idea of what you are expected to do at best
- try to always use the more Dokeos api functions as possible. These are located in the claroline/inc/lib directory
- try to keep it all in one directory, don't ask us to change the Dokeos code to suit your plugin
Then, you should place your plugin in the claroline/plugin directory, in a directory named after your plugin name (in the "date" plugin example, the directory name is "date").
Once you've done this, and while there is no web interface setting for this, you should change your claroline/inc/conf/claro_main.conf.php file (at the end) to add your plugin where you want it to appear (presently you can add it to the main_menu or to the banner).
Reloading the Dokeos page should display your plugin now.
The current date plugin example displays the time in several different languages, depending on what locales your server has been set up to work with. You can add your own by changing the date/index.act.php file in respect with the language names in the select box in index.php and with the universal locales codes (e.g. http://www.unet.univie.ac.at/aix/aixbman/admnconc/locale.htm)
To test the plugin, download the latest CVS code (that includes the plugin/date directory), then change your config file and add this line at the end: $plugins['main_menu'][] = 'date';

