Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/moodle/moodle

  • Loading branch information...
commit 03d3451d625f3b2a0b4a44ba08d7b0f2aa268be0 2 parents ae4a9ae + 4db0616
Yang doraemonyoung authored
Showing with 3,360 additions and 828 deletions.
  1. +5 −2 admin/cli/install.php
  2. +3 −1 admin/cli/install_database.php
  3. +67 −8 admin/cli/mysql_engine.php
  4. +5 −2 admin/cli/upgrade.php
  5. +33 −0 admin/index.php
  6. +38 −0 admin/oauth2callback.php
  7. +56 −23 admin/renderer.php
  8. +57 −10 admin/repository.php
  9. +58 −30 admin/repositoryinstance.php
  10. +2 −0  admin/settings/development.php
  11. +7 −7 admin/settings/plugins.php
  12. +3 −1 admin/timezone.php
  13. +29 −6 admin/tool/assignmentupgrade/batchupgrade.php
  14. +2 −2 admin/tool/assignmentupgrade/index.php
  15. +3 −0  admin/tool/assignmentupgrade/lang/en/tool_assignmentupgrade.php
  16. +16 −5 admin/tool/assignmentupgrade/listnotupgraded.php
  17. +20 −41 admin/tool/assignmentupgrade/locallib.php
  18. +5 −0 admin/tool/assignmentupgrade/module.js
  19. +59 −0 admin/tool/assignmentupgrade/paginationform.php
  20. +12 −46 admin/tool/assignmentupgrade/renderer.php
  21. +1 −1  admin/tool/assignmentupgrade/styles.css
  22. +1 −2  admin/tool/assignmentupgrade/upgradableassignmentstable.php
  23. +7 −9 admin/tool/assignmentupgrade/upgradesingle.php
  24. +1 −1  admin/tool/assignmentupgrade/upgradesingleconfirm.php
  25. +1 −1  admin/tool/bloglevelupgrade/index.php
  26. +2 −3 admin/tool/unittest/coveragefile.php
  27. +1 −0  auth/shibboleth/index.php
  28. +1 −1  backup/backupfilesedit_form.php
  29. +14 −5 backup/moodle2/backup_stepslib.php
  30. +20 −0 backup/moodle2/backup_xml_transformer.class.php
  31. +1 −0  backup/moodle2/restore_final_task.class.php
  32. +19 −2 backup/moodle2/restore_stepslib.php
  33. +21 −0 backup/util/dbops/backup_controller_dbops.class.php
  34. +178 −34 backup/util/dbops/restore_dbops.class.php
  35. +7 −5 backup/util/helper/backup_cron_helper.class.php
  36. +4 −0 backup/util/helper/backup_file_manager.class.php
  37. +6 −0 backup/util/helper/backup_general_helper.class.php
  38. +0 −6 backup/util/helper/convert_helper.class.php
  39. +12 −14 backup/util/plan/base_plan.class.php
  40. +21 −4 backup/util/ui/backup_ui_stage.class.php
  41. +28 −14 backup/util/ui/base_moodleform.class.php
  42. +10 −0 backup/util/ui/renderer.php
  43. +4 −1 blocks/activity_modules/block_activity_modules.php
  44. +1 −1  blocks/private_files/block_private_files.php
  45. +1 −1  blocks/private_files/edit.php
  46. +2 −3 blocks/private_files/renderer.php
  47. +2 −0  blog/index.php
  48. +2 −5 blog/locallib.php
  49. +32 −20 calendar/lib.php
  50. +3 −0  comment/comment.js
  51. +3 −1 course/changenumsections.php
  52. +19 −17 course/completion.php
  53. +64 −20 course/dndupload.js
  54. +29 −13 course/dnduploadlib.php
  55. +4 −8 course/externallib.php
  56. +68 −22 course/format/renderer.php
  57. +39 −9 course/format/topics/format.js
  58. +21 −0 course/format/topics/lib.php
  59. +0 −19 course/format/topics/renderer.php
  60. +39 −12 course/format/weeks/format.js
  61. +52 −16 course/format/weeks/lib.php
  62. +19 −0 course/format/weeks/renderer.php
  63. +3 −8 course/lib.php
  64. +10 −7 course/recent.php
  65. +9 −0 course/rest.php
  66. +12 −2 course/view.php
  67. +165 −0 course/yui/coursebase/coursebase.js
  68. +50 −28 course/yui/dragdrop/dragdrop.js
  69. +11 −11 course/yui/toolboxes/toolboxes.js
  70. +2 −1  draftfile.php
  71. +2 −2 enrol/externallib.php
  72. +1 −0  enrol/mnet/enrol.php
  73. +1 −1  files/coursefilesedit_form.php
  74. +2 −2 files/filebrowser_ajax.php
  75. +833 −16 files/renderer.php
  76. +2 −1  filter/glossary/yui/autolinker/autolinker.js
  77. +62 −21 grade/lib.php
  78. +7 −14 group/externallib.php
  79. +1 −1  install/lang/ar/admin.php
  80. +2 −2 install/lang/ast/install.php
  81. +1 −1  install/lang/az/admin.php
  82. +8 −8 install/lang/az/install.php
  83. +1 −1  install/lang/ca/admin.php
  84. +2 −2 install/lang/ca/install.php
  85. +12 −12 install/lang/cy/install.php
  86. +15 −16 install/lang/da/install.php
  87. +1 −1  install/lang/de/admin.php
  88. +1 −1  install/lang/de/install.php
  89. +5 −5 install/lang/es/install.php
  90. +33 −0 install/lang/es_mx/admin.php
  91. +38 −0 install/lang/es_mx/install.php
  92. +1 −1  install/lang/et/admin.php
  93. +4 −4 install/lang/eu/install.php
  94. +3 −3 install/lang/gl/install.php
  95. +1 −1  install/lang/he/admin.php
  96. +5 −5 install/lang/he/install.php
  97. +8 −8 install/lang/hr/install.php
  98. +6 −6 install/lang/hu/install.php
  99. +4 −4 install/lang/hy/install.php
  100. +7 −7 install/lang/ka/install.php
  101. +2 −2 install/lang/ko/install.php
  102. +10 −10 install/lang/lv/install.php
  103. +4 −4 install/lang/mk/install.php
  104. +1 −1  install/lang/mn/install.php
  105. +1 −1  install/lang/nl/admin.php
  106. +1 −1  install/lang/no/install.php
  107. +1 −1  install/lang/pl/install.php
  108. +2 −2 install/lang/pt/admin.php
  109. +1 −1  install/lang/pt/install.php
  110. +2 −1  install/lang/pt_br/install.php
  111. +3 −3 install/lang/ru/install.php
  112. +13 −13 install/lang/sl/install.php
  113. +7 −7 install/lang/sm/install.php
  114. +2 −2 install/lang/sr_cr/install.php
  115. +2 −2 install/lang/sr_lt/install.php
  116. +14 −14 install/lang/ta/install.php
  117. +2 −2 install/lang/ta_lk/install.php
  118. +3 −3 install/lang/th/install.php
  119. +3 −3 install/lang/tl/install.php
  120. +6 −6 install/lang/to/install.php
  121. +7 −7 install/lang/vi/install.php
  122. +0 −2  lang/en/access.php
  123. +5 −0 lang/en/admin.php
  124. +4 −0 lang/en/backup.php
  125. +2 −0  lang/en/error.php
  126. +26 −9 lang/en/mimetypes.php
  127. +10 −2 lang/en/moodle.php
  128. +2 −2 lang/en/plugin.php
  129. +27 −3 lang/en/repository.php
  130. +1 −6 lang/en/webservice.php
  131. +19 −1 lib/completion/completion_aggregation.php
  132. +9 −9 lib/completion/completion_completion.php
  133. +2 −2 lib/completion/completion_criteria.php
  134. +1 −2  lib/completion/completion_criteria_activity.php
  135. +3 −0  lib/completion/completion_criteria_completion.php
  136. +1 −1  lib/completion/completion_criteria_course.php
  137. +1 −1  lib/completion/completion_criteria_date.php
  138. +1 −2  lib/completion/completion_criteria_duration.php
  139. +1 −1  lib/completion/completion_criteria_grade.php
  140. +1 −1  lib/completion/cron.php
  141. +65 −15 lib/completion/data_object.php
  142. +3 −2 lib/completionlib.php
  143. +14 −2 lib/conditionlib.php
  144. +5 −4 lib/cronlib.php
  145. +3 −2 lib/db/install.php
  146. +29 −9 lib/db/install.xml
  147. +1 −0  lib/db/log.php
  148. +178 −1 lib/db/upgrade.php
  149. +16 −5 lib/dml/mssql_native_moodle_database.php
  150. +28 −0 lib/dml/tests/dml_test.php
  151. +1 −1  lib/editor/tinymce/lib.php
  152. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/jquery.tinymce.js
  153. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/langs/en.js
  154. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/license.txt
  155. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advhr/css/advhr.css
  156. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advhr/editor_plugin.js
  157. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advhr/editor_plugin_src.js
  158. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advhr/js/rule.js
  159. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advhr/langs/en_dlg.js
  160. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advhr/rule.htm
  161. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advimage/css/advimage.css
  162. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advimage/editor_plugin.js
  163. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advimage/editor_plugin_src.js
  164. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advimage/image.htm
  165. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advimage/img/sample.gif
  166. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advimage/js/image.js
  167. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advimage/langs/en_dlg.js
  168. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlink/css/advlink.css
  169. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlink/editor_plugin.js
  170. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlink/editor_plugin_src.js
  171. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlink/js/advlink.js
  172. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlink/langs/en_dlg.js
  173. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlink/link.htm
  174. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlist/editor_plugin.js
  175. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/advlist/editor_plugin_src.js
  176. +1 −0  lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin.js
  177. +180 −0 lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin_src.js
  178. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/autoresize/editor_plugin.js
  179. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/autoresize/editor_plugin_src.js
  180. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/autosave/editor_plugin.js
  181. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/autosave/editor_plugin_src.js
  182. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/autosave/langs/en.js
  183. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/bbcode/editor_plugin.js
  184. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/bbcode/editor_plugin_src.js
  185. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/contextmenu/editor_plugin.js
  186. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/contextmenu/editor_plugin_src.js
  187. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/directionality/editor_plugin.js
  188. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/directionality/editor_plugin_src.js
  189. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/dragmath/dragmath.php
  190. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/dragmath/editor_plugin.js
  191. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/dragmath/editor_plugin_src.js
  192. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/dragmath/img/dragmath.gif
  193. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/dragmath/js/dragmath.js
  194. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/dragmath/langs/en_dlg.js
  195. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/editor_plugin.js
  196. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/editor_plugin_src.js
  197. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/emotions.htm
  198. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-cool.gif
  199. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-cry.gif
  200. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-embarassed.gif
  201. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-foot-in-mouth.gif
  202. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-frown.gif
  203. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-innocent.gif
  204. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-kiss.gif
  205. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-laughing.gif
  206. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-money-mouth.gif
  207. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-sealed.gif
  208. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-smile.gif
  209. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-surprised.gif
  210. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-tongue-out.gif
  211. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-undecided.gif
  212. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-wink.gif
  213. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/img/smiley-yell.gif
  214. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/js/emotions.js
  215. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/emotions/langs/en_dlg.js
  216. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example/dialog.htm
  217. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example/editor_plugin.js
  218. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example/editor_plugin_src.js
  219. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example/img/example.gif
  220. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example/js/dialog.js
  221. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example/langs/en.js
  222. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example/langs/en_dlg.js
  223. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example_dependency/editor_plugin.js
  224. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/example_dependency/editor_plugin_src.js
  225. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullpage/css/fullpage.css
  226. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullpage/editor_plugin.js
  227. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullpage/editor_plugin_src.js
  228. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullpage/fullpage.htm
  229. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullpage/js/fullpage.js
  230. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullpage/langs/en_dlg.js
  231. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullscreen/editor_plugin.js
  232. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullscreen/editor_plugin_src.js
  233. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/fullscreen/fullscreen.htm
  234. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/iespell/editor_plugin.js
  235. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/iespell/editor_plugin_src.js
  236. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/editor_plugin.js
  237. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/editor_plugin_src.js
  238. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/img/alert.gif
  239. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/img/button.gif
  240. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif
  241. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif
  242. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/img/corners.gif
  243. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif
  244. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif
  245. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/skins/clearlooks2/window.css
  246. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/inlinepopups/template.htm
  247. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/insertdatetime/editor_plugin.js
  248. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/insertdatetime/editor_plugin_src.js
  249. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/layer/editor_plugin.js
  250. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/layer/editor_plugin_src.js
  251. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/legacyoutput/editor_plugin.js
  252. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/legacyoutput/editor_plugin_src.js
  253. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/lists/editor_plugin.js
  254. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/lists/editor_plugin_src.js
  255. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/media/css/media.css
  256. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/media/editor_plugin.js
  257. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/media/editor_plugin_src.js
  258. 0  lib/editor/tinymce/tiny_mce/{3.5/plugins/preview/jscripts → 3.5.1.1/plugins/media/js}/embed.js
  259. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/media/js/media.js
  260. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/media/langs/en_dlg.js
  261. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/media/media.htm
  262. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/media/moxieplayer.swf
  263. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodleemoticon/dialog.php
  264. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodleemoticon/editor_plugin.js
  265. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodleemoticon/editor_plugin_src.js
  266. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodleemoticon/img/moodleemoticon.gif
  267. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodleemoticon/js/dialog.js
  268. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlemedia/css/media.css
  269. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlemedia/editor_plugin.js
  270. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlemedia/editor_plugin_src.js
  271. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlemedia/img/icon.gif
  272. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlemedia/js/media.js
  273. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlemedia/moodlemedia.htm
  274. +62 −0 lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/preview.php
  275. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlenolink/editor_plugin.js
  276. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlenolink/editor_plugin_src.js
  277. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlenolink/img/ed_nolink.gif
  278. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/moodlenolink/langs/en.js
  279. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/nonbreaking/editor_plugin.js
  280. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/nonbreaking/editor_plugin_src.js
  281. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/noneditable/editor_plugin.js
  282. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/noneditable/editor_plugin_src.js
  283. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/pagebreak/editor_plugin.js
  284. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/pagebreak/editor_plugin_src.js
  285. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/paste/editor_plugin.js
  286. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/paste/editor_plugin_src.js
  287. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/paste/js/pastetext.js
  288. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/paste/js/pasteword.js
  289. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/paste/langs/en_dlg.js
  290. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/paste/pastetext.htm
  291. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/paste/pasteword.htm
  292. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/preview/editor_plugin.js
  293. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/preview/editor_plugin_src.js
  294. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/preview/example.html
  295. 0  lib/editor/tinymce/tiny_mce/{3.5/plugins/media/js → 3.5.1.1/plugins/preview/jscripts}/embed.js
  296. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/preview/preview.html
  297. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/print/editor_plugin.js
  298. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/print/editor_plugin_src.js
  299. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/save/editor_plugin.js
  300. 0  lib/editor/tinymce/tiny_mce/{3.5 → 3.5.1.1}/plugins/save/editor_plugin_src.js
