start.php 756 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Elgg log browser.
  4. *
  5. * @package ElggLogBrowser
  6. */
  7. elgg_register_event_handler('init', 'system', 'logbrowser_init');
  8. /**
  9. * Initialize the log browser plugin.
  10. */
  11. function logbrowser_init() {
  12. elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu');
  13. elgg_register_admin_menu_item('administer', 'logbrowser', 'administer_utilities');
  14. }
  15. /**
  16. * Add to the user hover menu
  17. */
  18. function logbrowser_user_hover_menu($hook, $type, $return, $params) {
  19. $user = $params['entity'];
  20. $url = "admin/administer_utilities/logbrowser?user_guid={$user->guid}";
  21. $item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
  22. $item->setSection('admin');
  23. $return[] = $item;
  24. return $return;
  25. }