* How to get plugged in Independently of beeing an LDAP style or LDAP unrelated plugin, you may start a new plugin, by creating a new directory below the plugin directory structure. To be up to date, get a fresh SVN checkout: Change to the directory which will contain your GOsa checkout, then get the source: # svn co https://oss.gonicus.de/repositories/gosa/branches/2.5 gosa for the current 2.5 development line or # svn co https://oss.gonicus.de/repositories/gosa/trunk gosa for the bleeding edge development tree. The gosa directory will contain your initial checkout now. In order to update from SVN you simply can call "svn up". Now you've an up to date GOsa. Note that there may be most obviously something broken if you use trunk. * First example Lets explain how to create a simple GOsa plugin. The example shows a dummy plugin which is not directly related with LDAP. # cd plugins/addons # mkdir dummyplug && cd dummyplug GOsa expects a file named "main.inc" inside of this plugin directory. It is needed because some plugins may need no standard handling and GOsa itself may not know how to initialize the plugin classes. Here's our example: --- execute (); /* The ignore field controls if GOsa should ignore the users tries to leave the plugin without saving. For the dummy plugin, you can leave all the time without loosing data. */ $display.= "\n"; /* After executing the plugin, some data may have changed, so we need to put the plugin back to the session. */ $_SESSION['export']= $export; ?> --- The basic starter for your plugin is ready now. We're missing the plugin itself currently. To create it, you need to create a file starting with class_ and ending with .inc. These files get sourced automatically. Here's the class_dummy.inc: --- config= $config; } /* Execute is the function all plugins need. It fills the plugin with life and produces the output. */ function execute() { /* Use the smarty templating engine here... */ $smarty= get_smarty(); /* Normally you would react to user input here. */ /* Let smarty fetch and process the page. Always seperate PHP and HTML as much as you can. */ return ($smarty->fetch (get_template_path('contents.tpl', TRUE))); } } ?> --- There are two things missing now. The template file and an entry in your gosa.conf. Lets finish the work in the plugin directory, first. Here is the contents.tpl file: ---
{t}This is a dummy plugin. It really does nothing. The tags around this text do automatic translations to the desired language. Please don't include linefeeds here, or it will not work at all!{/t}
--- Now add the following entry to your Addons section in gosa.conf: --