Hi,
Applet is a module with these methods in common file:
public static function applet_caption() {
return "Google"; //returns applet name
}
public static function applet_info() {
return "Simple Google Search applet"; //returns applet name
}
and with applet method in main file:
public function applet($conf, $opts) { //available applet options: toggle,href,title,go,go_function,go_arguments,go_constructor_arguments
$opts['title'] = 'Title of applet';
$opts['toggle'] = false; //don't display toggle button
$opts['go'] = true; //display "go to module" button, which shows fullscreen body of module. Additional switches go_function(change function to be called instead of "body"), go_arguments(arguments to be passed to go_function), go_constructor_arguments(arguments to be passed to constructor of module)
}
Additionally you can add this method to common:
public static function applet_settings() {
return array(
array('name'=>'skin','label'=>'Clock skin','type'=>'select','default'=>'something','values'=>array('something'=>'STH','sth2'=>'STH2'))
//, more quick form fields...
);
}
This will create configuration panel of each instance of applet. Configuration is passed as first argument to applet method.
The simplest applets are "modules/Applets/Google" and "modules/Applets/Calc". They just display some html with css loading.
"Note" applet uses applet_settings to create simple notes. "applet" method is very simple, it uses settings from applet configuration panel.
Next take a look to "Host" applet. It uses quickform and module variable(variable that leaves between refreshes) inside.
The last one I would suggest you to look at is "Clock". It uses "go" option and applet_settings.
If you have any questions about these modules, go on, ask here.
Cheers
Paul