$object
These two snippets demonstrates triggering an event and how to register for that event.
elgg_is_admin_logged_in()
Returns whether or not the viewer is currently logged in and an admin user.
elgg_register_event_handler($event, $object_type, $callback, $priority=500)
example_event_handler($event, $type, $object)