Elgg
Version 1.9
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
Definition:
upgrade.php:12
$type
$type
Definition:
add.php:8
elgg_register_event_handler
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
Register a callback as an Elgg event handler.
Definition:
elgglib.php:669
example_event_handler
example_event_handler($event, $type, $object)
Definition:
all.php:12
$subtype
$subtype
Definition:
river.php:10
ElggObject
Elgg Object.
Definition:
ElggObject.php:22
Generated on Sat Dec 21 2024 00:00:34 for Elgg by
1.8.11