Elgg  Version 1.9
advanced.php
Go to the documentation of this file.
1 <?php
7 elgg_register_event_handler('create', 'object', 'example_event_handler');
8 
9 function example_event_handler($event, $type, $object) {
10  // Don't allow any non-admin users to create objects
11  // Returning false from this function will halt the creation of the object.
12  return elgg_is_admin_logged_in();
13 }
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
Definition: sessions.php:65
$object
Definition: upgrade.php:12
$type
Definition: add.php:8
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($event, $type, $object)
Definition: advanced.php:9