plugin.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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'] = 'Add a button to login using Shibboleth';
  15. //the comments that go with the plugin
  16. $plugin_info['comment'] = "If Shibboleth is configured, this plugin add a text and a button on the login page to login with Shibboleth. Configure plugin to add title, comment and logo.";
  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('add_shibboleth_button_form');
  23. $form->addElement(
  24. 'text',
  25. 'shibboleth_button_label',
  26. 'shibboleth connexion title',
  27. ''
  28. );
  29. $form->addElement(
  30. 'text',
  31. 'shibboleth_button_comment',
  32. 'shibboleth connexion description',
  33. ''
  34. );
  35. $form->addElement(
  36. 'text',
  37. 'shibboleth_image_url',
  38. 'Logo URL if any (image, 50px height)'
  39. );
  40. $form->addButtonSave(get_lang('Save'), 'submit_button');
  41. //get default value for form
  42. $tab_default_add_shibboleth_login_button_shibboleth_button_label = api_get_setting(
  43. 'add_shibboleth_login_button_shibboleth_button_label'
  44. );
  45. $tab_default_add_shibboleth_login_button_shibboleth_button_comment = api_get_setting(
  46. 'add_shibboleth_login_button_shibboleth_button_comment'
  47. );
  48. $tab_default_add_shibboleth_login_button_shibboleth_image_url = api_get_setting(
  49. 'add_shibboleth_login_button_shibboleth_image_url'
  50. );
  51. $defaults = [];
  52. $defaults['shibboleth_button_label'] = $tab_default_add_shibboleth_login_button_shibboleth_button_label['add_shibboleth_login_button'];
  53. $defaults['shibboleth_button_comment'] = $tab_default_add_shibboleth_login_button_shibboleth_button_comment['add_shibboleth_login_button'];
  54. $defaults['shibboleth_image_url'] = $tab_default_add_shibboleth_login_button_shibboleth_image_url['add_shibboleth_login_button'];
  55. $form->setDefaults($defaults);
  56. //display form
  57. $plugin_info['settings_form'] = $form;
  58. //set the templates that are going to be used
  59. $plugin_info['templates'] = ['template.tpl'];