plugin.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. * @package chamilo.plugin
  6. * @author Julio Montoya <gugli100@gmail.com>
  7. */
  8. /**
  9. * Plugin details (must be present)
  10. */
  11. //the plugin title
  12. $plugin_info['title'] = 'Add a button to login using Shibboleth';
  13. //the comments that go with the plugin
  14. $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.";
  15. //the plugin version
  16. $plugin_info['version'] = '1.0';
  17. //the plugin author
  18. $plugin_info['author'] = 'Hubert Borderiou';
  19. //the plugin configuration
  20. $form = new FormValidator('add_shibboleth_button_form');
  21. $form->addElement(
  22. 'text',
  23. 'shibboleth_button_label',
  24. 'shibboleth connexion title',
  25. ''
  26. );
  27. $form->addElement(
  28. 'text',
  29. 'shibboleth_button_comment',
  30. 'shibboleth connexion description',
  31. ''
  32. );
  33. $form->addElement(
  34. 'text',
  35. 'shibboleth_image_url',
  36. 'Logo URL if any (image, 50px height)'
  37. );
  38. $form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
  39. //get default value for form
  40. $tab_default_add_shibboleth_login_button_shibboleth_button_label = api_get_setting(
  41. 'add_shibboleth_login_button_shibboleth_button_label'
  42. );
  43. $tab_default_add_shibboleth_login_button_shibboleth_button_comment = api_get_setting(
  44. 'add_shibboleth_login_button_shibboleth_button_comment'
  45. );
  46. $tab_default_add_shibboleth_login_button_shibboleth_image_url = api_get_setting(
  47. 'add_shibboleth_login_button_shibboleth_image_url'
  48. );
  49. $defaults = array();
  50. $defaults['shibboleth_button_label'] = $tab_default_add_shibboleth_login_button_shibboleth_button_label['add_shibboleth_login_button'];
  51. $defaults['shibboleth_button_comment'] = $tab_default_add_shibboleth_login_button_shibboleth_button_comment['add_shibboleth_login_button'];
  52. $defaults['shibboleth_image_url'] = $tab_default_add_shibboleth_login_button_shibboleth_image_url['add_shibboleth_login_button'];
  53. $form->setDefaults($defaults);
  54. //display form
  55. $plugin_info['settings_form'] = $form;
  56. //set the templates that are going to be used
  57. $plugin_info['templates'] = array('template.tpl');