plugin.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 CAS';
  13. //the comments that go with the plugin
  14. $plugin_info['comment'] = "If CAS is activated, this plugin add a text and a button on the login page to login with CAS. 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_cas_button_form');
  21. $form->addElement('text', 'cas_button_label', 'CAS connexion title', '');
  22. $form->addElement('text', 'cas_button_comment', 'CAS connexion description', '');
  23. $form->addElement('text', 'cas_image_url', 'Logo URL if any (image, 50px height)');
  24. $form->addElement('style_submit_button', 'submit_button', get_lang('Save'));
  25. //get default value for form
  26. $tab_default_add_cas_login_button_cas_button_label = api_get_setting('add_cas_login_button_cas_button_label');
  27. $tab_default_add_cas_login_button_cas_button_comment = api_get_setting('add_cas_login_button_cas_button_comment');
  28. $tab_default_add_cas_login_button_cas_image_url = api_get_setting('add_cas_login_button_cas_image_url');
  29. $defaults = array();
  30. $defaults['cas_button_label'] = $tab_default_add_cas_login_button_cas_button_label['add_cas_login_button'];
  31. $defaults['cas_button_comment'] = $tab_default_add_cas_login_button_cas_button_comment['add_cas_login_button'];
  32. $defaults['cas_image_url'] = $tab_default_add_cas_login_button_cas_image_url['add_cas_login_button'];
  33. $form->setDefaults($defaults);
  34. //display form
  35. $plugin_info['settings_form'] = $form;
  36. //set the templates that are going to be used
  37. $plugin_info['templates'] = array('template.tpl');