plugin.php 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * This script is a configuration file for the date plugin. You can use it as a master for other platform plugins (course plugins are slightly different).
  4. * These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins).
  5. *
  6. * @package chamilo.plugin
  7. *
  8. * @author Julio Montoya <gugli100@gmail.com>
  9. */
  10. /**
  11. * Plugin details (must be present).
  12. */
  13. //the plugin title
  14. $plugin_info['title'] = 'Enable or disable logout button';
  15. //the comments that go with the plugin
  16. $plugin_info['comment'] = "If you use some other authentication than local Chamilo authentication, you may have to disable the Chamilo logout button and give users information about your SSO logout.";
  17. //the plugin version
  18. $plugin_info['version'] = '1.0';
  19. //the plugin author
  20. $plugin_info['author'] = 'Hubert Borderiou';
  21. //the plugin configuration
  22. $form = new FormValidator('eaclbb_form');
  23. $form->addElement("html", "<div class='normal-message'>Fill the text boxes below to overwrite the default values used in this plugin</div>");
  24. $form->addElement('text', 'eaclbb_form_link_url', 'Page to load when clicking on the logout button');
  25. $form->addElement('text', 'eaclbb_form_link_infobulle', 'Tooltip text for the logout button (displayed on mouseover)');
  26. $form->addElement('checkbox', 'eaclbb_form_link_image', "Display the logout button disabled (black and white)", "", ['checked' => true]);
  27. $form->addElement('checkbox', 'eaclbb_form_alert_onoff', "Display an alert when clicking on the logout button", "", ['checked' => true]);
  28. $form->addElement('text', 'eaclbb_form_alert_text', "Text displayed in the alert box when clickng on the logout button (if checkbox above has been checked).");
  29. $form->addButtonSave(get_lang('Save'), 'submit_button');
  30. //get default value for form
  31. $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url');
  32. $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle');
  33. $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image');
  34. $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_onoff = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_onoff');
  35. $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text = api_get_setting('ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text');
  36. $defaults['eaclbb_form_link_url'] = $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_url['eaclbb_form_link_url'];
  37. $defaults['eaclbb_form_link_infobulle'] = $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_infobulle['eaclbb_form_link_infobulle'];
  38. $defaults['eaclbb_form_link_image'] = $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_link_image['eaclbb_form_link_image'];
  39. $defaults['eaclbb_form_alert_onoff'] = $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_onoff['eaclbb_form_alert_onoff'];
  40. $defaults['eaclbb_form_alert_text'] = $tab_default_ext_auth_chamilo_logout_button_behaviour_eaclbb_form_alert_text['eaclbb_form_alert_text'];
  41. $form->setDefaults($defaults);
  42. //display form
  43. $plugin_info['settings_form'] = $form;
  44. // Set the templates that are going to be used
  45. $plugin_info['templates'] = ['template.tpl'];