Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote branch 'origin/master' into rubric

Conflicts:
	lib/db/upgrade.php
	version.php
  • Loading branch information...
commit 01609c9ad94e5757cef2afc1ed637863cff83762 2 parents 8b9ada5 + 3a81b37
@mudrd8mz mudrd8mz authored
Showing with 6,726 additions and 4,971 deletions.
  1. +114 −0 admin/environment.xml
  2. +8 −4 admin/report/questioninstances/index.php
  3. +5 −4 admin/roles/usersroles.php
  4. +4 −1 admin/settings/appearance.php
  5. +1 −1  admin/settings/development.php
  6. +4 −2 admin/tool/capability/index.php
  7. +46 −0 admin/tool/unittest/simpletestlib.php
  8. +3 −4 auth/shibboleth/index.php
  9. +10 −0 auth/upgrade.txt
  10. +2 −2 blog/edit.php
  11. +4 −4 blog/edit_form.php
  12. +7 −7 blog/locallib.php
  13. +27 −2 cohort/index.php
  14. +45 −0 cohort/lib.php
  15. +2 −1  course/category.php
  16. +21 −2 course/lib.php
  17. +0 −12 course/modedit.php
  18. +17 −4 course/moodleform_mod.php
  19. +22 −7 course/report/completion/index.php
  20. +22 −7 course/report/progress/index.php
  21. +20 −0 course/simpletest/testcourselib.php
  22. +5 −5 enrol/cohort/ajax.php
  23. +2 −0  enrol/cohort/lang/en/enrol_cohort.php
  24. +10 −1 enrol/cohort/lib.php
  25. +97 −0 enrol/cohort/locallib.php
  26. +27 −16 enrol/cohort/yui/quickenrolment/assets/skins/sam/quickenrolment.css
  27. +101 −55 enrol/cohort/yui/quickenrolment/quickenrolment.js
  28. +2 −2 enrol/guest/lib.php
  29. +0 −3  enrol/paypal/return.php
  30. +8 −0 enrol/upgrade.txt
  31. +54 −18 grade/lib.php
  32. +1 −1  install/lang/ru/install.php
  33. +3 −1 lang/en/admin.php
  34. +2 −0  lang/en/cohort.php
  35. +1 −0  lang/en/condition.php
  36. +2 −2 lang/en/debug.php
  37. +0 −9 lang/en/webservice.php
  38. +5,526 −4,638 lib/accesslib.php
  39. +1 −1  lib/adminlib.php
  40. +1 −1  lib/componentlib.class.php
  41. +74 −29 lib/conditionlib.php
  42. +6 −2 lib/datalib.php
  43. +49 −20 lib/db/install.php
  44. +21 −2 lib/db/upgrade.php
  45. +7 −20 lib/deprecatedlib.php
  46. +42 −0 lib/dml/simpletest/testdml.php
  47. +4 −1 lib/editor/tinymce/lib.php
  48. +2 −1  lib/editor/tinymce/readme_moodle.txt
  49. +0 −1  lib/editor/tinymce/tiny_mce/3.4.5/plugins/layer/editor_plugin.js
  50. +0 −1  lib/editor/tinymce/tiny_mce/3.4.5/plugins/media/editor_plugin.js
  51. +0 −1  lib/editor/tinymce/tiny_mce/3.4.5/plugins/paste/editor_plugin.js
  52. +0 −1  lib/editor/tinymce/tiny_mce/3.4.5/tiny_mce.js
  53. +0 −1  lib/editor/tinymce/tiny_mce/3.4.5/tiny_mce_jquery.js
  54. +0 −1  lib/editor/tinymce/tiny_mce/3.4.5/tiny_mce_prototype.js
  55. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/jquery.tinymce.js
  56. +1 −1  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/langs/en.js
  57. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/license.txt
  58. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advhr/css/advhr.css
  59. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advhr/editor_plugin.js
  60. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advhr/editor_plugin_src.js
  61. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advhr/js/rule.js
  62. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advhr/langs/en_dlg.js
  63. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advhr/rule.htm
  64. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advimage/css/advimage.css
  65. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advimage/editor_plugin.js
  66. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advimage/editor_plugin_src.js
  67. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advimage/image.htm
  68. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advimage/img/sample.gif
  69. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advimage/js/image.js
  70. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advimage/langs/en_dlg.js
  71. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlink/css/advlink.css
  72. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlink/editor_plugin.js
  73. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlink/editor_plugin_src.js
  74. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlink/js/advlink.js
  75. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlink/langs/en_dlg.js
  76. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlink/link.htm
  77. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlist/editor_plugin.js
  78. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/advlist/editor_plugin_src.js
  79. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/autolink/editor_plugin.js
  80. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/autolink/editor_plugin_src.js
  81. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/autoresize/editor_plugin.js
  82. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/autoresize/editor_plugin_src.js
  83. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/autosave/editor_plugin.js
  84. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/autosave/editor_plugin_src.js
  85. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/autosave/langs/en.js
  86. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/bbcode/editor_plugin.js
  87. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/bbcode/editor_plugin_src.js
  88. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/contextmenu/editor_plugin.js
  89. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/contextmenu/editor_plugin_src.js
  90. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/directionality/editor_plugin.js
  91. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/directionality/editor_plugin_src.js
  92. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/dragmath/dragmath.php
  93. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/dragmath/editor_plugin.js
  94. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/dragmath/editor_plugin_src.js
  95. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/dragmath/img/dragmath.gif
  96. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/dragmath/js/dragmath.js
  97. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/dragmath/langs/en_dlg.js
  98. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/editor_plugin.js
  99. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/editor_plugin_src.js
  100. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/emotions.htm
  101. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-cool.gif
  102. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-cry.gif
  103. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-embarassed.gif
  104. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-foot-in-mouth.gif
  105. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-frown.gif
  106. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-innocent.gif
  107. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-kiss.gif
  108. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-laughing.gif
  109. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-money-mouth.gif
  110. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-sealed.gif
  111. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-smile.gif
  112. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-surprised.gif
  113. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-tongue-out.gif
  114. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-undecided.gif
  115. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-wink.gif
  116. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/img/smiley-yell.gif
  117. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/js/emotions.js
  118. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/emotions/langs/en_dlg.js
  119. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example/dialog.htm
  120. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example/editor_plugin.js
  121. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example/editor_plugin_src.js
  122. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example/img/example.gif
  123. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example/js/dialog.js
  124. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example/langs/en.js
  125. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example/langs/en_dlg.js
  126. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example_dependency/editor_plugin.js
  127. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/example_dependency/editor_plugin_src.js
  128. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullpage/css/fullpage.css
  129. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullpage/editor_plugin.js
  130. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullpage/editor_plugin_src.js
  131. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullpage/fullpage.htm
  132. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullpage/js/fullpage.js
  133. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullpage/langs/en_dlg.js
  134. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullscreen/editor_plugin.js
  135. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullscreen/editor_plugin_src.js
  136. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/fullscreen/fullscreen.htm
  137. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/iespell/editor_plugin.js
  138. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/iespell/editor_plugin_src.js
  139. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/editor_plugin.js
  140. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/editor_plugin_src.js
  141. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/img/alert.gif
  142. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/img/button.gif
  143. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif
  144. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif
  145. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/img/corners.gif
  146. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif
  147. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif
  148. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/skins/clearlooks2/window.css
  149. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/inlinepopups/template.htm
  150. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/insertdatetime/editor_plugin.js
  151. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/insertdatetime/editor_plugin_src.js
  152. +1 −0  lib/editor/tinymce/tiny_mce/3.4.6/plugins/layer/editor_plugin.js
  153. +53 −5 lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/layer/editor_plugin_src.js
  154. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/legacyoutput/editor_plugin.js
  155. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/legacyoutput/editor_plugin_src.js
  156. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/lists/editor_plugin.js
  157. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/lists/editor_plugin_src.js
  158. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/media/css/media.css
  159. +1 −0  lib/editor/tinymce/tiny_mce/3.4.6/plugins/media/editor_plugin.js
  160. +76 −8 lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/media/editor_plugin_src.js
  161. 0  lib/editor/tinymce/tiny_mce/{3.4.5/plugins/preview/jscripts → 3.4.6/plugins/media/js}/embed.js
  162. +70 −6 lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/media/js/media.js
  163. +1 −1  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/media/langs/en_dlg.js
  164. +37 −12 lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/media/media.htm
  165. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/media/moxieplayer.swf
  166. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodleemoticon/dialog.php
  167. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodleemoticon/editor_plugin.js
  168. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodleemoticon/editor_plugin_src.js
  169. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodleemoticon/img/moodleemoticon.gif
  170. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodleemoticon/js/dialog.js
  171. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlemedia/css/media.css
  172. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlemedia/editor_plugin.js
  173. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlemedia/editor_plugin_src.js
  174. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlemedia/img/icon.gif
  175. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlemedia/js/media.js
  176. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlemedia/moodlemedia.htm
  177. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlenolink/editor_plugin.js
  178. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlenolink/editor_plugin_src.js
  179. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlenolink/img/ed_nolink.gif
  180. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/moodlenolink/langs/en.js
  181. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/nonbreaking/editor_plugin.js
  182. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/nonbreaking/editor_plugin_src.js
  183. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/noneditable/editor_plugin.js
  184. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/noneditable/editor_plugin_src.js
  185. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/pagebreak/editor_plugin.js
  186. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/pagebreak/editor_plugin_src.js
  187. +1 −0  lib/editor/tinymce/tiny_mce/3.4.6/plugins/paste/editor_plugin.js
  188. +11 −1 lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/paste/editor_plugin_src.js
  189. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/paste/js/pastetext.js
  190. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/paste/js/pasteword.js
  191. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/paste/langs/en_dlg.js
  192. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/paste/pastetext.htm
  193. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/paste/pasteword.htm
  194. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/preview/editor_plugin.js
  195. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/preview/editor_plugin_src.js
  196. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/preview/example.html
  197. 0  lib/editor/tinymce/tiny_mce/{3.4.5/plugins/media/js → 3.4.6/plugins/preview/jscripts}/embed.js
  198. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/preview/preview.html
  199. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/print/editor_plugin.js
  200. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/print/editor_plugin_src.js
  201. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/save/editor_plugin.js
  202. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/save/editor_plugin_src.js
  203. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/searchreplace/css/searchreplace.css
  204. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/searchreplace/editor_plugin.js
  205. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/searchreplace/editor_plugin_src.js
  206. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/searchreplace/js/searchreplace.js
  207. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/searchreplace/langs/en_dlg.js
  208. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/searchreplace/searchreplace.htm
  209. +2 −1  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/changelog.txt
  210. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/classes/EnchantSpell.php
  211. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/classes/GoogleSpell.php
  212. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/classes/PSpell.php
  213. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/classes/PSpellShell.php
  214. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/classes/SpellChecker.php
  215. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/classes/utils/JSON.php
  216. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/classes/utils/Logger.php
  217. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/config.php
  218. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/css/content.css
  219. +1 −1  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/editor_plugin.js
  220. +35 −34 lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/editor_plugin_src.js
  221. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/img/wline.gif
  222. +1 −1  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/includes/general.php
  223. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/spellchecker/rpc.php
  224. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/style/css/props.css
  225. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/style/editor_plugin.js
  226. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/style/editor_plugin_src.js
  227. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/style/js/props.js
  228. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/style/langs/en_dlg.js
  229. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/style/props.htm
  230. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/tabfocus/editor_plugin.js
  231. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/tabfocus/editor_plugin_src.js
  232. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/cell.htm
  233. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/css/cell.css
  234. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/css/row.css
  235. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/css/table.css
  236. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/editor_plugin.js
  237. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/editor_plugin_src.js
  238. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/js/cell.js
  239. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/js/merge_cells.js
  240. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/js/row.js
  241. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/js/table.js
  242. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/langs/en_dlg.js
  243. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/merge_cells.htm
  244. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/row.htm
  245. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/table/table.htm
  246. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/template/blank.htm
  247. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/template/css/template.css
  248. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/template/editor_plugin.js
  249. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/template/editor_plugin_src.js
  250. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/template/js/template.js
  251. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/template/langs/en_dlg.js
  252. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/template/template.htm
  253. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/visualchars/editor_plugin.js
  254. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/visualchars/editor_plugin_src.js
  255. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/wordcount/editor_plugin.js
  256. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/wordcount/editor_plugin_src.js
  257. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/abbr.htm
  258. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/acronym.htm
  259. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/attributes.htm
  260. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/cite.htm
  261. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/css/attributes.css
  262. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/css/popup.css
  263. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/del.htm
  264. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/editor_plugin.js
  265. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/editor_plugin_src.js
  266. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/ins.htm
  267. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/js/abbr.js
  268. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/js/acronym.js
  269. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/js/attributes.js
  270. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/js/cite.js
  271. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/js/del.js
  272. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/js/element_common.js
  273. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/js/ins.js
  274. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/plugins/xhtmlxtras/langs/en_dlg.js
  275. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/about.htm
  276. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/anchor.htm
  277. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/charmap.htm
  278. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/color_picker.htm
  279. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/editor_template.js
  280. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/editor_template_src.js
  281. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/image.htm
  282. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/colorpicker.jpg
  283. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/flash.gif
  284. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/icons.gif
  285. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/iframe.gif
  286. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/pagebreak.gif
  287. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/quicktime.gif
  288. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/realmedia.gif
  289. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/shockwave.gif
  290. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/trans.gif
  291. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/video.gif
  292. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/img/windowsmedia.gif
  293. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/js/about.js
  294. +3 −2 lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/js/anchor.js
  295. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/js/charmap.js
  296. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/js/color_picker.js
  297. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/js/image.js
  298. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/js/link.js
  299. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/js/source_editor.js
  300. 0  lib/editor/tinymce/tiny_mce/{3.4.5 → 3.4.6}/themes/advanced/langs/en.js
