aboutsummaryrefslogtreecommitdiff
path: root/documentation/examples/hooks/register
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-10 22:22:40 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-10 22:22:40 +0000
commitc8f6c3c934df01bf969e3d91ae67f0887de10da9 (patch)
treed21179fda1e19d540eb3ea56b31584f86fc1e338 /documentation/examples/hooks/register
parenta7801c71ecc6ce0f0d2a8fc82cdc779da9417aa4 (diff)
downloadelgg-c8f6c3c934df01bf969e3d91ae67f0887de10da9.tar.gz
elgg-c8f6c3c934df01bf969e3d91ae67f0887de10da9.tar.bz2
Fixes #2367: With fear and trepidation, converting events/plugin hooks to use elgg_ prefixed versions
git-svn-id: http://code.elgg.org/elgg/trunk@7284 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'documentation/examples/hooks/register')
-rw-r--r--documentation/examples/hooks/register/advanced.php8
-rw-r--r--documentation/examples/hooks/register/all.php2
-rw-r--r--documentation/examples/hooks/register/basic.php2
-rw-r--r--documentation/examples/hooks/register/emit.php4
4 files changed, 8 insertions, 8 deletions
diff --git a/documentation/examples/hooks/register/advanced.php b/documentation/examples/hooks/register/advanced.php
index 627bb5454..e3951c19c 100644
--- a/documentation/examples/hooks/register/advanced.php
+++ b/documentation/examples/hooks/register/advanced.php
@@ -1,20 +1,20 @@
<?php
// the output:page hook is triggered by elgg_view_page().
-register_plugin_hook('output', 'page', 'example_plugin_hook_handler', 600);
-register_plugin_hook('output', 'page', 'example_plugin_hook_handler_2', 601);
+elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler', 600);
+elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler_2', 601);
function example_plugin_hook_handler($event, $type, $value, $params) {
// change A to @
$value = str_replace('A', '@', $value);
-
+
return $value;
}
function example_plugin_hook_handler_2($event, $type, $value, $params) {
// change S to $
$value = str_replace('S', '$', $value);
-
+
return $value;
}
diff --git a/documentation/examples/hooks/register/all.php b/documentation/examples/hooks/register/all.php
index 6c23ed56b..0ff19bc86 100644
--- a/documentation/examples/hooks/register/all.php
+++ b/documentation/examples/hooks/register/all.php
@@ -1,6 +1,6 @@
<?php
-register_plugin_hook('all', 'system', 'example_plugin_hook_handler');
+elgg_register_plugin_hook_handler('all', 'system', 'example_plugin_hook_handler');
// This function will be called for any hook of type 'system'
function example_plugin_hook_handler($hook, $type, $value, $params) {
diff --git a/documentation/examples/hooks/register/basic.php b/documentation/examples/hooks/register/basic.php
index 4cedbf0fd..20493e200 100644
--- a/documentation/examples/hooks/register/basic.php
+++ b/documentation/examples/hooks/register/basic.php
@@ -1,6 +1,6 @@
<?php
-register_plugin_hook('forward', 'system', 'example_plugin_hook_handler');
+elgg_register_plugin_hook_handler('forward', 'system', 'example_plugin_hook_handler');
function example_plugin_hook_handler($event, $type, $value, $params) {
var_dump($event);
diff --git a/documentation/examples/hooks/register/emit.php b/documentation/examples/hooks/register/emit.php
index d0ea2c4ad..8382d72ca 100644
--- a/documentation/examples/hooks/register/emit.php
+++ b/documentation/examples/hooks/register/emit.php
@@ -1,7 +1,7 @@
<?php
// @todo this is an event, not a hook
-register_elgg_event_handler('test', 'example', 'example_init_system_callback');
+elgg_register_event_handler('test', 'example', 'example_init_system_callback');
$params = new ElggObject();
-trigger_elgg_event('test', 'example', $params);
+elgg_trigger_event('test', 'example', $params);