settings.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. require_once($CFG->dirroot.'/mod/sloodle/init.php');
  3. // // VERSION INFO // //
  4. // Construct the version info
  5. // Sloodle version
  6. $str = sloodle_print_heading(get_string('sloodleversion','sloodle').': '.(string)SLOODLE_VERSION, 'center', 4, 'main', true);
  7. // Release number
  8. $sloodlemodule = sloodle_get_record('modules', 'name', 'sloodle');
  9. $releasenum = 0;
  10. if ($sloodlemodule !== FALSE) $releasenum = $sloodlemodule->version;
  11. //$str .= sloodle_print_heading(get_string('releasenum','sloodle').': '.(string)$releasenum, 'center', 5, 'main', true);
  12. // Construct a help button to
  13. $hlp = sloodle_helpbutton('version_numbers', get_string('help:versionnumbers', 'sloodle'), 'sloodle', true, false, '', true);
  14. // Add the version info section
  15. $settings->add(new admin_setting_heading('sloodle_version_header', "Version Info ".$hlp, $str));
  16. // // GENERAL SETTINGS // //
  17. // General settings section
  18. $settings->add(new admin_setting_heading('sloodle_settings_header', "Sloodle Settings", ''));
  19. // Get some localization strings
  20. $stryes = get_string('yes');
  21. $strno = get_string('no');
  22. // This selection box determines whether or not auto-registration is allowed on the site
  23. $settings->add( new admin_setting_configselect(
  24. 'sloodle_allow_autoreg',
  25. '',
  26. get_string('autoreg:allowforsite','sloodle').sloodle_helpbutton('auto_registration', get_string('help:autoreg','sloodle'), 'sloodle', true, false, '', true),
  27. 0,
  28. array(0 => $strno, 1 => $stryes)
  29. ));
  30. // This selection box determines whether or not auto-enrolment is allowed on the site
  31. $settings->add( new admin_setting_configselect(
  32. 'sloodle_allow_autoenrol',
  33. '',
  34. get_string('autoenrol:allowforsite','sloodle').sloodle_helpbutton('auto_enrolment', get_string('help:autoenrol','sloodle'), 'sloodle', true, false, '', true),
  35. 0,
  36. array(0 => $strno, 1 => $stryes)
  37. ));
  38. // This text box will let the user set a number of days after which active objects should expire
  39. $settings->add( new admin_setting_configtext(
  40. 'sloodle_active_object_lifetime',
  41. get_string('activeobjectlifetime', 'sloodle'),
  42. get_string('activeobjectlifetime:info', 'sloodle').sloodle_helpbutton('object_authorization', get_string('activeobjects','sloodle'), 'sloodle', true, false, '', true),
  43. 7));
  44. // This text box will let the user set a number of days after which user objects should expire
  45. $settings->add( new admin_setting_configtext(
  46. 'sloodle_user_object_lifetime',
  47. get_string('userobjectlifetime', 'sloodle'),
  48. get_string('userobjectlifetime:info', 'sloodle').sloodle_helpbutton('user_objects', get_string('userobjects','sloodle'), 'sloodle', true, false, '', true),
  49. 21));
  50. // This selection box determines whether or not auto-enrolment is allowed on the site
  51. // Pull in the freemail config, if we're using it.
  52. if ( (defined('SLOODLE_FREEMAIL_ACTIVATE') && SLOODLE_FREEMAIL_ACTIVATE) && ( (!defined('SLOODLE_FREEMAIL_HIDE_CONFIG') || !SLOODLE_FREEMAIL_HIDE_CONFIG)) ) {
  53. include($CFG->dirroot.'/mod/sloodle/freemail/settings.php');
  54. }
  55. ?>