In the frontend a plugin represents funtionalities group by their task. For example there exists a plugin to handle everything related to archives, like showing the content, extract or create an archive.
Each plugin is represented by a folder inside the swfm document tree. This folder has following structure:
Here is a very simple example:
(function() {
//create a new plugin
SWFM.Plugin.example = {
//initialize the plugin
init: function() {
/*
* ... your code here ..
*/
}
};
//register the new plugin
SWFM.PluginManager.register('example', SWFM.Plugin.example);
})();
The name of the directory of the plugin and the string (first parameter) in SWFM.PluginManager.register have to be identical. This is also the name to load the plugin (see example config).