aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/plugins/start.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
committerSem <sembrestels@riseup.net>2012-01-12 16:15:16 +0100
commitcc544cfa2086e418318a899ffd550adfb744c7ba (patch)
tree6c04fbe2e3df67513aa76803cb8d05c105ba219b /documentation/examples/plugins/start.php
parente7d64510ebd823f186282e2b80780295bcca1b79 (diff)
parent68e4829ac0959d86c651e7ed6dc255c39694c8af (diff)
downloadelgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.gz
elgg-cc544cfa2086e418318a899ffd550adfb744c7ba.tar.bz2
Merge Elgg 1.8.3.
Diffstat (limited to 'documentation/examples/plugins/start.php')
-rw-r--r--documentation/examples/plugins/start.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php
index ea1e894b2..3af50ce38 100644
--- a/documentation/examples/plugins/start.php
+++ b/documentation/examples/plugins/start.php
@@ -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);
}