events.conf.dist.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Events' configuration
  5. * Used to configure each event and to link them to functions the event'll fire.
  6. * The flow is like the following :
  7. * 1. somewhere in the application an event is fired
  8. * 2. that event is intercepted by the switch EventsDispatcher
  9. * 3. that switch will go all over the "actions" in the event_config initialized beneath us according to the event
  10. * 4. that switch will see if the function actually exists (if not, we get dont do anything)
  11. * 5. then it will see if a filter for that function exists (if it does, the filter is executed)
  12. * 6. if the filter says it's ok, the function linked to the event is executed
  13. * 7. and that function will actually call the truly interesting function with the good require_once
  14. */
  15. global $event_config;
  16. $event_config = array(
  17. 'portal_homepage_edited' => array( // key for "user registration" event
  18. 'actions' => array( // we link this event to a bunch of functions that will be triggered when the event is fired
  19. 'event_send_mail' // don't forget to actually write this function in the events.lib.php file
  20. ),
  21. 'self_sent' => false, // this key states that we can't add user to this event through the admin panel
  22. 'name_lang_var' => get_lang('PortalHomepageEdited'),
  23. 'desc_lang_var' => get_lang('PortalHomepageEdited'),
  24. 'available_keyvars' => array (// keys used for the mail template
  25. 'url' => 'portal',
  26. 'sitename' => 'sitename',
  27. 'firstname' => 'firstname',
  28. 'lastname' => 'lastname',
  29. 'username' => 'username',
  30. 'usermail' => 'usermail',
  31. 'password' => 'password',
  32. 'user_lang' => 'language',
  33. 'admin_name' => 'administrator_name',
  34. 'admin_surname' => 'administrator_surname',
  35. 'admin_phone' => 'administrator_phone',
  36. 'admin_email' => 'administrator_email',
  37. )
  38. ),
  39. 'user_registration' => array( // key for "user registration" event
  40. 'actions' => array( // we link this event to a bunch of functions that will be triggered when the event is fired
  41. 'event_send_mail' // don't forget to actually write this function in the events.lib.php file
  42. ),
  43. 'self_sent' => true, // this key states that we can't add user to this event through the admin panel
  44. 'name_lang_var' => get_lang('UserRegistrationTitle'),
  45. 'desc_lang_var' => get_lang('UserRegistrationComment'),
  46. 'available_keyvars' => array (// keys used for the mail template
  47. 'url' => 'portal',
  48. 'sitename' => 'sitename',
  49. 'firstname' => 'firstname',
  50. 'lastname' => 'lastname',
  51. 'username' => 'username',
  52. 'usermail' => 'usermail',
  53. 'password' => 'password',
  54. 'user_lang' => 'language',
  55. 'admin_name' => 'administrator_name',
  56. 'admin_surname' => 'administrator_surname',
  57. 'admin_phone' => 'administrator_phone',
  58. 'admin_email' => 'administrator_email',
  59. )
  60. ),
  61. );
  62. @include 'events.conf.local.php';