Elgg
Version 2.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
docs
examples
events
all.php
Go to the documentation of this file.
1
<?php
9
elgg_register_event_handler
(
'all'
,
'object'
,
'example_event_handler'
);
10
11
// This function will be called for any event of type 'object'
12
function
example_event_handler
($event,
$type
,
$object
) {
13
// check what sort of object is passed
14
if
(
$object
instanceof
ElggObject
) {
15
$subtype
=
$object
->getSubtype();
16
17
switch
(
$subtype
) {
18
case
'blog'
:
19
case
'thewire'
:
20
case
'pages'
:
21
// prevent these object subtypes from being saved or changed
22
return
false
;
23
default
:
24
return
true
;
25
}
26
27
}
28
29
return
true
;
30
}
$object
$object
These two snippets demonstrates triggering an event and how to register for that event.
Definition:
trigger.php:7
$subtype
$subtype
Definition:
delete.php:28
ElggObject
elgg_register_event_handler
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Definition:
elgglib.php:550
example_event_handler
example_event_handler($event, $type, $object)
Definition:
all.php:12
$type
if(!$display_name) $type
Definition:
delete.php:27
Generated on Sat Dec 21 2024 00:01:03 for Elgg by
1.8.11