plugin.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 logout from 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 user page to logout from a CAS session. 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_logout_label', 'CAS logout title', '');
  22. $form->addElement('text', 'cas_logout_comment', 'CAS logout description', '');
  23. $form->addElement('text', 'cas_logout_image_url', 'Logo URL if any (image, 50px height)');
  24. $form->addButtonSave(get_lang('Save'), 'submit_button');
  25. //get default value for form
  26. $tab_default_add_cas_logout_button_cas_logout_label = api_get_setting('add_cas_logout_button_cas_logout_label');
  27. $tab_default_add_cas_logout_button_cas_logout_comment = api_get_setting('add_cas_logout_button_cas_logout_comment');
  28. $tab_default_add_cas_logout_button_cas_logout_image_url = api_get_setting('add_cas_logout_button_cas_logout_image_url');
  29. $defaults['cas_logout_label'] = $tab_default_add_cas_logout_button_cas_logout_label['add_cas_logout_button'];
  30. $defaults['cas_logout_comment'] = $tab_default_add_cas_logout_button_cas_logout_comment['add_cas_logout_button'];
  31. $defaults['cas_logout_image_url'] = $tab_default_add_cas_logout_button_cas_logout_image_url['add_cas_logout_button'];
  32. $form->setDefaults($defaults);
  33. //display form
  34. $plugin_info['settings_form'] = $form;
  35. // Set the templates that are going to be used
  36. $plugin_info['templates'] = array('template.tpl');