plugin.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  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'] = 'Add a button to logout from CAS';
  14. //the comments that go with the plugin
  15. $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.";
  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('add_cas_button_form');
  22. $form->addElement('text', 'cas_logout_label', 'CAS logout title', '');
  23. $form->addElement('text', 'cas_logout_comment', 'CAS logout description', '');
  24. $form->addElement('text', 'cas_logout_image_url', 'Logo URL if any (image, 50px height)');
  25. $form->addButtonSave(get_lang('Save'), 'submit_button');
  26. $defaults['cas_logout_label'] = api_get_plugin_setting('add_cas_logout_button', 'cas_logout_label');
  27. $defaults['cas_logout_comment'] = api_get_plugin_setting('add_cas_logout_button', 'cas_logout_comment');
  28. $defaults['cas_logout_image_url'] = api_get_plugin_setting('add_cas_logout_button', 'cas_logout_image_url');
  29. $form->setDefaults($defaults);
  30. //display form
  31. $plugin_info['settings_form'] = $form;
  32. // Set the templates that are going to be used
  33. $plugin_info['templates'] = array('template.html.twig');