2006-09-12 10:55:20 +02:00
|
|
|
The following directory structure is required:
|
2006-09-14 14:33:01 +02:00
|
|
|
- python code: plugins/PLUGINNAME/PLUGINNAME.py (all lower case is recommended)
|
|
|
|
- language files: plugins/PLUGINNAME/lang/(en|de|??).hdf
|
|
|
|
- clearsilver templates: plugins/PLUGINNAME/*.cs
|
2006-09-12 10:55:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
Python code interface:
|
2006-10-09 18:43:14 +02:00
|
|
|
- create a class with the same name as the plugin - it must inherit CryptoBoxPlugin
|
2006-09-25 14:21:39 +02:00
|
|
|
- function "doAction":
|
2006-09-14 14:33:01 +02:00
|
|
|
- this function will get called whenever this plugins is involved in a request
|
2006-09-12 10:55:20 +02:00
|
|
|
- all arguments should be optional (e.g. for displaying a form without previous input values)
|
|
|
|
- the argument "store" should be used to process a form submission (just a recommendation)
|
2006-10-09 18:43:14 +02:00
|
|
|
- if the processing failed for some reason (invalid input, ...), it should manually set the
|
|
|
|
"Data.Warning" (resp. "Data.Error" or "Data.Success") to a value of your choice (preferably
|
|
|
|
you may want to use messages of your namespace (e.g. "Plugins.PLUGINNAME.InvalidInput"))
|
|
|
|
- the return value should be the name of the template that should be displayed after processing
|
|
|
|
(a template file in the plugin directory takes precedence over global template files)
|
2006-09-25 14:21:39 +02:00
|
|
|
- the return value may also be a dictionary with the following elements:
|
|
|
|
* template: the name of the template file (mandatory)
|
2006-10-09 18:43:14 +02:00
|
|
|
* generator: a generator object ("yield") - its content will replace every
|
|
|
|
occurrence of "<!-- CONTENT_DUMMY -->" in the template (useful for pages that
|
|
|
|
are displayed step by step (as for formatting of filesystems))
|
|
|
|
- an empty (e.g. None) return value can be used to go to the default page (now: the
|
|
|
|
plugin overview)
|
|
|
|
- function "getStatus":
|
|
|
|
- returns a string, that describes a state connected to this plugin (e.g. the current date and
|
|
|
|
time (for the "date" plugin))
|
|
|
|
- the class variable "pluginCapabilities" must be an array of strings (supported: "system" and
|
|
|
|
"volume")
|
|
|
|
- the class variable "requestAuth" is boolean and defines, if admin authentication is necessary
|
|
|
|
for this plugin
|
2006-10-11 17:50:24 +02:00
|
|
|
- the class variable "rank" is an integer in the range of 0..100 - it determines the order
|
|
|
|
of plugins in listings (lower value -> higher priority)
|
|
|
|
- the class variable "enabled" is boolean and detemines the default availability of the plugin
|
2006-10-09 18:43:14 +02:00
|
|
|
- volume plugins contain the attribute "device" (you may trust this value - a volume plugin will
|
|
|
|
never get called with an invalid device)
|
2006-09-12 10:55:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
Language file structure:
|
2006-10-09 18:43:14 +02:00
|
|
|
- the content of the language file will be added to the hdf dataset below "Lang.Plugins.PLUGINNAME"
|
|
|
|
(this avoids namespace conflicts)
|
2006-09-12 10:55:20 +02:00
|
|
|
- the following values _must_ be defined:
|
2006-09-14 14:33:01 +02:00
|
|
|
Name (a short description)
|
|
|
|
Link (the visible text for links to this plugin)
|
|
|
|
Rank (defines the order of the plugins displayed (0..100))
|
2006-10-09 18:43:14 +02:00
|
|
|
- all warnings, error and success messages should be stored below WarningMessage.???
|
|
|
|
(resp. ErrorMessage or SuccessMessage)
|
2006-09-12 10:55:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
Clearsilver template:
|
2006-10-09 18:43:14 +02:00
|
|
|
- should start with a "<h1>" tag (volume plugins: "h2")
|
2006-09-14 14:33:01 +02:00
|
|
|
- links to the plugin (e.g. in form headers) could look like the following:
|
|
|
|
<?cs call:link("plugins/PLUGINNAME",'','','','') ?>
|
2006-10-09 18:43:14 +02:00
|
|
|
- volume plugins must include "show_volume_[header|footer]" (see examples)
|
|
|
|
|
2006-09-12 10:55:20 +02:00
|
|
|
|