plugin.php 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * This script is a configuration file for the vchamilo 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. global $_configuration;
  9. /**
  10. * Plugin details (must be present)
  11. */
  12. /* Plugin config */
  13. //the plugin title
  14. $plugin_info['title'] = 'Chamilo Virtualization';
  15. //the comments that go with the plugin
  16. $plugin_info['comment'] = "Holds chamilo virtualisation tools";
  17. //the plugin version
  18. $plugin_info['version'] = '1.0';
  19. //the plugin author
  20. $plugin_info['author'] = 'Valery Fremaux, Julio Montoya';
  21. /* Plugin optional settings */
  22. /*
  23. * This form will be showed in the plugin settings once the plugin was installed
  24. * in the plugin/hello_world/index.php you can have access to the value: $plugin_info['settings']['hello_world_show_type']
  25. */
  26. $form = new FormValidator('vchamilo_form');
  27. $plugin = VChamiloPlugin::create();
  28. $form_settings = array(
  29. 'enable_virtualisation' => Virtual::getConfig('vchamilo', 'enable_virtualisation', true),
  30. 'httpproxyhost' => Virtual::getConfig('vchamilo', 'httpproxyhost', true),
  31. 'httpproxyport' => Virtual::getConfig('vchamilo', 'httpproxyport', true),
  32. 'httpproxybypass' => Virtual::getConfig('vchamilo', 'httpproxybypass', true),
  33. 'httpproxyuser' => Virtual::getConfig('vchamilo', 'httpproxyuser', true),
  34. 'httpproxypassword' => Virtual::getConfig('vchamilo', 'httpproxypassword', true),
  35. 'cmd_mysql' => Virtual::getConfig('vchamilo', 'cmd_mysql', true),
  36. 'cmd_mysqldump' => Virtual::getConfig('vchamilo', 'cmd_mysqldump', true),
  37. 'course_real_root' => Virtual::getConfig('vchamilo', 'course_real_root', true),
  38. 'archive_real_root' => Virtual::getConfig('vchamilo', 'archive_real_root', true),
  39. 'home_real_root' => Virtual::getConfig('vchamilo', 'home_real_root', true),
  40. );
  41. $form->setDefaults($form_settings);
  42. $wwwroot = $_configuration['root_web'];
  43. //A simple select
  44. $options = array(0 => $plugin->get_lang('no'), 1 => $plugin->get_lang('yes'));
  45. $form->addLabel(
  46. '',
  47. '<a class="btn btn-primary" href="'.api_get_path(WEB_PLUGIN_PATH).'vchamilo/views/manage.php">'.
  48. $plugin->get_lang('manage_instances').'</a>'
  49. );
  50. $form->addElement('header', $plugin->get_lang('enabling'));
  51. $form->addElement('select', 'enable_virtualisation', $plugin->get_lang('enable_virtualisation'), $options);
  52. $form->addElement(
  53. 'text',
  54. 'course_real_root',
  55. [$plugin->get_lang('courserealroot'), 'Example: '.api_get_path(SYS_PATH).'var/courses/']
  56. );
  57. $form->addElement(
  58. 'text',
  59. 'archive_real_root',
  60. [$plugin->get_lang('archiverealroot'), 'Example: '.api_get_path(SYS_PATH).'var/archive/']
  61. );
  62. $form->addElement(
  63. 'text',
  64. 'home_real_root',
  65. [$plugin->get_lang('homerealroot'), 'Example: '.api_get_path(SYS_PATH).'var/home/']
  66. );
  67. $form->addElement('header', $plugin->get_lang('mysqlcmds'));
  68. $form->addElement('text', 'cmd_mysql', [$plugin->get_lang('mysqlcmd'), 'Example: /usr/bin/mysql']);
  69. $form->addElement('text', 'cmd_mysqldump', [$plugin->get_lang('mysqldumpcmd'), 'Example: /usr/bin/mysqldump']);
  70. $form->addElement('header', $plugin->get_lang('proxysettings'));
  71. $form->addElement('text', 'httpproxyhost', $plugin->get_lang('httpproxyhost'));
  72. $form->addElement('text', 'httpproxyport', $plugin->get_lang('httpproxyport'));
  73. $form->addElement('text', 'httpproxybypass', $plugin->get_lang('httpproxybypass'));
  74. $form->addElement('text', 'httpproxyuser', $plugin->get_lang('httpproxyuser'));
  75. $form->addElement('text', 'httpproxypassword', $plugin->get_lang('httpproxypassword'));
  76. $form->addButtonSave($plugin->get_lang('Save'));
  77. $plugin_info['settings_form'] = $form;
  78. //set the templates that are going to be used
  79. $plugin_info['templates'] = array('template.tpl');