config.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. /**
  3. * Sloodle module configuration fragment.
  4. *
  5. * This PHP/HTML fragment shows a web-form for configuring the Sloodle module.
  6. *
  7. * @package sloodle
  8. * @copyright Copyright (c) 2007 Sloodle (various contributors)
  9. * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
  10. *
  11. * @contributor (various)
  12. * @contributor Peter R. Bloomfield
  13. *
  14. */
  15. // Get our Sloodle configuration
  16. require_once($CFG->dirroot.'/mod/sloodle/sl_config.php');
  17. require_once(SLOODLE_LIBROOT.'/general.php');
  18. // Attempt to get the configuration settings
  19. $allow_autoreg = (sloodle_autoreg_enabled_site()) ? 1 : 0;
  20. $allow_autoenrol = (sloodle_autoenrol_enabled_site()) ? 1 : 0;
  21. $active_object_lifetime = 7; // Give active objects a week by default
  22. if (!empty($CFG->sloodle_active_object_lifetime)) $active_object_lifetime = $CFG->sloodle_active_object_lifetime;
  23. $user_object_lifetime = 21; // Give user objects 3 weeks by default
  24. if (!empty($CFG->sloodle_user_object_lifetime)) $user_object_lifetime = $CFG->sloodle_user_object_lifetime;
  25. // Display the Sloodle version
  26. sloodle_print_heading(get_string('sloodleversion','sloodle').': '.(string)SLOODLE_VERSION, 'center', 3);
  27. // Get and display the module version number (from version.php)
  28. $sloodlemodule = sloodle_get_record('modules', 'name', 'sloodle');
  29. $releasenum = 0;
  30. if ($sloodlemodule !== FALSE) $releasenum = $sloodlemodule->version;
  31. sloodle_print_heading(get_string('releasenum','sloodle').': '.(string)$releasenum, 'center', 5);
  32. // Display a help button regarding the version numbers
  33. echo '<div style="text-align:center;">(';
  34. sloodle_helpbutton('version_numbers', get_string('help:versionnumbers', 'sloodle'), 'sloodle', true, true);
  35. echo ')</div>';
  36. ?>
  37. <!-- Sloodle configuration form -->
  38. <form method="post" action="module.php" id="form">
  39. <!--<div>-->
  40. <!-- Session key and module name -->
  41. <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
  42. <input type="hidden" name="module" value="sloodle" />
  43. <table cellpadding="9" cellspacing="0" >
  44. <!-- Notecard -->
  45. <!-- N.B: ****** possibly add a note here to say how to find the new notecard configuration pages? *******
  46. <tr>
  47. <td colspan="3" align="left">
  48. <h3><?php print_string("objectconfig:header", "sloodle"); ?></h3>
  49. <p>
  50. <?php print_string("objectconfig:body", "sloodle"); ?>
  51. <a href="<?php echo SLOODLE_WWWROOT; ?>/sl_setup_notecard.php"><?php print_string("createnotecard", "sloodle"); ?></a>
  52. </p>
  53. </td>
  54. </tr>-->
  55. <!-- Auto-registration -->
  56. <tr>
  57. <td colspan="3" align="left">
  58. <h3><?php print_string('autoreg', 'sloodle'); ?> <?php echo sloodle_helpbutton('auto_registration', get_string('help:autoreg','sloodle'), 'sloodle', true, false, '', true); ?></h3>
  59. <p>
  60. <?php
  61. print_string("autoreg:allowforsite", "sloodle");
  62. echo ': ';
  63. choose_from_menu_yesno('allow_autoreg', $allow_autoreg);
  64. ?>
  65. </p>
  66. </td>
  67. </tr>
  68. <!-- Auto-enrolment -->
  69. <tr>
  70. <td colspan="3" align="left">
  71. <h3><?php print_string('autoenrol', 'sloodle'); ?> <?php echo sloodle_helpbutton('auto_enrolment', get_string('help:autoenrol','sloodle'), 'sloodle', true, false, '', true); ?></h3>
  72. <p>
  73. <?php
  74. print_string("autoenrol:allowforsite", "sloodle");
  75. echo ': ';
  76. choose_from_menu_yesno('allow_autoenrol', $allow_autoenrol);
  77. ?>
  78. </p>
  79. </td>
  80. </tr>
  81. <!-- Active object lifetime -->
  82. <tr>
  83. <td colspan="3" align="left">
  84. <h3><?php print_string('activeobjectlifetime', 'sloodle'); ?> <?php echo sloodle_helpbutton('object_authorization', get_string('activeobjects','sloodle'), 'sloodle', true, false, '', true); ?></h3>
  85. <p>
  86. <?php
  87. print_string("activeobjectlifetime:info", "sloodle");
  88. echo ': ';
  89. echo '<input type="text" name="active_object_lifetime" value="'.$active_object_lifetime.'" >';
  90. ?>
  91. </p>
  92. </td>
  93. </tr>
  94. <!-- User object lifetime -->
  95. <tr>
  96. <td colspan="3" align="left">
  97. <h3><?php print_string('userobjectlifetime', 'sloodle'); ?> <?php echo sloodle_helpbutton('user_objects', get_string('userobjects','sloodle'), 'sloodle', true, false, '', true); ?></h3>
  98. <p>
  99. <?php
  100. print_string("userobjectlifetime:info", "sloodle");
  101. echo ': ';
  102. echo '<input type="text" name="user_object_lifetime" value="'.$user_object_lifetime.'" >';
  103. ?>
  104. </p>
  105. </td>
  106. </tr>
  107. <!-- Form Submission -->
  108. <tr>
  109. <td colspan="3" align="center">
  110. <input type="submit" value="<?php print_string("savechanges") ?>" />
  111. </td>
  112. </tr>
  113. </table>
  114. <!--</div>-->
  115. </form>
  116. <!-- End Sloodle configuration form -->