index.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. // personalize the logout button behaviour
  3. $_user = api_get_user_info();
  4. $_template['show_message'] = false;
  5. if (!api_is_anonymous()) {
  6. $_template['show_message'] = true;
  7. // the link URL
  8. $link_url = "#";
  9. if (!empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url'])) {
  10. $link_url = api_htmlentities($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url']);
  11. }
  12. // the infobulle
  13. $link_infobulle = "Vous devez fermer votre navigateur pour clore votre session de travail.";
  14. if (!empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle'])) {
  15. $link_infobulle = api_htmlentities($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle']);
  16. }
  17. // $link_image=1 if we replace the logout button by a grey one 'exit_na'
  18. $link_image = "1";
  19. if (empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image'])) {
  20. $link_image = "";
  21. }
  22. // checkbox to disaply an alert box when clicnkig on the logout button
  23. $alert_onoff = "1";
  24. if (empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_onoff'])) {
  25. $alert_onoff = "";
  26. }
  27. // alert text to display if check is on
  28. $alert_text = "\\\\nVous êtes connectés avec votre compte universitaire.\\\\n\\\\nVous devez *** fermer votre navigateur *** pour clore votre session de travail.";
  29. if (!empty($plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text'])) {
  30. $alert_text = $plugin_info['settings']['ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text'];
  31. }
  32. $_template['link_url'] = $link_url;
  33. $_template['link_infobulle'] = $link_infobulle;
  34. $_template['link_image'] = $link_image;
  35. $_template['alert_onoff'] = $alert_onoff;
  36. $_template['alert_text'] = $alert_text;
  37. }