plugin.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * This script is a configuration file for the date plugin.
  4. * You can use it as a master for other platform plugins (course plugins are slightly different).
  5. * These settings will be used in the administration interface for plugins (Chamilo configuration settings->Plugins)
  6. * @package chamilo.plugin
  7. * @author Julio Montoya <gugli100@gmail.com>
  8. */
  9. /**
  10. * Plugin details (must be present)
  11. */
  12. //the plugin title
  13. $plugin_info['title'] = 'Enable or disable logout button';
  14. //the comments that go with the plugin
  15. $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.";
  16. //the plugin version
  17. $plugin_info['version'] = '1.0';
  18. //the plugin author
  19. $plugin_info['author'] = 'Hubert Borderiou';
  20. //the plugin configuration
  21. $form = new FormValidator('eaclbb_form');
  22. $form->addElement("html", "<div class='normal-message'>Fill the text boxes below to overwrite the default values used in this plugin</div>");
  23. $form->addElement('text', 'eaclbb_form_link_url', 'Page to load when clicking on the logout button');
  24. $form->addElement('text', 'eaclbb_form_link_infobulle', 'Tooltip text for the logout button (displayed on mouseover)');
  25. $form->addElement('checkbox', 'eaclbb_form_link_image', "Display the logout button disabled (black and white)", "", array('checked' => true));
  26. $form->addElement('checkbox', 'eaclbb_form_alert_onoff', "Display an alert when clicking on the logout button", "", array('checked' => true));
  27. $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).");
  28. $form->addButtonSave(get_lang('Save'), 'submit_button');
  29. $defaults['eaclbb_form_link_url'] = api_get_plugin_setting(
  30. 'ext_auth_chamilo_logout_button_behaviour',
  31. 'eaclbb_form_link_url'
  32. );
  33. $defaults['eaclbb_form_link_infobulle'] = api_get_plugin_setting(
  34. 'ext_auth_chamilo_logout_button_behaviour',
  35. 'eaclbb_form_link_infobulle'
  36. );
  37. $defaults['eaclbb_form_link_image'] = api_get_plugin_setting(
  38. 'ext_auth_chamilo_logout_button_behaviour',
  39. 'eaclbb_form_link_image'
  40. );
  41. $defaults['eaclbb_form_alert_onoff'] = api_get_plugin_setting(
  42. 'ext_auth_chamilo_logout_button_behaviour',
  43. 'eaclbb_form_alert_onoff'
  44. );
  45. $defaults['eaclbb_form_alert_text'] = api_get_plugin_setting(
  46. 'ext_auth_chamilo_logout_button_behaviour',
  47. 'eaclbb_form_alert_text'
  48. );
  49. $form->setDefaults($defaults);
  50. //display form
  51. $plugin_info['settings_form'] = $form;
  52. // Set the templates that are going to be used
  53. $plugin_info['templates'] = array('template.tpl');