start.php 859 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Uses HTML5 user media interface or flash to get a picture for the avatar.
  4. */
  5. require_once(dirname(__FILE__) . "/lib/register.php");
  6. elgg_register_event_handler('init', 'system', 'webcam_init');
  7. /**
  8. * Init
  9. */
  10. function webcam_init() {
  11. //register actions
  12. $action_path = elgg_get_plugins_path() . 'webcam/actions';
  13. elgg_register_action('webcam/save', "$action_path/save.php");
  14. elgg_register_action('avatar/upload', "$action_path/avatar/upload.php");
  15. elgg_register_action('avatar/register', "$action_path/avatar/register.php");
  16. //Incorporate webcam in registration form
  17. if(elgg_get_plugin_setting("webcam_registration", "webcam") == "yes"){
  18. elgg_extend_view('register/extend', 'forms/avatar/register' );
  19. elgg_register_event_handler('create', 'user', 'webcam_registration_event');
  20. }
  21. elgg_extend_view('css/elgg', 'css/webcam');
  22. }