plugin.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 logout from CAS';
  15. //the comments that go with the plugin
  16. $plugin_info['comment'] = "If CAS is activated, this plugin add a text and a button on the user page to logout from a CAS session. 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_cas_button_form');
  23. $form->addElement('text', 'cas_logout_label', 'CAS logout title', '');
  24. $form->addElement('text', 'cas_logout_comment', 'CAS logout description', '');
  25. $form->addElement('text', 'cas_logout_image_url', 'Logo URL if any (image, 50px height)');
  26. $form->addButtonSave(get_lang('Save'), 'submit_button');
  27. //get default value for form
  28. $tab_default_add_cas_logout_button_cas_logout_label = api_get_setting('add_cas_logout_button_cas_logout_label');
  29. $tab_default_add_cas_logout_button_cas_logout_comment = api_get_setting('add_cas_logout_button_cas_logout_comment');
  30. $tab_default_add_cas_logout_button_cas_logout_image_url = api_get_setting('add_cas_logout_button_cas_logout_image_url');
  31. $defaults['cas_logout_label'] = $tab_default_add_cas_logout_button_cas_logout_label['add_cas_logout_button'];
  32. $defaults['cas_logout_comment'] = $tab_default_add_cas_logout_button_cas_logout_comment['add_cas_logout_button'];
  33. $defaults['cas_logout_image_url'] = $tab_default_add_cas_logout_button_cas_logout_image_url['add_cas_logout_button'];
  34. $form->setDefaults($defaults);
  35. //display form
  36. $plugin_info['settings_form'] = $form;
  37. // Set the templates that are going to be used
  38. $plugin_info['templates'] = ['template.tpl'];