Sorry, we could not display the entire diff because too many files (1,379) changed.
7 admin/cli/install.php
View
@@ -425,7 +425,8 @@
exit(1);
}
} else {
- cli_error(get_string('maturitycorewarning', 'admin'));
+ cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
+ cli_error(get_string('maturityallowunstable', 'admin'));
}
}
}
@@ -677,7 +678,9 @@
// Test plugin dependencies.
require_once($CFG->libdir . '/pluginlib.php');
-if (!plugin_manager::instance()->all_plugins_ok($version)) {
+$failed = array();
+if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
+ cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
4 admin/cli/install_database.php
View
@@ -161,7 +161,9 @@
// Test plugin dependencies.
require_once($CFG->libdir . '/pluginlib.php');
-if (!plugin_manager::instance()->all_plugins_ok($version)) {
+$failed = array();
+if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
+ cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
75 admin/cli/mysql_engine.php
View
@@ -34,8 +34,8 @@
}
// now get cli options
-list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false),
- array('h'=>'help', 'l'=>'list'));
+list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false, 'available'=>false),
+ array('h'=>'help', 'l'=>'list', 'a'=>'available'));
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
@@ -52,6 +52,7 @@
Options:
--engine=ENGINE Convert MySQL tables to different engine
-l, --list Show table information
+-a, --available Show list of available engines
-h, --help Print out this help
Example:
@@ -59,7 +60,11 @@
";
if (!empty($options['engine'])) {
+ $engines = mysql_get_engines();
$engine = clean_param($options['engine'], PARAM_ALPHA);
+ if (!isset($engines[strtoupper($engine)])) {
+ cli_error("Error: engine '$engine' is not available on this server!");
+ }
echo "Converting tables to '$engine' for $CFG->wwwroot:\n";
$prefix = $DB->get_prefix();
@@ -68,9 +73,11 @@
$rs = $DB->get_recordset_sql($sql);
$converted = 0;
$skipped = 0;
+ $errors = 0;
foreach ($rs as $table) {
- if ($table->engine === $engine) {
- echo str_pad($table->name, 40). " - NO CONVERSION NEEDED\n";
+ if (strtoupper($table->engine) === strtoupper($engine)) {
+ $newengine = mysql_get_table_engine($table->name);
+ echo str_pad($table->name, 40). " - NO CONVERSION NEEDED ($newengine)\n";
$skipped++;
continue;
}
@@ -78,16 +85,22 @@
try {
$DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
+ $newengine = mysql_get_table_engine($table->name);
+ if (strtoupper($newengine) !== strtoupper($engine)) {
+ echo "ERROR ($newengine)\n";
+ $errors++;
+ continue;
+ }
+ echo "DONE ($newengine)\n";
+ $converted++;
} catch (moodle_exception $e) {
echo $e->getMessage()."\n";
- $skipped++;
+ $errors++;
continue;
}
- echo "DONE\n";
- $converted++;
}
$rs->close();
- echo "Converted: $converted, skipped: $skipped\n";
+ echo "Converted: $converted, skipped: $skipped, errors: $errors\n";
exit(0); // success
} else if (!empty($options['list'])) {
@@ -115,7 +128,53 @@
}
exit(0); // success
+} else if (!empty($options['available'])) {
+ echo "List of available MySQL engines for $CFG->wwwroot:\n";
+ $engines = mysql_get_engines();
+ foreach ($engines as $engine) {
+ echo " $engine\n";
+ }
+ die;
+
} else {
echo $help;
die;
}
+
+
+
+// ========== Some functions ==============
+
+function mysql_get_engines() {
+ global $DB;
+
+ $sql = "SHOW Engines";
+ $rs = $DB->get_recordset_sql($sql);
+ $engines = array();
+ foreach ($rs as $engine) {
+ if (strtoupper($engine->support) !== 'YES' and strtoupper($engine->support) !== 'DEFAULT') {
+ continue;
+ }
+ $engines[strtoupper($engine->engine)] = $engine->engine;
+ if (strtoupper($engine->support) === 'DEFAULT') {
+ $engines[strtoupper($engine->engine)] .= ' (default)';
+ }
+ }
+ $rs->close();
+
+ return $engines;
+}
+
+function mysql_get_table_engine($tablename) {
+ global $DB;
+
+ $engine = null;
+ $sql = "SHOW TABLE STATUS WHERE Name = '$tablename'"; // no special chars expected here
+ $rs = $DB->get_recordset_sql($sql);
+ if ($rs->valid()) {
+ $record = $rs->current();
+ $engine = $record->engine;
+ }
+ $rs->close();
+ return $engine;
+}
7 admin/cli/upgrade.php
View
@@ -109,7 +109,9 @@
}
// Test plugin dependencies.
-if (!plugin_manager::instance()->all_plugins_ok($version)) {
+$failed = array();
+if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
+ cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
cli_error(get_string('pluginschecktodo', 'admin'));
}
@@ -132,7 +134,8 @@
echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL;
cli_separator();
} else {
- cli_error(get_string('maturitycorewarning', 'admin', $maturitylevel));
+ cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel));
+ cli_error(get_string('maturityallowunstable', 'admin'));
}
}
}
33 admin/index.php
View
@@ -152,6 +152,20 @@
die();
}
+ // check plugin dependencies
+ $failed = array();
+ if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
+ $PAGE->navbar->add(get_string('pluginscheck', 'admin'));
+ $PAGE->set_title($strinstallation);
+ $PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
+
+ $output = $PAGE->get_renderer('core', 'admin');
+ $url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang));
+ echo $output->unsatisfied_dependencies_page($version, $failed, $url);
+ die();
+ }
+ unset($failed);
+
//TODO: add a page with list of non-standard plugins here
$strdatabasesetup = get_string('databasesetup');
@@ -238,6 +252,15 @@
$reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1));
+ // check plugin dependencies first
+ $failed = array();
+ if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
+ $output = $PAGE->get_renderer('core', 'admin');
+ echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl);
+ die();
+ }
+ unset($failed);
+
if ($fetchupdates) {
// no sesskey support guaranteed here
if (empty($CFG->disableupdatenotifications)) {
@@ -290,6 +313,16 @@
}
$output = $PAGE->get_renderer('core', 'admin');
+
+ // check plugin dependencies first
+ $failed = array();
+ if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) {
+ echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
+ die();
+ }
+ unset($failed);
+
+ // dependencies check passed, let's rock!
echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(),
$version, $showallplugins,
new moodle_url($PAGE->url),
38 admin/oauth2callback.php
View
@@ -0,0 +1,38 @@
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * An oauth2 redirection endpoint which can be used for an application:
+ * http://tools.ietf.org/html/draft-ietf-oauth-v2-26#section-3.1.2
+ *
+ * This is used because some oauth servers will not allow a redirect urls
+ * with get params (like repository callback) and that needs to be called
+ * using the state param.
+ *
+ * @package core
+ * @copyright 2012 Dan Poltawski
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(dirname(dirname(__FILE__)).'/config.php');
+
+// The authorization code generated by the authorization server.
+$code = required_param('code', PARAM_RAW);
+// The state parameter we've given (used in moodle as a redirect url).
+$state = required_param('state', PARAM_URL);
+
+redirect(new moodle_url($state, array('code' => $code)));
79 admin/renderer.php
View
@@ -108,6 +108,29 @@ public function install_environment_page($maturity, $envstatus, $environment_res
}
/**
+ * Displays the list of plugins with unsatisfied dependencies
+ *
+ * @param double|string|int $version Moodle on-disk version
+ * @param array $failed list of plugins with unsatisfied dependecies
+ * @param moodle_url $reloadurl URL of the page to recheck the dependencies
+ * @return string HTML
+ */
+ public function unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl) {
+ $output = '';
+
+ $output .= $this->header();
+ $output .= $this->heading(get_string('pluginscheck', 'admin'));
+ $output .= $this->warning(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
+ $output .= $this->plugins_check_table(plugin_manager::instance(), $version, array('xdep' => true));
+ $output .= $this->warning(get_string('pluginschecktodo', 'admin'));
+ $output .= $this->continue_button($reloadurl);
+
+ $output .= $this->footer();
+
+ return $output;
+ }
+
+ /**
* Display the 'You are about to upgrade Moodle' page. The first page
* during upgrade.
* @param string $strnewversion
@@ -197,19 +220,15 @@ public function upgrade_plugin_check_page(plugin_manager $pluginman, available_u
$output .= $this->box_end();
$output .= $this->upgrade_reload($reloadurl);
- if ($pluginman->all_plugins_ok($version)) {
- if ($pluginman->some_plugins_updatable()) {
- $output .= $this->container_start('upgradepluginsinfo');
- $output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin'));
- $output .= $this->container_end();
- }
- $button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
- $button->class = 'continuebutton';
- $output .= $this->render($button);
- } else {
- $output .= $this->box(get_string('pluginschecktodo', 'admin'), 'environmentbox errorbox');
+ if ($pluginman->some_plugins_updatable()) {
+ $output .= $this->container_start('upgradepluginsinfo');
+ $output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin'));
+ $output .= $this->container_end();
}
+ $button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get');
+ $button->class = 'continuebutton';
+ $output .= $this->render($button);
$output .= $this->footer();
return $output;
@@ -563,13 +582,14 @@ function upgrade_reload($url) {
* This default implementation renders all plugins into one big table. The rendering
* options support:
* (bool)full = false: whether to display up-to-date plugins, too
+ * (bool)xdep = false: display the plugins with unsatisified dependecies only
*
* @param plugin_manager $pluginman provides information about the plugins.
* @param int $version the version of the Moodle code from version.php.
* @param array $options rendering options
* @return string HTML code
*/
- public function plugins_check_table(plugin_manager $pluginman, $version, array $options = null) {
+ public function plugins_check_table(plugin_manager $pluginman, $version, array $options = array()) {
global $CFG;
$plugininfo = $pluginman->get_plugins();
@@ -578,11 +598,8 @@ public function plugins_check_table(plugin_manager $pluginman, $version, array $
return '';
}
- if (empty($options)) {
- $options = array(
- 'full' => false,
- );
- }
+ $options['full'] = isset($options['full']) ? (bool)$options['full'] : false;
+ $options['xdep'] = isset($options['xdep']) ? (bool)$options['xdep'] : false;
$table = new html_table();
$table->id = 'plugins-check';
@@ -666,16 +683,28 @@ public function plugins_check_table(plugin_manager $pluginman, $version, array $
$statusisboring = in_array($statuscode, array(
plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE));
- $dependenciesok = $pluginman->are_dependencies_satisfied(
- $plugin->get_other_required_plugins());
- if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) {
+
+ $coredependency = $plugin->is_core_dependency_satisfied($version);
+ $otherpluginsdependencies = $pluginman->are_dependencies_satisfied($plugin->get_other_required_plugins());
+ $dependenciesok = $coredependency && $otherpluginsdependencies;
+
+ if ($options['xdep']) {
+ // we want to see only plugins with failed dependencies
+ if ($dependenciesok) {
+ continue;
+ }
+
+ } else if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) {
+ // no change is going to happen to the plugin - display it only
+ // if the user wants to see the full list
if (empty($options['full'])) {
continue;
}
- } else {
- $numofhighlighted[$type]++;
}
+ // ok, the plugin should be displayed
+ $numofhighlighted[$type]++;
+
$row->cells = array($displayname, $rootdir, $source,
$versiondb, $versiondisk, $requires, $status);
$plugintyperows[] = $row;
@@ -691,7 +720,11 @@ public function plugins_check_table(plugin_manager $pluginman, $version, array $
$sumofhighlighted = array_sum($numofhighlighted);
- if ($sumofhighlighted == 0) {
+ if ($options['xdep']) {
+ // we do not want to display no heading and links in this mode
+ $out = '';
+
+ } else if ($sumofhighlighted == 0) {
$out = $this->output->container_start('nonehighlighted', 'plugins-check-info');
$out .= $this->output->heading(get_string('nonehighlighted', 'core_plugin'));
if (empty($options['full'])) {
67 admin/repository.php
View
@@ -1,12 +1,27 @@
<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->libdir . '/adminlib.php');
-$repository = optional_param('repos', '', PARAM_FORMAT);
-$action = optional_param('action', '', PARAM_ALPHA);
-$sure = optional_param('sure', '', PARAM_ALPHA);
+$repository = optional_param('repos', '', PARAM_ALPHANUMEXT);
+$action = optional_param('action', '', PARAM_ACTION);
+$sure = optional_param('sure', '', PARAM_ALPHA);
+$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
$display = true; // fall through to normal display
@@ -42,6 +57,10 @@
$return = true;
+if (!empty($action)) {
+ require_sesskey();
+}
+
/**
* Helper function that generates a moodle_url object
* relevant to the repository
@@ -152,10 +171,10 @@ function repository_action_url($repository) {
// Display instances list and creation form
if ($action == 'edit') {
- $instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
- if (!empty($instanceoptionnames)) {
- repository::display_instances_list(get_context_instance(CONTEXT_SYSTEM), $repository);
- }
+ $instanceoptionnames = repository::static_function($repository, 'get_instance_option_names');
+ if (!empty($instanceoptionnames)) {
+ repository::display_instances_list(context_system::instance(), $repository);
+ }
}
}
} else if ($action == 'show') {
@@ -185,7 +204,8 @@ function repository_action_url($repository) {
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', '', $baseurl);
}
- if ($repositorytype->delete()) {
+
+ if ($repositorytype->delete($downloadcontents)) {
redirect($baseurl);
} else {
print_error('instancenotdeleted', 'repository', $baseurl);
@@ -193,7 +213,34 @@ function repository_action_url($repository) {
exit;
} else {
echo $OUTPUT->header();
- echo $OUTPUT->confirm(get_string('confirmremove', 'repository', $repositorytype->get_readablename()), $sesskeyurl . '&action=delete&repos=' . $repository . '&sure=yes', $baseurl);
+
+ $message = get_string('confirmremove', 'repository', $repositorytype->get_readablename());
+
+ $output = $OUTPUT->box_start('generalbox', 'notice');
+ $output .= html_writer::tag('p', $message);
+
+ $removeurl = new moodle_url($sesskeyurl);
+ $removeurl->params(array(
+ 'action' =>'delete',
+ 'repos' => $repository,
+ 'sure' => 'yes',
+ ));
+
+ $removeanddownloadurl = new moodle_url($sesskeyurl);
+ $removeanddownloadurl->params(array(
+ 'action' =>'delete',
+ 'repos'=> $repository,
+ 'sure' => 'yes',
+ 'downloadcontents' => 1,
+ ));
+
+ $output .= $OUTPUT->single_button($removeurl, get_string('continueuninstall', 'repository'));
+ $output .= $OUTPUT->single_button($removeanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
+ $output .= $OUTPUT->single_button($baseurl, get_string('cancel'));
+ $output .= $OUTPUT->box_end();
+
+ echo $output;
+
$return = false;
}
} else if ($action == 'moveup') {
@@ -255,7 +302,7 @@ function repository_action_url($repository) {
// Calculate number of instances in order to display them for the Moodle administrator
if (!empty($instanceoptionnames)) {
$params = array();
- $params['context'] = array(get_system_context());
+ $params['context'] = array(context_system::instance());
$params['onlyvisible'] = false;
$params['type'] = $typename;
$admininstancenumber = count(repository::static_function($typename, 'get_instances', $params));
88 admin/repositoryinstance.php
View
@@ -1,18 +1,35 @@
<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
require_once(dirname(dirname(__FILE__)) . '/config.php');
require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->libdir . '/adminlib.php');
+require_sesskey();
+
// id of repository
$edit = optional_param('edit', 0, PARAM_INT);
-$new = optional_param('new', '', PARAM_FORMAT);
+$new = optional_param('new', '', PARAM_PLUGIN);
$hide = optional_param('hide', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
$sure = optional_param('sure', '', PARAM_ALPHA);
$type = optional_param('type', '', PARAM_PLUGIN);
+$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL);
-$context = get_context_instance(CONTEXT_SYSTEM);
+$context = context_system::instance();
$pagename = 'repositorycontroller';
@@ -24,16 +41,20 @@
$pagename = 'repositoryinstancenew';
}
-admin_externalpage_setup($pagename);
-require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
+admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstances.php'));
+require_capability('moodle/site:config', $context);
+
+$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey()));
+
+$parenturl = new moodle_url("/$CFG->admin/repository.php", array(
+ 'sesskey'=>sesskey(),
+ 'action'=>'edit',
+));
-$sesskeyurl = "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?sesskey=" . sesskey();
-$baseurl = "$CFG->wwwroot/$CFG->admin/repository.php?session=". sesskey() .'&action=edit&repos=';
if ($new) {
- $baseurl .= $new;
-}
-else {
- $baseurl .= $type;
+ $parenturl->param('repos', $new);
+} else {
+ $parenturl->param('repos', $type);
}
$return = true;
@@ -48,7 +69,7 @@
$typeid = $instance->options['typeid'];
} else {
$plugin = $new;
- $typeid = $new;
+ $typeid = null;
$instance = null;
}
@@ -57,12 +78,9 @@
// end setup, begin output
if ($mform->is_cancelled()){
- redirect($baseurl);
+ redirect($parenturl);
exit;
} else if ($fromform = $mform->get_data()){
- if (!confirm_sesskey()) {
- print_error('confirmsesskeybad', '', $baseurl);
- }
if ($edit) {
$settings = array();
$settings['name'] = $fromform->name;
@@ -77,13 +95,13 @@
}
$success = $instance->set_option($settings);
} else {
- $success = repository::static_function($plugin, 'create', $plugin, 0, get_system_context(), $fromform);
+ $success = repository::static_function($plugin, 'create', $plugin, 0, $context, $fromform);
$data = data_submitted();
}
if ($success) {
- redirect($baseurl);
+ redirect($parenturl);
} else {
- print_error('instancenotsaved', 'repository', $baseurl);
+ print_error('instancenotsaved', 'repository', $parenturl);
}
exit;
} else {
@@ -95,9 +113,6 @@
$return = false;
}
} else if (!empty($hide)) {
- if (!confirm_sesskey()) {
- print_error('confirmsesskeybad', '', $baseurl);
- }
$instance = repository::get_type_by_typename($hide);
$instance->hide();
$return = true;
@@ -108,25 +123,38 @@
throw new repository_exception('readonlyinstance', 'repository');
}
if ($sure) {
- if (!confirm_sesskey()) {
- print_error('confirmsesskeybad', '', $baseurl);
- }
- if ($instance->delete()) {
+ if ($instance->delete($downloadcontents)) {
$deletedstr = get_string('instancedeleted', 'repository');
- redirect($baseurl, $deletedstr, 3);
+ redirect($parenturl, $deletedstr, 3);
} else {
- print_error('instancenotdeleted', 'repository', $baseurl);
+ print_error('instancenotdeleted', 'repository', $parenturl);
}
exit;
}
echo $OUTPUT->header();
- echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), "$sesskeyurl&type=$type'&delete=$delete'&sure=yes", "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey());
+ echo $OUTPUT->box_start('generalbox', 'notice');
+ $continueurl = new moodle_url($baseurl, array(
+ 'type' => $type,
+ 'delete' => $delete,
+ 'sure' => 'yes',
+ ));
+ $continueanddownloadurl = new moodle_url($continueurl, array(
+ 'downloadcontents' => 1
+ ));
+ $message = get_string('confirmdelete', 'repository', $instance->name);
+ echo html_writer::tag('p', $message);
+
+ echo $OUTPUT->single_button($continueurl, get_string('continueuninstall', 'repository'));
+ echo $OUTPUT->single_button($continueanddownloadurl, get_string('continueuninstallanddownload', 'repository'));
+ echo $OUTPUT->single_button($parenturl, get_string('cancel'));
+
+ echo $OUTPUT->box_end();
+
$return = false;
}
if (!empty($return)) {
-
- redirect($baseurl);
+ redirect($parenturl);
}
echo $OUTPUT->footer();
2  admin/settings/development.php
View
@@ -13,6 +13,8 @@
$temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0));
+ $temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0));
+
$ADMIN->add('experimental', $temp);
// "debugging" settingpage
14 admin/settings/plugins.php
View
@@ -330,12 +330,12 @@
$typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names');
$instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names');
if (!empty($typeoptionnames) || !empty($instanceoptionnames)) {
- $ADMIN->add('repositorysettings',
- new admin_externalpage('repositorysettings'.$repositorytype->get_typename(),
- $repositorytype->get_readablename(),
- $url . '?action=edit&repos=' . $repositorytype->get_typename()),
- 'moodle/site:config');
- }
+
+ $params = array('action'=>'edit', 'sesskey'=>sesskey(), 'repos'=>$repositorytype->get_typename());
+ $settingsurl = new moodle_url("/$CFG->admin/repository.php", $params);
+ $repositoryexternalpage = new admin_externalpage('repositorysettings'.$repositorytype->get_typename(), $repositorytype->get_readablename(), $settingsurl);
+ $ADMIN->add('repositorysettings', $repositoryexternalpage);
+ }
}
}
@@ -370,7 +370,7 @@
// to set the page layout on all admin pages.
// $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
$url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
- $wsdoclink = html_writer::tag('a', new lang_string('supplyinfo'),array('href'=>$url));
+ $wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url));
$temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation',
'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
$ADMIN->add('webservicesettings', $temp);
4 admin/timezone.php
View
@@ -9,6 +9,9 @@
$zone = clean_param($zone, PARAM_PATH);
}
+ $PAGE->set_url('/admin/timezone.php');
+ $PAGE->set_context(context_system::instance());
+
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
@@ -18,7 +21,6 @@
$strusers = get_string("users");
$strall = get_string("all");
- $PAGE->set_url('/admin/timezone.php');
$PAGE->set_title($strtimezone);
$PAGE->set_heading($strtimezone);
$PAGE->navbar->add($strtimezone);
35 admin/tool/assignmentupgrade/batchupgrade.php
View
@@ -22,16 +22,20 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+define('NO_OUTPUT_BUFFERING', true);
+
require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once(dirname(__FILE__) . '/upgradableassignmentstable.php');
-require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php');
require_once($CFG->libdir . '/adminlib.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentstable.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
require_sesskey();
// admin_externalpage_setup calls require_login and checks moodle/site:config
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('batchupgrade'));
+
+$PAGE->set_pagelayout('maintenance');
$PAGE->navbar->add(get_string('batchupgrade', 'tool_assignmentupgrade'));
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
@@ -41,7 +45,26 @@
print_error('invalidrequest');
die();
}
-$result = tool_assignmentupgrade_upgrade_multiple_assignments(optional_param('upgradeall', 0, PARAM_BOOL),
- explode(',', optional_param('selected', '', PARAM_TEXT)));
+raise_memory_limit(MEMORY_EXTRA);
+session_get_instance()->write_close(); // release session
+
+echo $renderer->header();
+echo $renderer->heading(get_string('batchupgrade', 'tool_assignmentupgrade'));
+
+$current = 0;
+if (optional_param('upgradeall', false, PARAM_BOOL)) {
+ $assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids();
+} else {
+ $assignmentids = explode(',', optional_param('selected', '', PARAM_TEXT));
+}
+$total = count($assignmentids);
+
+foreach ($assignmentids as $assignmentid) {
+ list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
+ $current += 1;
+ echo $renderer->heading(get_string('upgradeprogress', 'tool_assignmentupgrade', array('current'=>$current, 'total'=>$total)), 3);
+ echo $renderer->convert_assignment_result($summary, $success, $log);
+}
-echo $renderer->convert_multiple_assignments_result($result);
+echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
+echo $renderer->footer();
4 admin/tool/assignmentupgrade/index.php
View
@@ -34,8 +34,8 @@
*/
require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
require_once($CFG->libdir . '/adminlib.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
// admin_externalpage_setup calls require_login and checks moodle/site:config
admin_externalpage_setup('assignmentupgrade');
@@ -47,4 +47,4 @@
$header = get_string('pluginname', 'tool_assignmentupgrade');
$actions[] = tool_assignmentupgrade_action::make('listnotupgraded');
-echo $renderer->index_page($header, $actions);
+echo $renderer->index_page($header, $actions);
3  admin/tool/assignmentupgrade/lang/en/tool_assignmentupgrade.php
View
@@ -26,6 +26,7 @@
$string['areyousuremessage'] = 'Are you sure you want to upgrade the assignment "{$a->name}"?';
$string['assignmentid'] = 'Assignment ID';
$string['assignmentnotfound'] = 'Assignment could not be found (id={$a})';
+$string['assignmentsperpage'] = 'Assignments per page';
$string['assignmenttype'] = 'Assignment type';
$string['backtoindex'] = 'Back to index';
$string['batchoperations'] = 'Batch operations';
@@ -43,6 +44,7 @@
$string['select'] = 'Select';
$string['submissions'] = 'Submissions';
$string['supported'] = 'Upgrade';
+$string['updatetable'] = 'Update table';
$string['unknown'] = 'Unknown';
$string['upgradeassignmentsummary'] = 'Upgrade assignment: {$a->name} (Course: {$a->shortname})';
$string['upgradeassignmentsuccess'] = 'Result: Upgrade successful';
@@ -52,5 +54,6 @@
$string['upgradeselectedcount'] = 'Upgrade {$a} selected assignments?';
$string['upgradeall'] = 'Upgrade all assignments';
$string['upgradeallconfirm'] = 'Upgrade all assignments?';
+$string['upgradeprogress'] = 'Upgrade assignment {$a->current} of {$a->total}';
$string['upgradesingle'] = 'Upgrade single assignment';
$string['viewcourse'] = 'View the course with the converted assignment';
21 admin/tool/assignmentupgrade/listnotupgraded.php
View
@@ -23,10 +23,11 @@
*/
require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
-require_once(dirname(__FILE__) . '/upgradableassignmentstable.php');
-require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php');
require_once($CFG->libdir . '/adminlib.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentstable.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentsbatchform.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/paginationform.php');
// admin_externalpage_setup calls require_login and checks moodle/site:config
admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('listnotupgraded'));
@@ -34,16 +35,26 @@
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
-$perpage = get_user_preferences('tool_assignmentupgrade_perpage', 5);
+$perpage = optional_param('perpage', 0, PARAM_INT);
+if (!$perpage) {
+ $perpage = get_user_preferences('tool_assignmentupgrade_perpage', 100);
+} else {
+ set_user_preference('tool_assignmentupgrade_perpage', $perpage);
+}
$assignments = new tool_assignmentupgrade_assignments_table($perpage);
$batchform = new tool_assignmentupgrade_batchoperations_form();
$data = $batchform->get_data();
+
if ($data && $data->selectedassignments != '' || $data && isset($data->upgradeall)) {
require_sesskey();
echo $renderer->confirm_batch_operation_page($data);
} else {
- echo $renderer->assignment_list_page($assignments, $batchform);
+ $paginationform = new tool_assignmentupgrade_pagination_form();
+ $pagedata = new stdClass();
+ $pagedata->perpage = $perpage;
+ $paginationform->set_data($pagedata);
+ echo $renderer->assignment_list_page($assignments, $batchform, $paginationform);
}
61 admin/tool/assignmentupgrade/locallib.php
View
@@ -170,54 +170,33 @@ function tool_assignmentupgrade_load_all_upgradable_assignmentids() {
/**
- * Convert a list of assignments from the old format to the new one.
- * @param bool $upgradeall - Upgrade all possible assignments
- * @param array $assignmentids An array of assignment ids to upgrade
- * @return array of $entry['assignmentsummary' => (result from tool_assignmentupgrade_get_assignment)
- * $entry['success'] => boolean
- * $entry['log'] => string - upgrade log
+ * Upgrade a single assignment. This is used by both upgrade single and upgrade batch
+ *
+ * @param int $assignmentid - The assignment id to upgrade
+ * @return array(string, boolean, string) -
+ * The array contains
+ * - the assignment summary (returned by tool_assignmentupgrade_get_assignment)
+ * - success
+ * - the upgrade log
*/
-function tool_assignmentupgrade_upgrade_multiple_assignments($upgradeall, $assignmentids) {
+function tool_assignmentupgrade_upgrade_assignment($assignmentid) {
global $CFG;
- require_once($CFG->dirroot . '/mod/assign/locallib.php');
require_once($CFG->dirroot . '/mod/assign/upgradelib.php');
- $upgrades = array();
-
- if ($upgradeall) {
- $assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids();
- }
$assignment_upgrader = new assign_upgrade_manager();
- foreach ($assignmentids as $assignmentid) {
- $info = tool_assignmentupgrade_get_assignment($assignmentid);
- if ($info) {
- $log = '';
- $success = $assignment_upgrader->upgrade_assignment($assignmentid, $log);
- } else {
- $success = false;
- $log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid);
- $info = new stdClass();
- $info->name = get_string('unknown', 'tool_assignmentupgrade');
- $info->shortname = get_string('unknown', 'tool_assignmentupgrade');
- }
-
- $upgrades[] = array('assignmentsummary'=>$info, 'success'=>$success, 'log'=>$log);
+ $info = tool_assignmentupgrade_get_assignment($assignmentid);
+ if ($info) {
+ $log = '';
+ $success = $assignment_upgrader->upgrade_assignment($assignmentid, $log);
+ } else {
+ $success = false;
+ $log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid);
+ $info = new stdClass();
+ $info->name = get_string('unknown', 'tool_assignmentupgrade');
+ $info->shortname = get_string('unknown', 'tool_assignmentupgrade');
}
- return $upgrades;
-}
-/**
- * Convert a single assignment from the old format to the new one.
- * @param stdClass $assignmentinfo An object containing information about this class
- * @param string $log This gets appended to with the details of the conversion process
- * @return boolean This is the overall result (true/false)
- */
-function tool_assignmentupgrade_upgrade_assignment($assignmentinfo, &$log) {
- global $CFG;
- require_once($CFG->dirroot . '/mod/assign/locallib.php');
- require_once($CFG->dirroot . '/mod/assign/upgradelib.php');
- $assignment_upgrader = new assign_upgrade_manager();
- return $assignment_upgrader->upgrade_assignment($assignmentinfo->id, $log);
+ return array($info, $success, $log);
}
/**
5 admin/tool/assignmentupgrade/module.js
View
@@ -61,6 +61,11 @@ M.tool_assignmentupgrade = {
}
});
+ var perpage = Y.one('#id_perpage');
+ perpage.on('change', function(e) {
+ window.onbeforeunload = null;
+ Y.one('.tool_assignmentupgrade_paginationform form').submit();
+ });
}
}
59 admin/tool/assignmentupgrade/paginationform.php
View
@@ -0,0 +1,59 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file contains the forms to create and edit an instance of this module
+ *
+ * @package tool_assignmentupgrade
+ * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
+
+
+/** Include formslib.php */
+require_once ($CFG->libdir.'/formslib.php');
+
+/**
+ * Assignment upgrade table display options
+ *
+ * @package tool_assignmentupgrade
+ * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class tool_assignmentupgrade_pagination_form extends moodleform {
+ /**
+ * Define this form - called from the parent constructor
+ */
+ function definition() {
+ $mform = $this->_form;
+ $instance = $this->_customdata;
+
+ $mform->addElement('header', 'general', get_string('assignmentsperpage', 'tool_assignmentupgrade'));
+ // visible elements
+ $options = array(10=>'10', 20=>'20', 50=>'50', 100=>'100');
+ $mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options);
+
+ // hidden params
+ $mform->addElement('hidden', 'action', 'saveoptions');
+ $mform->setType('action', PARAM_ALPHA);
+
+ // buttons
+ $this->add_action_buttons(false, get_string('updatetable', 'tool_assignmentupgrade'));
+ }
+}
+
58 admin/tool/assignmentupgrade/renderer.php
View
@@ -112,9 +112,10 @@ public function render_tool_assignmentupgrade_batchoperationconfirm(tool_assignm
* Render the list of assignments that still need to be upgraded page.
* @param tool_assignmentupgrade_assignments_table $assignments of data about assignments.
* @param tool_assignmentupgrade_batchoperations_form $batchform Submitted form with list of assignments to upgrade
+ * @param tool_assignmentupgrade_pagination_form $paginationform Form which contains the preferences for paginating the table
* @return string html to output.
*/
- public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform) {
+ public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform, tool_assignmentupgrade_pagination_form $paginationform) {
$output = '';
$output .= $this->header();
$this->page->requires->js_init_call('M.tool_assignmentupgrade.init_upgrade_table', array());
@@ -126,6 +127,10 @@ public function assignment_list_page(tool_assignmentupgrade_assignments_table $a
$output .= $this->container_start('tool_assignmentupgrade_upgradetable');
+ $output .= $this->container_start('tool_assignmentupgrade_paginationform');
+ $output .= $this->moodleform($paginationform);
+ $output .= $this->container_end();
+
$output .= $this->flexible_table($assignments, $assignments->get_rows_per_page(), true);
$output .= $this->container_end();
@@ -142,43 +147,6 @@ public function assignment_list_page(tool_assignmentupgrade_assignments_table $a
/**
* Render the result of an assignment conversion
- * @param array $assignments - An array of arrays with keys $entry['assignmentsummary', 'success', 'log']
- * See convert_assignment_result for more description of these keys.
- * @return string html to output.
- */
- public function convert_multiple_assignments_result($assignments) {
- $output = '';
- $output .= $this->header();
- $output .= $this->heading(get_string('batchupgrade', 'tool_assignmentupgrade'));
-
- foreach ($assignments as $assignment) {
- $assignmentsummary = $assignment['assignmentsummary'];
- $success = $assignment['success'];
- $log = $assignment['log'];
-
- $output .= $this->heading(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary), 5);
- if ($success) {
- $output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade'));
-
- } else {
- $output .= $this->container(get_string('upgradeassignmentfailed', 'tool_assignmentupgrade', $assignment));
- }
- if (isset($assignmentsummary->courseid)) {
- $output .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade'));
- }
-
-
- }
-
- $output .= $this->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
-
-
- $output .= $this->footer();
- return $output;
- }
-
- /**
- * Render the result of an assignment conversion
* @param stdClass $assignmentsummary data about the assignment to upgrade.
* @param bool $success Set to true if the outcome of the conversion was a success
* @param string $log The log from the conversion
@@ -186,19 +154,17 @@ public function convert_multiple_assignments_result($assignments) {
*/
public function convert_assignment_result($assignmentsummary, $success, $log) {
$output = '';
- $output .= $this->header();
- $output .= $this->heading(get_string('conversioncomplete', 'tool_assignmentupgrade'));
+ $output .= $this->container_start('tool_assignmentupgrade_result');
+ $output .= $this->container(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary));
if (!$success) {
- $output .= get_string('conversionfailed', 'tool_assignmentupgrade', $log);
+ $output .= $this->container(get_string('conversionfailed', 'tool_assignmentupgrade', $log));
} else {
- $output .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade'));
+ $output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade'));
+ $output .= $this->container(html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade')));
}
+ $output .= $this->container_end();
- $output .= $this->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
-
-
- $output .= $this->footer();
return $output;
}
2  admin/tool/assignmentupgrade/styles.css
View
@@ -8,4 +8,4 @@
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.selectedrow td { background-color: #ffeecc; }
#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.unselectedrow td { background-color: white; }
-
+#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_paginationform .hidden { display: none; }
3  admin/tool/assignmentupgrade/upgradableassignmentstable.php
View
@@ -70,12 +70,11 @@ function __construct($perpage, $rowoffset=0) {
$from = '{assignment} a JOIN {course} c ON a.course = c.id ' .
' LEFT JOIN {assignment_submissions} s ON a.id = s.assignment';
-
$where = '1 = 1';
$where .= ' GROUP BY a.id, a.name, a.assignmenttype, c.shortname, c.id ';
$this->set_sql($fields, $from, $where, array());
- $this->set_count_sql('SELECT COUNT(*) FROM ' . $from, array());
+ $this->set_count_sql('SELECT COUNT(*) FROM {assignment} a JOIN {course} c ON a.course = c.id', array());
$columns = array();
$headers = array();
16 admin/tool/assignmentupgrade/upgradesingle.php
View
@@ -23,8 +23,8 @@
*/
require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
require_once($CFG->libdir . '/adminlib.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
require_sesskey();
@@ -36,13 +36,11 @@
$PAGE->navbar->add(get_string('upgradesingle', 'tool_assignmentupgrade'));
$renderer = $PAGE->get_renderer('tool_assignmentupgrade');
-$assignmentinfo = tool_assignmentupgrade_get_assignment($assignmentid);
-if (!$assignmentinfo) {
- print_error('invalidrequest');
- die();
-}
-
$log = '';
-$result = tool_assignmentupgrade_upgrade_assignment($assignmentinfo, $log);
+list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid);
-echo $renderer->convert_assignment_result($assignmentinfo, $result, $log);
+echo $renderer->header();
+echo $renderer->heading(get_string('conversioncomplete', 'tool_assignmentupgrade'));
+echo $renderer->convert_assignment_result($summary, $success, $log);
+echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded'));
+echo $renderer->footer();
2  admin/tool/assignmentupgrade/upgradesingleconfirm.php
View
@@ -23,8 +23,8 @@
*/
require_once(dirname(__FILE__) . '/../../../config.php');
-require_once(dirname(__FILE__) . '/locallib.php');
require_once($CFG->libdir . '/adminlib.php');
+require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php');
require_sesskey();
2  admin/tool/bloglevelupgrade/index.php
View
@@ -121,7 +121,7 @@ function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) {
$discussion->groupid = $groupid;
$message = '';
- $discussionid = forum_add_discussion($discussion, null, $message);
+ $discussionid = forum_add_discussion($discussion, null, $message, $blogentry->userid);
// Copy file attachment records
$fs = get_file_storage();
5 admin/tool/unittest/coveragefile.php
View
@@ -60,9 +60,8 @@
print_error('invalidarguments');
}
-// only serve some controlled extensions
-$allowedextensions = array('text/html', 'text/css', 'image/gif', 'application/x-javascript');
-if (!in_array(mimeinfo('type', $filepath), $allowedextensions)) {
+// only serve some controlled extensions/mimetypes
+if (!file_extension_in_typegroup($filepath, array('web_file', 'web_image'), true)) {
print_error('invalidarguments');
}
1  auth/shibboleth/index.php
View
@@ -30,6 +30,7 @@
/// If we can find the Shibboleth attribute, save it in session and return to main login page
if (!empty($_SERVER[$pluginconfig->user_attribute])) { // Shibboleth auto-login
+ $frm = new stdClass();
$frm->username = strtolower($_SERVER[$pluginconfig->user_attribute]);
$frm->password = substr(base64_encode($_SERVER[$pluginconfig->user_attribute]),0,8);
// The random password consists of the first 8 letters of the base 64 encoded user ID
2  backup/backupfilesedit_form.php
View
@@ -27,7 +27,7 @@ class backup_files_edit_form extends moodleform {
function definition() {
$mform =& $this->_form;
$contextid = $this->_customdata['contextid'];
- $options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
+ $options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL | FILE_REFERENCE);
$mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
$mform->addElement('hidden', 'contextid', $this->_customdata['contextid']);
$mform->addElement('hidden', 'currentcontext', $this->_customdata['currentcontext']);
19 backup/moodle2/backup_stepslib.php
View
@@ -1404,7 +1404,7 @@ protected function define_structure() {
'contenthash', 'contextid', 'component', 'filearea', 'itemid',
'filepath', 'filename', 'userid', 'filesize',
'mimetype', 'status', 'timecreated', 'timemodified',
- 'source', 'author', 'license', 'sortorder'));
+ 'source', 'author', 'license', 'sortorder', 'reference', 'repositoryid'));
// Build the tree
@@ -1412,9 +1412,12 @@ protected function define_structure() {
// Define sources
- $file->set_source_sql("SELECT f.*
+ $file->set_source_sql("SELECT f.*, r.repositoryid, r.reference
FROM {files} f
- JOIN {backup_ids_temp} bi ON f.id = bi.itemid
+ LEFT JOIN {files_reference} r
+ ON r.id = f.referencefileid
+ JOIN {backup_ids_temp} bi
+ ON f.id = bi.itemid
WHERE bi.backupid = ?
AND bi.itemname = 'filefinal'", array(backup::VAR_BACKUPID));
@@ -1442,6 +1445,8 @@ protected function define_structure() {
$info['backup_date'] = time();
$info['backup_uniqueid']= $this->get_backupid();
$info['mnet_remoteusers']=backup_controller_dbops::backup_includes_mnet_remote_users($this->get_backupid());
+ $info['include_file_references_to_external_content'] =
+ backup_controller_dbops::backup_includes_file_references($this->get_backupid());
$info['original_wwwroot']=$CFG->wwwroot;
$info['original_site_identifier_hash'] = md5(get_site_identifier());
$info['original_course_id'] = $this->get_courseid();
@@ -1461,7 +1466,7 @@ protected function define_structure() {
$information = new backup_nested_element('information', null, array(
'name', 'moodle_version', 'moodle_release', 'backup_version',
- 'backup_release', 'backup_date', 'mnet_remoteusers', 'original_wwwroot',
+ 'backup_release', 'backup_date', 'mnet_remoteusers', 'include_file_references_to_external_content', 'original_wwwroot',
'original_site_identifier_hash', 'original_course_id',
'original_course_fullname', 'original_course_shortname', 'original_course_startdate',
'original_course_contextid', 'original_system_contextid'));
@@ -1584,8 +1589,12 @@ protected function define_execution() {
// Calculate the zip fullpath (in OS temp area it's always backup.mbz)
$zipfile = $basepath . '/backup.mbz';
+ $has_file_references = backup_controller_dbops::backup_includes_file_references($this->get_backupid());
// Perform storage and return it (TODO: shouldn't be array but proper result object)
- return array('backup_destination' => backup_helper::store_backup_file($this->get_backupid(), $zipfile));
+ return array(
+ 'backup_destination' => backup_helper::store_backup_file($this->get_backupid(), $zipfile),
+ 'include_file_references_to_external_content' => $has_file_references
+ );
}
}
20 backup/moodle2/backup_xml_transformer.class.php
View
@@ -27,6 +27,13 @@
defined('MOODLE_INTERNAL') || die();
+// Cache for storing link encoders, so that we don't need to call
+// register_link_encoders each time backup_xml_transformer is constructed
+// TODO MDL-25290 replace global with MUC code.
+global $LINKS_ENCODERS_CACHE;
+
+$LINKS_ENCODERS_CACHE = array();
+
/**
* Class implementing the @xml_contenttrasnformed logic to be applied in moodle2 backups
*
@@ -131,7 +138,19 @@ static private function process_filephp_uses($matches) {
return $result;
}
+ /**
+ * Register all available content link encoders
+ *
+ * @return array encoder
+ * @todo MDL-25290 replace LINKS_ENCODERS_CACHE global with MUC code
+ */
private function register_link_encoders() {
+ global $LINKS_ENCODERS_CACHE;
+ // If encoder is linked, then return cached encoder.
+ if (!empty($LINKS_ENCODERS_CACHE)) {
+ return $LINKS_ENCODERS_CACHE;
+ }
+
$encoders = array();
// Add the course encoder
@@ -160,6 +179,7 @@ private function register_link_encoders() {
// Add local encodes
// TODO: Any interest? 1.9 never had that.
+ $LINKS_ENCODERS_CACHE = $encoders;
return $encoders;
}
}
1  backup/moodle2/restore_final_task.class.php
View
@@ -135,6 +135,7 @@ static public function define_restore_log_rules() {
$rules[] = new restore_log_rule('course', 'report outline', 'report/outline/index.php?id={course}', '{course}');
$rules[] = new restore_log_rule('course', 'report participation', 'report/participation/index.php?id={course}', '{course}');
$rules[] = new restore_log_rule('course', 'report stats', 'report/stats/index.php?id={course}', '{course}');
+ $rules[] = new restore_log_rule('course', 'view section', 'view.php?id={course}&section={course_sectionnumber}', '{course_section}');
// module 'user' rules
$rules[] = new restore_log_rule('user', 'view', 'view.php?id={user}&course={course}', '{user}');
21 backup/moodle2/restore_stepslib.php
View
@@ -586,11 +586,23 @@ protected function define_structure() {
return array($file);
}
- // Processing functions go here
+ /**
+ * Processing functions go here
+ *
+ * @param array $data one file record including repositoryid and reference
+ */
public function process_file($data) {
$data = (object)$data; // handy
+ $isreference = !empty($data->repositoryid);
+ $issamesite = $this->task->is_samesite();
+
+ // If it's not samesite, we skip file refernces
+ if (!$issamesite && $isreference) {
+ return;
+ }
+
// load it if needed:
// - it it is one of the annotated inforef files (course/section/activity/block)
// - it is one "user", "group", "grouping", "grade", "question" or "qtype_xxxx" component file (that aren't sent to inforef ever)
@@ -601,6 +613,7 @@ public function process_file($data) {
$data->component == 'grouping' || $data->component == 'grade' ||
$data->component == 'question' || substr($data->component, 0, 5) == 'qtype');
if ($isfileref || $iscomponent) {
+ // Process files
restore_dbops::set_backup_files_record($this->get_restoreid(), $data);
}
}
@@ -1034,6 +1047,7 @@ public function process_section($data) {
global $CFG, $DB;
$data = (object)$data;
$oldid = $data->id; // We'll need this later
+ $oldsection = $data->number;
$restorefiles = false;
@@ -1086,10 +1100,12 @@ public function process_section($data) {
$DB->update_record('course_sections', $section);
$newitemid = $secrec->id;
+ $oldsection = $secrec->section;
}
// Annotate the section mapping, with restorefiles option if needed
$this->set_mapping('course_section', $oldid, $newitemid, $restorefiles);
+ $this->set_mapping('course_sectionnumber', $oldsection, $section->section, $restorefiles);
// set the new course_section id in the task
$this->task->set_sectionid($newitemid);
@@ -2528,7 +2544,7 @@ protected function process_module($data) {
$data = (object)$data;
$oldid = $data->id;
-
+ $oldsection = $data->sectionnumber;
$this->task->set_old_moduleversion($data->version);
$data->course = $this->task->get_courseid();
@@ -2555,6 +2571,7 @@ protected function process_module($data) {
'course' => $this->get_courseid(),
'section' => 1);
$data->section = $DB->insert_record('course_sections', $sectionrec); // section 1
+ $this->set_mapping('course_sectionnumber', $oldsection, $sectionrec->section, $restorefiles);
}
$data->groupingid= $this->get_mappingid('grouping', $data->groupingid); // grouping
if (!$CFG->enablegroupmembersonly) { // observe groupsmemberonly
21 backup/util/dbops/backup_controller_dbops.class.php
View
@@ -410,6 +410,27 @@ public static function backup_includes_mnet_remote_users($backupid) {
}
/**
+ * Given the backupid, detect if the backup contains references to external contents
+ *
+ * @copyright 2012 Dongsheng Cai {@link http://dongsheng.org}
+ * @return int
+ */
+ public static function backup_includes_file_references($backupid) {
+ global $CFG, $DB;
+
+ $sql = "SELECT count(r.repositoryid)
+ FROM {files} f
+ LEFT JOIN {files_reference} r
+ ON r.id = f.referencefileid
+ JOIN {backup_ids_temp} bi
+ ON f.id = bi.itemid
+ WHERE bi.backupid = ?
+ AND bi.itemname = 'filefinal'";
+ $count = $DB->count_records_sql($sql, array($backupid));
+ return (int)(bool)$count;
+ }
+
+ /**
* Given the courseid, return some course related information we want to transport
*
* @param int $course the id of the course this backup belongs to
212 backup/util/dbops/restore_dbops.class.php
View
@@ -28,6 +28,38 @@
* TODO: Finish phpdocs
*/
abstract class restore_dbops {
+ /**
+ * Keep cache of backup records.
+ * @var array
+ * @todo MDL-25290 static should be replaced with MUC code.
+ */
+ private static $backupidscache = array();
+ /**
+ * Keep track of backup ids which are cached.
+ * @var array
+ * @todo MDL-25290 static should be replaced with MUC code.
+ */
+ private static $backupidsexist = array();
+ /**
+ * Count is expensive, so manually keeping track of