events.conf.dist.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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' => 'PortalHomepageEdited',
  23. 'desc_lang_var' => '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' => 'UserRegistrationTitle',
  45. 'desc_lang_var' => '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';