]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3225 added what was missing from the basic init function example
authorCash Costello <cash.costello@gmail.com>
Sun, 1 Jan 2012 21:21:05 +0000 (16:21 -0500)
committerCash Costello <cash.costello@gmail.com>
Sun, 1 Jan 2012 21:21:05 +0000 (16:21 -0500)
documentation/examples/plugins/start.php

index ea1e894b2e77201aa3e94c4a761cbf16cb01cd2d..3af50ce38e90f292782a7eba883b03b7b556d361 100644 (file)
@@ -8,5 +8,15 @@ elgg_register_event_handler('init', 'system', 'my_plugin_init');
 function my_plugin_init() {
        // Rename this function based on the name of your plugin and update the
        // elgg_register_event_handler() call accordingly
-       
+
+       // Register a script to handle (usually) a POST request (an action)
+       $base_dir = elgg_get_plugins_path() . 'my_plugin/actions/my_plugin';
+       elgg_register_action('my_plugin', "$base_dir/my_action.php");
+
+       // Extend the main CSS file
+       elgg_extend_view('css/elgg', 'my_plugin/css');
+
+       // Add a menu item to the main site menu
+       $item = new ElggMenuItem('my_plugin', elgg_echo('my_plugin:menu'), 'my_url');
+       elgg_register_menu_item('site', $item);
 }