Sorry, we could not display the entire diff because too many files (509) changed.
View
114 admin/environment.xml
@@ -442,4 +442,118 @@
</PHP_SETTING>
</PHP_SETTINGS>
</MOODLE>
+ <MOODLE version="2.2" requires="1.9">
+ <UNICODE level="required">
+ <FEEDBACK>
+ <ON_ERROR message="unicoderequired" />
+ </FEEDBACK>
+ </UNICODE>
+ <DATABASE level="required">
+ <VENDOR name="mysql" version="5.0.25">
+ <FEEDBACK>
+ <ON_ERROR message="mysql416required" />
+ </FEEDBACK>
+ </VENDOR>
+ <VENDOR name="postgres" version="8.3" />
+ <VENDOR name="mssql" version="9.0" />
+ <VENDOR name="odbc_mssql" version="9.0" />
+ <VENDOR name="mssql_n" version="9.0" />
+ <VENDOR name="oracle" version="10.2" />
+ <VENDOR name="sqlite" version="2.0" />
+ </DATABASE>
+ <PHP version="5.3.2" level="required">
+ </PHP>
+ <PHP_EXTENSIONS>
+ <PHP_EXTENSION name="iconv" level="required">
+ <FEEDBACK>
+ <ON_CHECK message="iconvrequired" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="mbstring" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="mbstringrecommended" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="curl" level="required">
+ <FEEDBACK>
+ <ON_CHECK message="curlrequired" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="openssl" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="opensslrecommended" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="tokenizer" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="tokenizerrecommended" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="xmlrpc" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="xmlrpcrecommended" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="soap" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="soaprecommended" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="ctype" level="required">
+ <FEEDBACK>
+ <ON_ERROR message="ctyperequired" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="zip" level="required">
+ <FEEDBACK>
+ <ON_ERROR message="ziprequired" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="gd" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="gdrecommended" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="simplexml" level="required">
+ <FEEDBACK>
+ <ON_CHECK message="simplexmlrequired" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="spl" level="required">
+ <FEEDBACK>
+ <ON_CHECK message="splrequired" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="pcre" level="required">
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="dom" level="required">
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="xml" level="required">
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="intl" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="intlrecommended" />
+ </FEEDBACK>
+ </PHP_EXTENSION>
+ <PHP_EXTENSION name="json" level="required">
+ </PHP_EXTENSION>
+ </PHP_EXTENSIONS>
+ <PHP_SETTINGS>
+ <PHP_SETTING name="memory_limit" value="40M" level="required">
+ <FEEDBACK>
+ <ON_ERROR message="settingmemorylimit" />
+ </FEEDBACK>
+ </PHP_SETTING>
+ <PHP_SETTING name="safe_mode" value="0" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="settingsafemode" />
+ </FEEDBACK>
+ </PHP_SETTING>
+ <PHP_SETTING name="file_uploads" value="1" level="optional">
+ <FEEDBACK>
+ <ON_CHECK message="settingfileuploads" />
+ </FEEDBACK>
+ </PHP_SETTING>
+ </PHP_SETTINGS>
+ </MOODLE>
</COMPATIBILITY_MATRIX>
View
12 admin/report/questioninstances/index.php
@@ -65,13 +65,15 @@
// Get the question counts, and all the context information, for each
// context. That is, rows of these results can be used as $context objects.
+ $ctxpreload = context_helper::get_preload_record_columns_sql('con');
+ $ctxgroupby = implode(',', array_keys(context_helper::get_preload_record_columns('con')));
$counts = $DB->get_records_sql("
- SELECT qc.contextid, count(1) as numquestions, sum(hidden) as numhidden, con.id, con.contextlevel, con.instanceid, con.path, con.depth
+ SELECT qc.contextid, count(1) as numquestions, sum(hidden) as numhidden, $ctxpreload
FROM {question} q
JOIN {question_categories} qc ON q.category = qc.id
JOIN {context} con ON con.id = qc.contextid
$sqlqtypetest
- GROUP BY contextid, con.id, con.contextlevel, con.instanceid, con.path, con.depth
+ GROUP BY qc.contextid, $ctxgroupby
ORDER BY numquestions DESC, numhidden ASC, con.contextlevel ASC, con.id ASC", $params);
// Print the report heading.
@@ -94,8 +96,10 @@
$totalhidden = 0;
foreach ($counts as $count) {
// Work out a link for editing questions in this context.
- $contextname = print_context_name($count);
- $url = question_edit_url($count);
+ context_helper::preload_from_record($count);
+ $context = context::instance_by_id($count->contextid);
+ $contextname = $context->get_context_name();
+ $url = question_edit_url($context);
if ($url) {
$contextname = '<a href="' . $url . '" title="' .
get_string('editquestionshere', 'report_questioninstances') .
View
9 admin/roles/usersroles.php
@@ -96,7 +96,8 @@
/// Put the contexts into a tree structure.
foreach ($contexts as $conid => $con) {
- $parentcontextid = get_parent_contextid($con);
+ $context = context::instance_by_id($conid);
+ $parentcontextid = get_parent_contextid($context);
if ($parentcontextid) {
$contexts[$parentcontextid]->children[] = $conid;
}
@@ -156,13 +157,13 @@ function print_report_tree($contextid, $contexts, $systemcontext, $fullname) {
}
// Pull the current context into an array for convinience.
- $context = $contexts[$contextid];
+ $context = context::instance_by_id($contextid);
// Print the context name.
- echo $OUTPUT->heading(print_context_name($contexts[$contextid]), 4, 'contextname');
+ echo $OUTPUT->heading($context->get_context_name(), 4, 'contextname');
// If there are any role assignments here, print them.
- foreach ($context->roleassignments as $ra) {
+ foreach ($contexts[$contextid]->roleassignments as $ra) {
$value = $ra->contextid . ',' . $ra->roleid;
$inputid = 'unassign' . $value;
View
5 admin/settings/appearance.php
@@ -118,8 +118,11 @@
$ADMIN->add('appearance', $temp);
// coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
- $temp = new admin_settingpage('coursecontact', get_string('coursecontact', 'admin'));
+ $temp = new admin_settingpage('coursecontact', get_string('courses'));
$temp->add(new admin_setting_special_coursecontact());
+ $temp->add(new admin_setting_configcheckbox('courselistshortnames',
+ get_string('courselistshortnames', 'admin'),
+ get_string('courselistshortnames_desc', 'admin'), 0));
$ADMIN->add('appearance', $temp);
$temp = new admin_settingpage('ajax', get_string('ajaxuse'));
View
2  admin/settings/development.php
@@ -26,7 +26,7 @@
$temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmlstrictheaders', 'admin'), get_string('configxmlstrictheaders', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('perfdebug', get_string('perfdebug', 'admin'), get_string('configperfdebug', 'admin'), '7', '15', '7'));
- $temp->add(new admin_setting_configcheckbox('debugstringids', get_string('debugstringids', 'admin'), get_string('configdebugstringids', 'admin'), 0));
+ $temp->add(new admin_setting_configcheckbox('debugstringids', get_string('debugstringids', 'admin'), get_string('debugstringids_desc', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('debugvalidators', get_string('debugvalidators', 'admin'), get_string('configdebugvalidators', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('debugpageinfo', get_string('debugpageinfo', 'admin'), get_string('configdebugpageinfo', 'admin'), 0));
$ADMIN->add('development', $temp);
View
6 admin/tool/capability/index.php
@@ -138,7 +138,8 @@
// Put the contexts into a tree structure.
foreach ($contexts as $conid => $con) {
- $parentcontextid = get_parent_contextid($con);
+ $context = context::instance_by_id($conid);
+ $parentcontextid = get_parent_contextid($context);
if ($parentcontextid) {
$contexts[$parentcontextid]->children[] = $conid;
}
@@ -196,7 +197,8 @@ function print_report_tree($contextid, $contexts, $allroles) {
$url = "$CFG->wwwroot/$CFG->admin/roles/override.php?contextid=$contextid";
$title = get_string('changeoverrides', 'tool_capability');
}
- echo '<h3><a href="' . $url . '" title="' . $title . '">', print_context_name($contexts[$contextid]), '</a></h3>';
+ $context = context::instance_by_id($contextid);
+ echo '<h3><a href="' . $url . '" title="' . $title . '">', $context->get_context_name(), '</a></h3>';
// If there are any role overrides here, print them.
if (!empty($contexts[$contextid]->rolecapabilities)) {
View
46 admin/tool/unittest/simpletestlib.php
@@ -746,6 +746,52 @@ protected function revert_global_user_id() {
}
/**
+ * Recreates the system context record in the 'context' table
+ *
+ * Once we have switched to test db, if we have recreated the
+ * context table and it's empty, it may be necessary to manually
+ * create the system context record if unittests are going to
+ * play with contexts.
+ *
+ * This is needed because the context_system::instance() method
+ * is exceptional and always requires the record to exist, never
+ * creating it :-( No problem for other contexts.
+ *
+ * Altenatively one complete install can be done, like
+ * {@see accesslib_test::test_everything_in_accesslib} does, but that's
+ * to much for some tests not requiring all the roles/caps/friends
+ * to be present.
+ *
+ * Ideally some day we'll move a lot of these UnitTests to a complete
+ * cloned installation with real data to play with. That day this
+ * won't be necessary anymore.
+ */
+ protected function create_system_context_record() {
+ global $DB;
+
+ // If, for any reason, the record exists, do nothing
+ if ($DB->record_exists('context', array('contextlevel'=>CONTEXT_SYSTEM))) {
+ return;
+ }
+
+ $record = new stdClass();
+ $record->contextlevel = CONTEXT_SYSTEM;
+ $record->instanceid = 0;
+ $record->depth = 1;
+ $record->path = null;
+ if (defined('SYSCONTEXTID')) {
+ $record->id = SYSCONTEXTID;
+ $DB->import_record('context', $record);
+ $DB->get_manager()->reset_sequence('context');
+ } else {
+ $record->id = $DB->insert_record('context', $record);
+ }
+ // fix path
+ $record->path = '/'.$record->id;
+ $DB->set_field('context', 'path', $record->path, array('id' => $record->id));
+ }
+
+ /**
* Check that the user has not forgotten to clean anything up, and if they
* have, display a rude message and clean it up for them.
*/
View
7 auth/shibboleth/index.php
@@ -39,7 +39,9 @@
if ($shibbolethauth->user_login($frm->username, $frm->password)) {
- $USER = authenticate_user_login($frm->username, $frm->password);
+ $user = authenticate_user_login($frm->username, $frm->password);
+ enrol_check_plugins($user);
+ session_set_user($user);
$USER->loggedin = true;
$USER->site = $CFG->wwwroot; // for added security, store the site in the
@@ -75,9 +77,6 @@
}
}
- enrol_check_plugins($USER);
- load_all_capabilities(); /// This is what lets the user do anything on the site :-)
-
redirect($urltogo);
exit;
View
10 auth/upgrade.txt
@@ -0,0 +1,10 @@
+This files describes API changes in /auth/* - plugins,
+information provided here is intended especially for developers.
+
+=== 2.2 ===
+
+required changes in code:
+* the correct sequence to set up global $USER is:
+ $user = get_complete_user_data('username', $username); // or $user = authenticate_user_login()
+ enrol_check_plugins($user);
+ session_set_user($user);
View
4 blog/edit.php
@@ -143,9 +143,9 @@
if ($CFG->useblogassociations && ($blogassociations = $DB->get_records('blog_association', array('blogid' => $entry->id)))) {
foreach ($blogassociations as $assocrec) {
- $contextrec = $DB->get_record('context', array('id' => $assocrec->contextid));
+ $context = get_context_instance_by_id($assocrec->contextid);
- switch ($contextrec->contextlevel) {
+ switch ($context->contextlevel) {
case CONTEXT_COURSE:
$entry->courseassoc = $assocrec->contextid;
break;
View
8 blog/edit_form.php
@@ -95,7 +95,7 @@ function definition() {
$a->modname = $mod->name;
$context = get_context_instance(CONTEXT_MODULE, $modid);
} else {
- $context = $DB->get_record('context', array('id' => $entry->modassoc));
+ $context = get_context_instance_by_id($entry->modassoc);
$cm = $DB->get_record('course_modules', array('id' => $context->instanceid));
$a = new stdClass();
$a->modtype = $DB->get_field('modules', 'name', array('id' => $cm->module));
@@ -134,7 +134,7 @@ function validation($data, $files) {
// validate course association
if (!empty($data['courseassoc']) && has_capability('moodle/blog:associatecourse', $sitecontext)) {
- $coursecontext = $DB->get_record('context', array('id' => $data['courseassoc'], 'contextlevel' => CONTEXT_COURSE));
+ $coursecontext = get_context_instance(CONTEXT_COURSE, $data['courseassoc']);
if ($coursecontext) {
if (!is_enrolled($coursecontext) and !is_viewing($coursecontext)) {
@@ -149,12 +149,12 @@ function validation($data, $files) {
if (!empty($data['modassoc'])) {
$modcontextid = $data['modassoc'];
- $modcontext = $DB->get_record('context', array('id' => $modcontextid, 'contextlevel' => CONTEXT_MODULE));
+ $modcontext = get_context_instance(CONTEXT_MODULE, $modcontextid);
if ($modcontext) {
// get context of the mod's course
$path = explode('/', $modcontext->path);
- $coursecontext = $DB->get_record('context', array('id' => $path[(count($path) - 2)]));
+ $coursecontext = get_context_instance_by_id($path[(count($path) - 2)]);
// ensure only one course is associated
if (!empty($data['courseassoc'])) {
View
14 blog/locallib.php
@@ -247,10 +247,10 @@ public function print_html($return=false) {
// First find and show the associated course
foreach ($blogassociations as $assocrec) {
- $contextrec = $DB->get_record('context', array('id' => $assocrec->contextid));
- if ($contextrec->contextlevel == CONTEXT_COURSE) {
- $assocurl = new moodle_url('/course/view.php', array('id' => $contextrec->instanceid));
- $text = $DB->get_field('course', 'shortname', array('id' => $contextrec->instanceid)); //TODO: performance!!!!
+ $context = get_context_instance_by_id($assocrec->contextid);
+ if ($context->contextlevel == CONTEXT_COURSE) {
+ $assocurl = new moodle_url('/course/view.php', array('id' => $context->instanceid));
+ $text = $DB->get_field('course', 'shortname', array('id' => $context->instanceid)); //TODO: performance!!!!
$assocstr .= $OUTPUT->action_icon($assocurl, new pix_icon('i/course', $text), null, array(), true);
$hascourseassocs = true;
$assoctype = get_string('course');
@@ -259,15 +259,15 @@ public function print_html($return=false) {
// Now show mod association
foreach ($blogassociations as $assocrec) {
- $contextrec = $DB->get_record('context', array('id' => $assocrec->contextid));
+ $context = get_context_instance_by_id($assocrec->contextid);
- if ($contextrec->contextlevel == CONTEXT_MODULE) {
+ if ($context->contextlevel == CONTEXT_MODULE) {
if ($hascourseassocs) {
$assocstr .= ', ';
$hascourseassocs = false;
}
- $modinfo = $DB->get_record('course_modules', array('id' => $contextrec->instanceid));
+ $modinfo = $DB->get_record('course_modules', array('id' => $context->instanceid));
$modname = $DB->get_field('modules', 'name', array('id' => $modinfo->module));
$assocurl = new moodle_url('/mod/'.$modname.'/view.php', array('id' => $modinfo->id));
View
29 cohort/index.php
@@ -25,9 +25,12 @@
*/
require('../config.php');
+require($CFG->dirroot.'/cohort/lib.php');
require_once($CFG->libdir.'/adminlib.php');
$contextid = optional_param('contextid', 0, PARAM_INT);
+$page = optional_param('page', 0, PARAM_INT);
+$searchquery = optional_param('search', '', PARAM_RAW);
require_login();
@@ -68,10 +71,31 @@
echo $OUTPUT->heading(get_string('cohortsin', 'cohort', print_context_name($context)));
-$cohorts = $DB->get_records('cohort', array('contextid'=>$context->id));
+// add search form
+$search = html_writer::start_tag('form', array('id'=>'searchcohortquery', 'method'=>'get'));
+$search .= html_writer::start_tag('div');
+$search .= html_writer::label(get_string('searchcohort', 'cohort').':', 'cohort_search_q');
+$search .= html_writer::empty_tag('input', array('id'=>'cohort_search_q', 'type'=>'text', 'name'=>'search', 'value'=>$searchquery));
+$search .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('search', 'cohort')));
+$search .= html_writer::end_tag('div');
+$search .= html_writer::end_tag('form');
+echo $search;
+
+$cohorts = cohort_get_cohorts($context->id, $page, 25, $searchquery);
+
+// output pagination bar
+$params = array('page' => $page);
+if ($contextid) {
+ $params['contextid'] = $contextid;
+}
+if ($search) {
+ $params['search'] = $searchquery;
+}
+$baseurl = new moodle_url('/cohort/index.php', $params);
+echo $OUTPUT->paging_bar($cohorts['totalcohorts'], $page, 25, $baseurl);
$data = array();
-foreach($cohorts as $cohort) {
+foreach($cohorts['cohorts'] as $cohort) {
$line = array();
$line[] = format_string($cohort->name);
$line[] = $cohort->idnumber;
@@ -107,6 +131,7 @@
$table->width = '80%';
$table->data = $data;
echo html_writer::table($table);
+echo $OUTPUT->paging_bar($cohorts['totalcohorts'], $page, 25, $baseurl);
if ($manager) {
echo $OUTPUT->single_button(new moodle_url('/cohort/edit.php', array('contextid'=>$context->id)), get_string('add'));
View
45 cohort/lib.php
@@ -191,6 +191,51 @@ function cohort_get_visible_list($course) {
}
/**
+ * Get all the cohorts.
+ *
+ * @global moodle_database $DB
+ * @param int $contextid
+ * @param int $page number of the current page
+ * @param int $perpage items per page
+ * @param string $search search string
+ * @return array Array(totalcohorts => int, cohorts => array)
+ */
+function cohort_get_cohorts($contextid, $page = 0, $perpage = 25, $search = '') {
+ global $DB;
+
+ $cohorts = array();
+
+ // Add some additional sensible conditions
+ $tests = array('contextid = ?');
+ $params = array($contextid);
+
+ if (!empty($search)) {
+ $conditions = array(
+ 'name',
+ 'idnumber',
+ 'description',
+ );
+ $searchparam = '%' . $search . '%';
+ foreach ($conditions as $key=>$condition) {
+ $conditions[$key] = $DB->sql_like($condition,"?", false);
+ $params[] = $searchparam;
+ }
+ $tests[] = '(' . implode(' OR ', $conditions) . ')';
+ }
+ $wherecondition = implode(' AND ', $tests);
+
+ $fields = 'SELECT *';
+ $countfields = 'SELECT COUNT(1)';
+ $sql = " FROM {cohort}
+ WHERE $wherecondition";
+ $order = ' ORDER BY name ASC';
+ $totalcohorts = $DB->count_records_sql($countfields . $sql, $params);
+ $cohorts = $DB->get_records_sql($fields . $sql . $order, $params, $page*$perpage, $perpage);
+
+ return array('totalcohorts' => $totalcohorts, 'cohorts' => $cohorts);
+}
+
+/**
* Cohort assignment candidates
*/
class cohort_candidate_selector extends user_selector_base {
View
3  course/category.php
@@ -314,7 +314,8 @@
$linkcss = $acourse->visible ? '' : ' class="dimmed" ';
echo '<tr>';
- echo '<td><a '.$linkcss.' href="view.php?id='.$acourse->id.'">'. format_string($acourse->fullname) .'</a></td>';
+ $coursename = get_course_display_name_for_list($acourse);
+ echo '<td><a '.$linkcss.' href="view.php?id='.$acourse->id.'">'. format_string($coursename) .'</a></td>';
if ($editingon) {
echo '<td>';
if (has_capability('moodle/course:update', $coursecontext)) {
View
23 course/lib.php
@@ -2174,6 +2174,22 @@ function make_categories_options() {
}
/**
+ * Gets the name of a course to be displayed when showing a list of courses.
+ * By default this is just $course->fullname but user can configure it. The
+ * result of this function should be passed through print_string.
+ * @param object $course Moodle course object
+ * @return string Display name of course (either fullname or short + fullname)
+ */
+function get_course_display_name_for_list($course) {
+ global $CFG;
+ if (!empty($CFG->courselistshortnames)) {
+ return $course->shortname . ' ' .$course->fullname;
+ } else {
+ return $course->fullname;
+ }
+}
+
+/**
* Prints the category info in indented fashion
* This function is only used by print_whole_category_list() above
*/
@@ -2231,7 +2247,8 @@ function print_category_info($category, $depth=0, $showcourses = false) {
$linkcss = array('class'=>'dimmed');
}
- $courselink = html_writer::link(new moodle_url('/course/view.php', array('id'=>$course->id)), format_string($course->fullname), $linkcss);
+ $coursename = get_course_display_name_for_list($course);
+ $courselink = html_writer::link(new moodle_url('/course/view.php', array('id'=>$course->id)), format_string($coursename), $linkcss);
// print enrol info
$courseicon = '';
@@ -2423,7 +2440,9 @@ function print_course($course, $highlightterms = '') {
echo html_writer::start_tag('h3', array('class'=>'name'));
$linkhref = new moodle_url('/course/view.php', array('id'=>$course->id));
- $linktext = highlight($highlightterms, format_string($course->fullname));
+
+ $coursename = get_course_display_name_for_list($course);
+ $linktext = highlight($highlightterms, format_string($coursename));
$linkparams = array('title'=>get_string('entercourse'));
if (empty($course->visible)) {
$linkparams['class'] = 'dimmed';
View
12 course/modedit.php
@@ -320,12 +320,6 @@
if (!empty($CFG->enableavailability)) {
$cm->availablefrom = $fromform->availablefrom;
$cm->availableuntil = $fromform->availableuntil;
- // The form time is midnight, but because we want it to be
- // inclusive, set it to 23:59:59 on that day.
- if ($cm->availableuntil) {
- $cm->availableuntil = strtotime('23:59:59',
- $cm->availableuntil);
- }
$cm->showavailability = $fromform->showavailability;
condition_info::update_cm_from_form($cm,$fromform,true);
}
@@ -411,12 +405,6 @@
if(!empty($CFG->enableavailability)) {
$newcm->availablefrom = $fromform->availablefrom;
$newcm->availableuntil = $fromform->availableuntil;
- // The form time is midnight, but because we want it to be
- // inclusive, set it to 23:59:59 on that day.
- if ($newcm->availableuntil) {
- $newcm->availableuntil = strtotime('23:59:59',
- $newcm->availableuntil);
- }
$newcm->showavailability = $fromform->showavailability;
}
if (isset($fromform->showdescription)) {
View
21 course/moodleform_mod.php
@@ -309,7 +309,7 @@ function validation($data, $files) {
// Conditions: Don't let them set dates which make no sense
if (array_key_exists('availablefrom', $data) &&
$data['availablefrom'] && $data['availableuntil'] &&
- $data['availablefrom'] > $data['availableuntil']) {
+ $data['availablefrom'] >= $data['availableuntil']) {
$errors['availablefrom'] = get_string('badavailabledates', 'condition');
}
@@ -430,10 +430,23 @@ function standard_coursemodule_elements(){
if (!empty($CFG->enableavailability)) {
// Conditional availability
- $mform->addElement('header', 'availabilityconditionsheader', get_string('availabilityconditions', 'condition'));
- $mform->addElement('date_selector', 'availablefrom', get_string('availablefrom', 'condition'), array('optional'=>true));
+
+ // Available from/to defaults to midnight because then the display
+ // will be nicer where it tells users when they can access it (it
+ // shows only the date and not time).
+ $date = usergetdate(time());
+ $midnight = make_timestamp($date['year'], $date['mon'], $date['mday']);
+
+ // From/until controls
+ $mform->addElement('header', 'availabilityconditionsheader',
+ get_string('availabilityconditions', 'condition'));
+ $mform->addElement('date_time_selector', 'availablefrom',
+ get_string('availablefrom', 'condition'),
+ array('optional' => true, 'defaulttime' => $midnight));
$mform->addHelpButton('availablefrom', 'availablefrom', 'condition');
- $mform->addElement('date_selector', 'availableuntil', get_string('availableuntil', 'condition'), array('optional'=>true));
+ $mform->addElement('date_time_selector', 'availableuntil',
+ get_string('availableuntil', 'condition'),
+ array('optional' => true, 'defaulttime' => $midnight));
// Conditions based on grades
$gradeoptions = array();
View
29 course/report/completion/index.php
@@ -241,6 +241,9 @@ function csv_quote($value) {
foreach ($initials as $initial) {
$var = 'si'.$initial;
+ $othervar = $initial == 'first' ? 'silast' : 'sifirst';
+ $othervar = $$othervar != 'all' ? "&amp;{$othervar}={$$othervar}" : '';
+
$pagingbar .= ' <div class="initialbar '.$initial.'initial">';
$pagingbar .= get_string($initial.'name').':&nbsp;';
@@ -248,7 +251,7 @@ function csv_quote($value) {
$pagingbar .= '<strong>'.get_string('all').'</strong> ';
}
else {
- $pagingbar .= '<a href="'.$link.'">'.get_string('all').'</a> ';
+ $pagingbar .= "<a href=\"{$link}{$othervar}\">".get_string('all').'</a> ';
}
foreach ($alphabet as $letter) {
@@ -256,7 +259,7 @@ function csv_quote($value) {
$pagingbar .= '<strong>'.$letter.'</strong> ';
}
else {
- $pagingbar .= '<a href="'.$link.'&amp;'.$var.'='.$letter.'">'.$letter.'</a> ';
+ $pagingbar .= "<a href=\"$link&amp;$var={$letter}{$othervar}\">$letter</a> ";
}
}
@@ -270,10 +273,19 @@ function csv_quote($value) {
$pagingbar .= '<div class="paging">';
$pagingbar .= get_string('page').': ';
+ $sistrings = array();
+ if ($sifirst != 'all') {
+ $sistrings[] = "sifirst={$sifirst}";
+ }
+ if ($silast != 'all') {
+ $sistrings[] = "silast={$silast}";
+ }
+ $sistring = !empty($sistrings) ? '&amp;'.implode('&amp;', $sistrings) : '';
+
// Display previous link
if ($start > 0) {
$pstart = max($start - COMPLETION_REPORT_PAGE, 0);
- $pagingbar .= '(<a class="previous" href="'.$link.$pstart.'">'.get_string('previous').'</a>)&nbsp;';
+ $pagingbar .= "(<a class=\"previous\" href=\"{$link}{$pstart}{$sistring}\">".get_string('previous').'</a>)&nbsp;';
}
// Create page links
@@ -286,7 +298,7 @@ function csv_quote($value) {
$pagingbar .= '&nbsp;'.$curpage.'&nbsp;';
}
else {
- $pagingbar .= '&nbsp;<a href="'.$link.$curstart.'">'.$curpage.'</a>&nbsp;';
+ $pagingbar .= "&nbsp;<a href=\"{$link}{$curstart}{$sistring}\">$curpage</a>&nbsp;";
}
$curstart += COMPLETION_REPORT_PAGE;
@@ -295,7 +307,7 @@ function csv_quote($value) {
// Display next link
$nstart = $start + COMPLETION_REPORT_PAGE;
if ($nstart < $total) {
- $pagingbar .= '&nbsp;(<a class="next" href="'.$link.$nstart.'">'.get_string('next').'</a>)';
+ $pagingbar .= "&nbsp;(<a class=\"next\" href=\"{$link}{$nstart}{$sistring}\">".get_string('next').'</a>)';
}
$pagingbar .= '</div>';
@@ -441,12 +453,15 @@ function csv_quote($value) {
// User heading / sort option
print '<th scope="col" class="completion-sortchoice" style="clear: both;">';
+
+ $sistring = "&amp;silast={$silast}&amp;sifirst={$sifirst}";
+
if($firstnamesort) {
print
- get_string('firstname').' / <a href="./?course='.$course->id.'">'.
+ get_string('firstname')." / <a href=\"./?course={$course->id}{$sistring}\">".
get_string('lastname').'</a>';
} else {
- print '<a href="./?course='.$course->id.'&amp;sort=firstname">'.
+ print "<a href=\"./?course={$course->id}&amp;sort=firstname{$sistring}\">".
get_string('firstname').'</a> / '.
get_string('lastname');
}
View
29 course/report/progress/index.php
@@ -173,6 +173,9 @@ function csv_quote($value) {
foreach ($initials as $initial) {
$var = 'si'.$initial;
+ $othervar = $initial == 'first' ? 'silast' : 'sifirst';
+ $othervar = $$othervar != 'all' ? "&amp;{$othervar}={$$othervar}" : '';
+
$pagingbar .= ' <div class="initialbar '.$initial.'initial">';
$pagingbar .= get_string($initial.'name').':&nbsp;';
@@ -180,7 +183,7 @@ function csv_quote($value) {
$pagingbar .= '<strong>'.get_string('all').'</strong> ';
}
else {
- $pagingbar .= '<a href="'.$link.'">'.get_string('all').'</a> ';
+ $pagingbar .= "<a href=\"{$link}{$othervar}\">".get_string('all').'</a> ';
}
foreach ($alphabet as $letter) {
@@ -188,7 +191,7 @@ function csv_quote($value) {
$pagingbar .= '<strong>'.$letter.'</strong> ';
}
else {
- $pagingbar .= '<a href="'.$link.'&amp;'.$var.'='.$letter.'">'.$letter.'</a> ';
+ $pagingbar .= "<a href=\"$link&amp;$var={$letter}{$othervar}\">$letter</a> ";
}
}
@@ -202,10 +205,19 @@ function csv_quote($value) {
$pagingbar .= '<div class="paging">';
$pagingbar .= get_string('page').': ';
+ $sistrings = array();
+ if ($sifirst != 'all') {
+ $sistrings[] = "sifirst={$sifirst}";
+ }
+ if ($silast != 'all') {
+ $sistrings[] = "silast={$silast}";
+ }
+ $sistring = !empty($sistrings) ? '&amp;'.implode('&amp;', $sistrings) : '';
+
// Display previous link
if ($start > 0) {
$pstart = max($start - COMPLETION_REPORT_PAGE, 0);
- $pagingbar .= '(<a class="previous" href="'.$link.$pstart.'">'.get_string('previous').'</a>)&nbsp;';
+ $pagingbar .= "(<a class=\"previous\" href=\"{$link}{$pstart}{$sistring}\">".get_string('previous').'</a>)&nbsp;';
}
// Create page links
@@ -218,7 +230,7 @@ function csv_quote($value) {
$pagingbar .= '&nbsp;'.$curpage.'&nbsp;';
}
else {
- $pagingbar .= '&nbsp;<a href="'.$link.$curstart.'">'.$curpage.'</a>&nbsp;';
+ $pagingbar .= "&nbsp;<a href=\"{$link}{$curstart}{$sistring}\">$curpage</a>&nbsp;";
}
$curstart += COMPLETION_REPORT_PAGE;
@@ -227,7 +239,7 @@ function csv_quote($value) {
// Display next link
$nstart = $start + COMPLETION_REPORT_PAGE;
if ($nstart < $total) {
- $pagingbar .= '&nbsp;(<a class="next" href="'.$link.$nstart.'">'.get_string('next').'</a>)';
+ $pagingbar .= "&nbsp;(<a class=\"next\" href=\"{$link}{$nstart}{$sistring}\">".get_string('next').'</a>)';
}
$pagingbar .= '</div>';
@@ -251,12 +263,15 @@ function csv_quote($value) {
// User heading / sort option
print '<th scope="col" class="completion-sortchoice">';
+
+ $sistring = "&amp;silast={$silast}&amp;sifirst={$sifirst}";
+
if($firstnamesort) {
print
- get_string('firstname').' / <a href="./?course='.$course->id.'">'.
+ get_string('firstname')." / <a href=\"./?course={$course->id}{$sistring}\">".
get_string('lastname').'</a>';
} else {
- print '<a href="./?course='.$course->id.'&amp;sort=firstname">'.
+ print "<a href=\"./?course={$course->id}&amp;sort=firstname{$sistring}\">".
get_string('firstname').'</a> / '.
get_string('lastname');
}
View
20 course/simpletest/testcourselib.php
@@ -113,4 +113,24 @@ function testReorderSections() {
$this->assertEqual(25, next($newsections_flipped));
$this->assertEqual(21, next($newsections_flipped));
}
+
+ function test_get_course_display_name_for_list() {
+ global $CFG;
+
+ $course = (object)array('shortname' => 'FROG101',
+ 'fullname' => 'Introduction to pond life');
+
+ // Store config value in case other tests rely on it
+ $oldcfg = $CFG->courselistshortnames;
+
+ $CFG->courselistshortnames = 0;
+ $this->assertEqual('Introduction to pond life',
+ get_course_display_name_for_list($course));
+
+ $CFG->courselistshortnames = 1;
+ $this->assertEqual('FROG101 Introduction to pond life',
+ get_course_display_name_for_list($course));
+
+ $CFG->courselistshortnames = $oldcfg;
+ }
}
View
10 enrol/cohort/ajax.php
@@ -70,7 +70,9 @@
break;
case 'getcohorts':
require_capability('moodle/course:enrolconfig', $context);
- $outcome->response = enrol_cohort_get_cohorts($manager);
+ $offset = optional_param('offset', 0, PARAM_INT);
+ $search = optional_param('search', '', PARAM_RAW);
+ $outcome->response = enrol_cohort_search_cohorts($manager, $offset, 25, $search);
break;
case 'enrolcohort':
require_capability('moodle/course:enrolconfig', $context);
@@ -79,8 +81,7 @@
$cohortid = required_param('cohortid', PARAM_INT);
$roles = $manager->get_assignable_roles();
- $cohorts = enrol_cohort_get_cohorts($manager);
- if (!array_key_exists($cohortid, $cohorts) || !array_key_exists($roleid, $roles)) {
+ if (!enrol_cohort_can_view_cohort($cohortid) || !array_key_exists($roleid, $roles)) {
throw new enrol_ajax_exception('errorenrolcohort');
}
$enrol = enrol_get_plugin('cohort');
@@ -94,8 +95,7 @@
$result = enrol_cohort_enrol_all_users($manager, $cohortid, $roleid);
$roles = $manager->get_assignable_roles();
- $cohorts = enrol_cohort_get_cohorts($manager);
- if (!array_key_exists($cohortid, $cohorts) || !array_key_exists($roleid, $roles)) {
+ if (!enrol_cohort_can_view_cohort($cohortid) || !array_key_exists($roleid, $roles)) {
throw new enrol_ajax_exception('errorenrolcohort');
}
if ($result === false) {
View
2  enrol/cohort/lang/en/enrol_cohort.php
@@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['ajaxmore'] = 'More...';
+$string['cohortsearch'] = 'Search';
$string['cohort:config'] = 'Configure cohort instances';
$string['pluginname'] = 'Cohort sync';
$string['pluginname_desc'] = 'Cohort enrolment plugin synchronises cohort members with course participants.';
View
11 enrol/cohort/lib.php
@@ -157,7 +157,16 @@ public function get_manual_enrol_button(course_enrolment_manager $manager) {
$button = new enrol_user_button($cohorturl, get_string('enrolcohort', 'enrol'), 'get');
$button->class .= ' enrol_cohort_plugin';
- $button->strings_for_js(array('enrol','synced','enrolcohort','enrolcohortusers'), 'enrol');
+ $button->strings_for_js(array(
+ 'enrol',
+ 'synced',
+ 'enrolcohort',
+ 'enrolcohortusers',
+ ), 'enrol');
+ $button->strings_for_js(array(
+ 'ajaxmore',
+ 'cohortsearch',
+ ), 'enrol_cohort');
$button->strings_for_js('assignroles', 'role');
$button->strings_for_js('cohort', 'cohort');
$button->strings_for_js('users', 'moodle');
View
97 enrol/cohort/locallib.php
@@ -244,6 +244,7 @@ function enrol_cohort_enrol_all_users(course_enrolment_manager $manager, $cohort
* Gets all the cohorts the user is able to view.
*
* @global moodle_database $DB
+ * @param course_enrolment_manager $manager
* @return array
*/
function enrol_cohort_get_cohorts(course_enrolment_manager $manager) {
@@ -277,4 +278,100 @@ function enrol_cohort_get_cohorts(course_enrolment_manager $manager) {
}
$rs->close();
return $cohorts;
+}
+
+/**
+ * Check if cohort exists and user is allowed to enrol it
+ *
+ * @global moodle_database $DB
+ * @param int $cohortid Cohort ID
+ * @return boolean
+ */
+function enrol_cohort_can_view_cohort($cohortid) {
+ global $DB;
+ $cohort = $DB->get_record('cohort', array('id' => $cohortid), 'id, contextid');
+ if ($cohort) {
+ $context = get_context_instance_by_id($cohort->contextid);
+ if (has_capability('moodle/cohort:view', $context)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Gets cohorts the user is able to view.
+ *
+ * @global moodle_database $DB
+ * @param course_enrolment_manager $manager
+ * @param int $offset limit output from
+ * @param int $limit items to output per load
+ * @param string $search search string
+ * @return array Array(more => bool, offset => int, cohorts => array)
+ */
+function enrol_cohort_search_cohorts(course_enrolment_manager $manager, $offset = 0, $limit = 25, $search = '') {
+ global $DB;
+ $context = $manager->get_context();
+ $cohorts = array();
+ $instances = $manager->get_enrolment_instances();
+ $enrolled = array();
+ foreach ($instances as $instance) {
+ if ($instance->enrol == 'cohort') {
+ $enrolled[] = $instance->customint1;
+ }
+ }
+
+ list($sqlparents, $params) = $DB->get_in_or_equal(get_parent_contexts($context));
+
+ // Add some additional sensible conditions
+ $tests = array('contextid ' . $sqlparents);
+
+ // Modify the quesry to perform the search if requred
+ if (!empty($search)) {
+ $conditions = array(
+ 'name',
+ 'idnumber',
+ 'description'
+ );
+ $searchparam = '%' . $search . '%';
+ foreach ($conditions as $key=>$condition) {
+ $conditions[$key] = $DB->sql_like($condition,"?", false);
+ $params[] = $searchparam;
+ }
+ $tests[] = '(' . implode(' OR ', $conditions) . ')';
+ }
+ $wherecondition = implode(' AND ', $tests);
+
+ $fields = 'SELECT id, name, contextid, description';
+ $countfields = 'SELECT COUNT(1)';
+ $sql = " FROM {cohort}
+ WHERE $wherecondition";
+ $order = ' ORDER BY name ASC';
+ $rs = $DB->get_recordset_sql($fields . $sql . $order, $params, $offset);
+
+ // Produce the output respecting parameters
+ foreach ($rs as $c) {
+ // Track offset
+ $offset++;
+ // Check capabilities
+ $context = get_context_instance_by_id($c->contextid);
+ if (!has_capability('moodle/cohort:view', $context)) {
+ continue;
+ }
+ if ($limit === 0) {
+ // we have reached the required number of items and know that there are more, exit now
+ $offset--;
+ break;
+ }
+ $cohorts[$c->id] = array(
+ 'cohortid'=>$c->id,
+ 'name'=> shorten_text(format_string($c->name), 35),
+ 'users'=>$DB->count_records('cohort_members', array('cohortid'=>$c->id)),
+ 'enrolled'=>in_array($c->id, $enrolled)
+ );
+ // Count items
+ $limit--;
+ }
+ $rs->close();
+ return array('more' => !(bool)$limit, 'offset' => $offset, 'cohorts' => $cohorts);
}
View
43 enrol/cohort/yui/quickenrolment/assets/skins/sam/quickenrolment.css
@@ -1,25 +1,36 @@
-.qce-panel {background-color:#666;border:2px solid #666;border-width:0 2px 2px 0;width:420px;}
+.qce-panel {background-color:#666;border:2px solid #666;border-width:0 2px 2px 0;min-width:420px;}
.qce-panel .yui3-widget-hd {background:url("sprite.png");background-repeat:repeat-x;background-color:#DDD;background-position: 0 -15px;border-bottom:1px solid #555;border-top:1px solid #fff;}
.qce-panel .yui3-widget-hd h2 {margin:3px 5px 2px;padding:0;font-size:110%;}
.qce-panel .yui3-widget-hd .close {width:25px;height:15px;position:absolute;top:3px;right:1em;cursor:pointer;background:url("sprite.png") no-repeat scroll 0 0 transparent;}
.qce-panel .yui3-overlay-content {background-color:#F6F6F6;border:1px solid #555;margin-top:-2px;margin-left:-2px;}
-.qce-panel .yui3-widget-bd .loading {height:300px;text-align:center;}
-.qce-panel .yui3-widget-bd .loading img {margin-top:130px;}
-.qce-panel .qce-enrollable-cohorts {overflow:auto;margin:5px;}
-.qce-panel .qce-cohorts {border:1px solid #666;width:408px;background-color:#FFF;height:250px;}
-.qce-panel .qce-cohort {width:100%;position:relative;clear:both;height:24px;}
+.qce-panel .qce-enrollable-cohorts {margin:5px;}
+.qce-panel .qce-cohorts {border:1px solid #666;min-width:408px;background-color:#FFF;height:375px;overflow:auto;}
+.qce-panel .qce-cohorts .qce-more-results {background-color:#eee;padding:5px;border-top:1px solid #BBB;text-align:center;}
+
+.qce-panel .qce-panel-content {min-height:405px;}
+.qce-panel .qce-panel-content .qce-loading-lightbox {position:absolute;width:100%;height:100%;top:0;left:0;background-color:#FFF;min-height:264px;text-align:center;}
+.qce-panel .qce-panel-content .qce-loading-lightbox.hidden {display:none;}
+.qce-panel .qce-panel-content .qce-loading-lightbox .loading-icon {margin:auto;vertical-align:middle;margin-top:198px;}
+
+.qce-panel .qce-cohort {width:100%;position:relative;clear:both;height:24px;white-space:nowrap;}
+.qce-panel .qce-cohort div {display:inline-block;overflow:hidden;}
.qce-panel .qce-cohort.odd {background-color:#f4f4f4;}
-.qce-panel .qce-cohort .qce-cohort-button {float:left;text-align:center;display:inline-block;font-size:80%;height:22px;line-height:22px;overflow:hidden;padding:0 4px;}
+.qce-panel .qce-cohort .qce-cohort-button {text-align:center;display:inline-block;font-size:80%;height:22px;line-height:22px;overflow:hidden;padding:0 4px;}
.qce-panel .qce-cohort .qce-cohort-button.notenrolled {background-color:#ddd;border:1px outset #CCC;background:url("sprite.png");background-repeat:repeat-x;background-color:#DDD;background-position: 0 -25px;color:inherit;}
.qce-panel .qce-cohort .qce-cohort-button.notenrolled:hover {background-position:0 -15px;cursor:pointer;}
.qce-panel .qce-cohort .qce-cohort-button.notenrolled.enrolusers {margin-right: 4px;}
-.qce-panel .qce-cohort .qce-cohort-button.alreadyenrolled {font-weight:bold;margin:2px;}
-.qce-panel .qce-cohort .qce-cohort-name {margin-left:80px;margin-right:40px;line-height:24px;}
-.qce-panel .canenrolusers .qce-cohort .qce-cohort-button.alreadyenrolled {width:140px;}
-.qce-panel .canenrolusers .qce-cohort .qce-cohort-name {margin-left:150px;margin-right:40px;line-height:24px;}
-.qce-panel .qce-cohort .qce-cohort-users {position:absolute;right:5px;top:0;width:30px;text-align:right;height:24px;line-height:24px;}
-.qce-panel .qce-assignable-roles {margin:3px 5px 2px;}
+.qce-panel .qce-cohort .qce-cohort-button.alreadyenrolled {font-weight:bold;}
+.qce-panel .qce-cohort .qce-cohort-name {line-height:24px;width:220px;}
+.qce-panel .canenrolusers .qce-cohort .qce-cohort-button.alreadyenrolled {width:125px;}
+.qce-panel .canenrolusers .qce-cohort .qce-cohort-name {line-height:24px;}
+.qce-panel .qce-cohort .qce-cohort-users {width:30px;text-align:right;height:24px;line-height:24px;margin-right:4px}
+
+.qce-panel .qce-assignable-roles {margin:5px 6px 0 6px;}
+.qce-panel .qce-assignable-roles label {padding-right:8px;}
+
+.qce-panel .qce-footer {margin:0 6px 5px 6px;}
+.qce-panel .qce-search label {padding-right:8px;}
+.qce-panel .qce-search input {width:70%;}
+
.qce-panel .qce-cohort.headings {font-weight:bold;border-width:0;}
-.qce-panel .qce-cohort.headings .qce-cohort-button {display:none;}
-.qce-panel .performing-action {position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fff;text-align:center;}
-.qce-panel .performing-action img {margin-top:150px;}
+.qce-panel .qce-cohort.headings .qce-cohort-button {display:none;}
View
156 enrol/cohort/yui/quickenrolment/quickenrolment.js
@@ -10,7 +10,12 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
ASSIGNABLEROLES = 'assignableRoles',
DEFAULTCOHORTROLE = 'defaultCohortRole',
COHORTS = 'cohorts',
+ MORERESULTS = 'moreresults',
+ FIRSTPAGE = 'firstpage',
+ OFFSET = 'offset',
PANELID = 'qce-panel-',
+ REQUIREREFRESH = 'requiresRefresh',
+ SEARCH = 'search',
URL = 'url',
AJAXURL = 'ajaxurl',
MANUALENROLMENT = 'manualEnrolment',
@@ -21,12 +26,18 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
COHORTENROLLED : 'qce-cohort-enrolled',
COHORTNAME : 'qce-cohort-name',
COHORTUSERS : 'qce-cohort-users',
+ ENROLUSERS : 'canenrolusers',
+ FOOTER : 'qce-footer',
+ HIDDEN : 'hidden',
+ LIGHTBOX : 'qce-loading-lightbox',
+ LOADINGICON : 'loading-icon',
+ MORERESULTS : 'qce-more-results',
PANEL : 'qce-panel',
PANELCONTENT : 'qce-panel-content',
PANELCOHORTS : 'qce-enrollable-cohorts',
PANELROLES : 'qce-assignable-roles',
PANELCONTROLS : 'qce-panel-controls',
- ENROLUSERS : 'canenrolusers'
+ SEARCH : 'qce-search'
},
COUNT = 0;
@@ -35,24 +46,47 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
CONTROLLER.superclass.constructor.apply(this, arguments);
};
CONTROLLER.prototype = {
- _preformingAction : false,
initializer : function(config) {
COUNT ++;
this.publish('assignablerolesloaded', {fireOnce:true});
this.publish('cohortsloaded');
- this.publish('performingaction');
- this.publish('actioncomplete');
this.publish('defaultcohortroleloaded', {fireOnce:true});
+ var base = Y.Node.create('<div class="'+CSS.PANELCONTENT+'"></div>')
+ .append(Y.Node.create('<div class="'+CSS.PANELROLES+'"></div>'))
+ .append(Y.Node.create('<div class="'+CSS.PANELCOHORTS+'"></div>'))
+ .append(Y.Node.create('<div class="'+CSS.FOOTER+'"></div>')
+ .append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label>'+M.str.enrol_cohort.cohortsearch+':</label></div>')
+ .append(Y.Node.create('<input type="text" id="enrolcohortsearch" value="" />'))
+ )
+ )
+ .append(Y.Node.create('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>')
+ .append(Y.Node.create('<img alt="loading" class="'+CSS.LOADINGICON+'" />')
+ .setAttribute('src', M.util.image_url('i/loading', 'moodle')))
+ .setStyle('opacity', 0.5)
+ );
+
var close = Y.Node.create('<div class="close"></div>');
var panel = new Y.Overlay({
headerContent : Y.Node.create('<div></div>').append(Y.Node.create('<h2>'+M.str.enrol.enrolcohort+'</h2>')).append(close),
- bodyContent : Y.Node.create('<div class="loading"></div>').append(Y.Node.create('<img alt="loading" />').setAttribute('src', M.cfg.loadingicon)),
+ bodyContent : base,
constrain : true,
centered : true,
id : PANELID+COUNT,
visible : false
});
+
+ // display the wheel on ajax events
+ Y.on('io:start', function() {
+ base.one('.'+CSS.LIGHTBOX).removeClass(CSS.HIDDEN);
+ }, this);
+ Y.on('io:end', function() {
+ base.one('.'+CSS.LIGHTBOX).addClass(CSS.HIDDEN);
+ }, this);
+
+ this.set(SEARCH, base.one('#enrolcohortsearch'));
+ Y.on('key', this.getCohorts, this.get(SEARCH), 'down:13', this, false);
+
panel.get('boundingBox').addClass(CSS.PANEL);
panel.render(Y.one(document.body));
this.on('show', function(){
@@ -60,15 +94,10 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
this.show();
}, panel);
this.on('hide', panel.hide, panel);
- this.on('performingaction', function(){
- this.get('boundingBox').append(Y.Node.create('<div class="performing-action"></div>').append(Y.Node.create('<img alt="loading" />').setAttribute('src', M.cfg.loadingicon)).setStyle('opacity', 0.5));
- }, panel);
- this.on('actioncomplete', function(){
- this.get('boundingBox').one('.performing-action').remove();
- }, panel);
this.on('assignablerolesloaded', this.updateContent, this, panel);
this.on('cohortsloaded', this.updateContent, this, panel);
this.on('defaultcohortroleloaded', this.updateContent, this, panel);
+ Y.on('key', this.hide, document.body, 'down:27', this);
close.on('click', this.hide, this);
Y.all('.enrol_cohort_plugin input').each(function(node){
@@ -77,38 +106,51 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
}
}, this);
- var base = panel.get('boundingBox');
+ base = panel.get('boundingBox');
base.plug(Y.Plugin.Drag);
base.dd.addHandle('.yui3-widget-hd h2');
base.one('.yui3-widget-hd h2').setStyle('cursor', 'move');
},
show : function(e) {
e.preventDefault();
- this.getCohorts();
+ // prepare the data and display the window
+ this.getCohorts(e, false);
this.getAssignableRoles();
this.fire('show');
},
updateContent : function(e, panel) {
- if (panel.get('contentBox').one('.loading')) {
- panel.set('bodyContent', Y.Node.create('<div class="'+CSS.PANELCONTENT+'"></div>')
- .append(Y.Node.create('<div class="'+CSS.PANELCOHORTS+'"><div class="'+CSS.COHORT+' headings"><div class="'+CSS.COHORTBUTTON+'"></div><div class="'+CSS.COHORTNAME+'">'+M.str.cohort.cohort+'</div><div class="'+CSS.COHORTUSERS+'">'+M.str.moodle.users+'</div></div></div>'))
- .append(Y.Node.create('<div class="'+CSS.PANELROLES+'"></div>')));
- }
var content, i, roles, cohorts, count=0, supportmanual = this.get(MANUALENROLMENT), defaultrole;
switch (e.type.replace(/^[^:]+:/, '')) {
case 'cohortsloaded' :
- cohorts = this.get(COHORTS);
- content = Y.Node.create('<div class="'+CSS.COHORTS+'"></div>');
- if (supportmanual) {
- content.addClass(CSS.ENROLUSERS);
+ if (this.get(FIRSTPAGE)) {
+ // we are on the page 0, create new element for cohorts list
+ content = Y.Node.create('<div class="'+CSS.COHORTS+'"></div>');
+ if (supportmanual) {
+ content.addClass(CSS.ENROLUSERS);
+ }
+ } else {
+ // we are adding cohorts to existing list
+ content = Y.Node.one('.'+CSS.PANELCOHORTS+' .'+CSS.COHORTS);
+ content.one('.'+CSS.MORERESULTS).remove();
}
+ // add cohorts items to the content
+ cohorts = this.get(COHORTS);
for (i in cohorts) {
count++;
cohorts[i].on('enrolchort', this.enrolCohort, this, cohorts[i], panel.get('contentBox'), false);
cohorts[i].on('enrolusers', this.enrolCohort, this, cohorts[i], panel.get('contentBox'), true);
content.append(cohorts[i].toHTML(supportmanual).addClass((count%2)?'even':'odd'));
}
- panel.get('contentBox').one('.'+CSS.PANELCOHORTS).setContent(content);
+ // add the next link if there are more items expected
+ if (this.get(MORERESULTS)) {
+ var fetchmore = Y.Node.create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.str.enrol_cohort.ajaxmore+'</a></div>');
+ fetchmore.on('click', this.getCohorts, this, true);
+ content.append(fetchmore);
+ }
+ // finally assing the content to the block
+ if (this.get(FIRSTPAGE)) {
+ panel.get('contentBox').one('.'+CSS.PANELCOHORTS).setContent(content);
+ }
break;
case 'assignablerolesloaded':
roles = this.get(ASSIGNABLEROLES);
@@ -116,7 +158,7 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
for (i in roles) {
content.append(Y.Node.create('<option value="'+i+'">'+roles[i]+'</option>'));
}
- panel.get('contentBox').one('.'+CSS.PANELROLES).setContent(Y.Node.create('<div>'+M.str.role.assignroles+': </div>').append(content));
+ panel.get('contentBox').one('.'+CSS.PANELROLES).setContent(Y.Node.create('<div><label>'+M.str.role.assignroles+':</label></div>').append(content));
this.getDefaultCohortRole();
break;
@@ -127,12 +169,31 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
}
},
hide : function() {
+ if (this.get(REQUIREREFRESH)) {
+ window.location = this.get(URL);
+ }
this.fire('hide');
},
- getCohorts : function() {
+ getCohorts : function(e, append) {
+ if (e) {
+ e.preventDefault();
+ }
+ if (append) {
+ this.set(FIRSTPAGE, false);
+ } else {
+ this.set(FIRSTPAGE, true);
+ this.set(OFFSET, 0);
+ }
+ var params = [];
+ params['id'] = this.get(COURSEID);
+ params['offset'] = this.get(OFFSET);
+ params['search'] = this.get(SEARCH).get('value');
+ params['action'] = 'getcohorts';
+ params['sesskey'] = M.cfg.sesskey;
+
Y.io(M.cfg.wwwroot+this.get(AJAXURL), {
method:'POST',
- data:'id='+this.get(COURSEID)+'&action=getcohorts&sesskey='+M.cfg.sesskey,
+ data:build_querystring(params),
on: {
complete: function(tid, outcome, args) {
try {
@@ -145,16 +206,16 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
} catch (e) {
return new M.core.exception(e);
}
- this.getCohorts = function() {
- this.fire('cohortsloaded');
- };
- this.getCohorts();
+ this.fire('cohortsloaded');
}
},
context:this
});
},
- setCohorts : function(rawcohorts) {
+ setCohorts : function(response) {
+ this.set(MORERESULTS, response.more);
+ this.set(OFFSET, response.offset);
+ var rawcohorts = response.cohorts;
var cohorts = [], i=0;
for (i in rawcohorts) {
cohorts[rawcohorts[i].cohortid] = new COHORT(rawcohorts[i]);
@@ -201,11 +262,6 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
});
},
enrolCohort : function(e, cohort, node, usersonly) {
- if (this._preformingAction) {
- return true;
- }
- this._preformingAction = true;
- this.fire('performingaction');
var params = {
id : this.get(COURSEID),
roleid : node.one('.'+CSS.PANELROLES+' select').get('value'),
@@ -223,24 +279,13 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
if (result.error) {
new M.core.ajaxException(result);
} else {
- var redirecturl = this.get(URL), redirect = function() {
- if (!usersonly || result.response.users) {
- Y.one(document.body).append(
- Y.Node.create('<div class="corelightbox"></div>')
- .setStyle('height', Y.one(document.body).get('docHeight')+'px')
- .setStyle('opacity', '0.4')
- .append(Y.Node.create('<img alt="loading" />').setAttribute('src', M.cfg.loadingicon)));
- window.location.href = redirecturl;
- }
- };
if (result.response && result.response.message) {
- new M.core.alert(result.response).on('complete', redirect, this);
- } else {
- redirect();
+ new M.core.alert(result.response);
}
+ var enrolled = Y.Node.create('<div class="'+CSS.COHORTBUTTON+' alreadyenrolled">'+M.str.enrol.synced+'</div>');
+ node.one('.'+CSS.COHORT+' #cohortid_'+cohort.get(COHORTID)).replace(enrolled);
+ this.set(REQUIREREFRESH, true);
}
- this._preformingAction = false;
- this.fire('actioncomplete');
} catch (e) {
new M.core.exception(e);
}
@@ -275,6 +320,10 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
},
defaultCohortRole : {
value : null
+ },
+ requiresRefresh : {
+ value : false,
+ validator : Y.Lang.isBool
}
}
});
@@ -290,7 +339,7 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
if (this.get(ENROLLED)) {
button = Y.Node.create('<div class="'+CSS.COHORTBUTTON+' alreadyenrolled">'+M.str.enrol.synced+'</div>');
} else {
- button = Y.Node.create('<div></div>');
+ button = Y.Node.create('<div id="cohortid_'+this.get(COHORTID)+'"></div>');
syncbutton = Y.Node.create('<a class="'+CSS.COHORTBUTTON+' notenrolled enrolcohort">'+M.str.enrol.enrolcohort+'</a>');
syncbutton.on('click', function(){this.fire('enrolchort');}, this);
@@ -304,9 +353,6 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
}
name = Y.Node.create('<div class="'+CSS.COHORTNAME+'">'+this.get(NAME)+'</div>');
users = Y.Node.create('<div class="'+CSS.COHORTUSERS+'">'+this.get(USERS)+'</div>');
- if (this.get(ENROLLED)) {
- button.one(CSS.COHORTENROLLED);
- }
return result.append(button).append(name).append(users);
}
}, {
View
4 enrol/guest/lib.php
@@ -77,7 +77,7 @@ public function try_guestaccess(stdClass $instance) {
if (empty($instance->password)) {
// Temporarily assign them some guest role for this context
$context = get_context_instance(CONTEXT_COURSE, $instance->courseid);
- $USER->access = load_temp_role($context, $CFG->guestroleid, $USER->access);
+ load_temp_course_role($context, $CFG->guestroleid);
return ENROL_REQUIRE_LOGIN_CACHE_PERIOD + time();
}
@@ -131,7 +131,7 @@ public function enrol_page_hook(stdClass $instance) {
// add guest role
$context = get_context_instance(CONTEXT_COURSE, $instance->courseid);
- $USER->access = load_temp_role($context, $CFG->guestroleid, $USER->access);
+ load_temp_course_role($context, $CFG->guestroleid);
// go to the originally requested page
if (!empty($SESSION->wantsurl)) {
View
3  enrol/paypal/return.php
@@ -38,9 +38,6 @@
require_login();
-// Refreshing enrolment data in the USER session
-load_all_capabilities();
-
if ($SESSION->wantsurl) {
$destination = $SESSION->wantsurl;
unset($SESSION->wantsurl);
View