Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit bccdff582f876a8c74e08d78b523a5f51ea2fffb 2 parents 9ea62d0 + 5bbf3cb
@wdjunaidi wdjunaidi authored
Showing with 4,063 additions and 2,200 deletions.
  1. +1 −2  admin/tool/customlang/db/access.php
  2. +3 −2 admin/tool/unittest/db/access.php
  3. +67 −17 backup/moodle2/backup_activity_task.class.php
  4. +7 −4 backup/moodle2/backup_block_task.class.php
  5. +7 −4 backup/moodle2/backup_course_task.class.php
  6. +5 −4 backup/moodle2/backup_coursereport_plugin.class.php
  7. +9 −4 backup/moodle2/backup_custom_fields.php
  8. +9 −4 backup/moodle2/backup_default_block_task.class.php
  9. +9 −4 backup/moodle2/backup_final_task.class.php
  10. +9 −4 backup/moodle2/backup_format_plugin.class.php
  11. +7 −5 backup/moodle2/backup_gradingform_plugin.class.php
  12. +9 −4 backup/moodle2/backup_plagiarism_plugin.class.php
  13. +7 −4 backup/moodle2/backup_plan_builder.class.php
  14. +9 −4 backup/moodle2/backup_plugin.class.php
  15. +9 −4 backup/moodle2/backup_qtype_plugin.class.php
  16. +5 −4 backup/moodle2/backup_report_plugin.class.php
  17. +9 −4 backup/moodle2/backup_root_task.class.php
  18. +9 −4 backup/moodle2/backup_section_task.class.php
  19. +16 −4 backup/moodle2/backup_settingslib.php
  20. +14 −7 backup/moodle2/backup_stepslib.php
  21. +8 −4 backup/moodle2/backup_subplugin.class.php
  22. +9 −4 backup/moodle2/backup_theme_plugin.class.php
  23. +9 −4 backup/moodle2/backup_xml_transformer.class.php
  24. +9 −4 backup/moodle2/restore_activity_task.class.php
  25. +9 −4 backup/moodle2/restore_block_task.class.php
  26. +9 −4 backup/moodle2/restore_course_task.class.php
  27. +5 −4 backup/moodle2/restore_coursereport_plugin.class.php
  28. +9 −4 backup/moodle2/restore_default_block_task.class.php
  29. +9 −4 backup/moodle2/restore_final_task.class.php
  30. +9 −4 backup/moodle2/restore_format_plugin.class.php
  31. +6 −4 backup/moodle2/restore_gradingform_plugin.class.php
  32. +9 −4 backup/moodle2/restore_plagiarism_plugin.class.php
  33. +7 −4 backup/moodle2/restore_plan_builder.class.php
  34. +9 −4 backup/moodle2/restore_plugin.class.php
  35. +9 −4 backup/moodle2/restore_qtype_plugin.class.php
  36. +5 −4 backup/moodle2/restore_report_plugin.class.php
  37. +8 −4 backup/moodle2/restore_root_task.class.php
  38. +9 −4 backup/moodle2/restore_section_task.class.php
  39. +9 −4 backup/moodle2/restore_settingslib.php
  40. +8 −7 backup/moodle2/restore_stepslib.php
  41. +9 −4 backup/moodle2/restore_subplugin.class.php
  42. +5 −4 backup/moodle2/restore_theme_plugin.class.php
  43. +15 −15 backup/util/settings/backup_setting.class.php
  44. +9 −0 backup/util/settings/base_setting.class.php
  45. +11 −6 backup/util/settings/root/root_backup_setting.class.php
  46. +2 −2 blocks/community/communitycourse.php
  47. +3 −3 blocks/community/locallib.php
  48. +1 −1  blocks/community/renderer.php
  49. +9 −9 blocks/community/yui/imagegallery/imagegallery.js
  50. +1 −1  blocks/completionstatus/block_completionstatus.php
  51. +0 −1  blocks/completionstatus/lang/en/block_completionstatus.php
  52. +1 −1  blocks/course_list/block_course_list.php
  53. +1 −1  blocks/course_list/lang/en/block_course_list.php
  54. +3 −3 blocks/dock.js
  55. +10 −3 blocks/html/lib.php
  56. +25 −14 blocks/navigation/block_navigation.php
  57. +4 −4 blocks/navigation/edit_form.php
  58. +50 −3 blocks/navigation/renderer.php
  59. +1 −2  blocks/navigation/version.php
  60. +23 −22 blocks/online_users/db/access.php
  61. +7 −5 blocks/participants/block_participants.php
  62. +1 −1  blocks/private_files/block_private_files.php
  63. +1 −1  blocks/private_files/lang/en/block_private_files.php
  64. +1 −1  blocks/rss_client/block_rss_client.php
  65. +24 −28 blocks/rss_client/db/access.php
  66. +1 −1  blocks/rss_client/editfeed.php
  67. +1 −2  blocks/rss_client/lang/en/block_rss_client.php
  68. +1 −1  blocks/rss_client/managefeeds.php
  69. +1 −1  blocks/rss_client/viewfeed.php
  70. +1 −1  blocks/section_links/config_instance.html
  71. +1 −1  blocks/selfcompletion/block_selfcompletion.php
  72. +0 −1  blocks/selfcompletion/lang/en/block_selfcompletion.php
  73. +3 −3 calendar/delete.php
  74. +3 −3 calendar/event.php
  75. +3 −3 calendar/lib.php
  76. +6 −6 course/completion.php
  77. +1 −1  course/info.php
  78. +1 −1  course/publish/forms.php
  79. +4 −4 course/publish/index.php
  80. +1 −1  course/publish/lib.php
  81. +2 −2 course/publish/metadata.php
  82. +2 −2 course/publish/renderer.php
  83. +25 −0 enrol/authorize/db/access.php
  84. +1 −3 enrol/category/db/access.php
  85. +6 −7 enrol/category/db/events.php
  86. +2 −2 enrol/cohort/ajax.php
  87. +1 −3 enrol/cohort/db/access.php
  88. +4 −5 enrol/cohort/db/events.php
  89. +1 −3 enrol/guest/db/access.php
  90. +1 −3 enrol/ldap/db/access.php
  91. +2 −2 enrol/locallib.php
  92. +1 −3 enrol/manual/db/access.php
  93. +1 −3 enrol/meta/db/access.php
  94. +4 −5 enrol/meta/db/events.php
  95. +1 −3 enrol/paypal/db/access.php
  96. +1 −3 enrol/self/db/access.php
  97. +2 −2 filter/algebra/AlgParser.pm
  98. +8 −8 grade/edit/scale/edit_form.php
  99. +10 −1 grade/export/ods/db/access.php
  100. +10 −1 grade/export/txt/db/access.php
  101. +10 −1 grade/export/xls/db/access.php
  102. +10 −1 grade/export/xml/db/access.php
  103. +10 −1 grade/import/csv/db/access.php
  104. +10 −1 grade/import/xml/db/access.php
  105. +2 −0  grade/report/grader/db/access.php
  106. +2 −0  grade/report/outcomes/db/access.php
  107. +2 −0  grade/report/overview/db/access.php
  108. +1 −1  grade/report/overview/renderer.php
  109. +2 −0  grade/report/user/db/access.php
  110. +34 −0 install/lang/ca_valencia/langconfig.php
  111. +34 −0 install/lang/en_ar/langconfig.php
  112. +2 −0  install/lang/hr/install.php
  113. +33 −0 install/lang/kl/langconfig.php
  114. +1 −1  lang/en/auth.php
  115. +1 −0  lang/en/question.php
  116. +230 −107 lib/accesslib.php
  117. +2 −3 lib/db/access.php
  118. +5 −7 lib/db/events.php
  119. +1 −1  lib/dml/oci_native_moodle_database.php
  120. +41 −38 lib/eventslib.php
  121. +55 −52 lib/filebrowser/file_browser.php
  122. +51 −22 lib/filebrowser/file_info.php
  123. +129 −39 lib/filebrowser/file_info_context_course.php
  124. +33 −14 lib/filebrowser/file_info_context_coursecat.php
  125. +47 −15 lib/filebrowser/file_info_context_module.php
  126. +24 −14 lib/filebrowser/file_info_context_system.php
  127. +60 −15 lib/filebrowser/file_info_context_user.php
  128. +64 −37 lib/filebrowser/file_info_stored.php
  129. +132 −21 lib/filebrowser/virtual_root_file.php
  130. +182 −131 lib/filelib.php
  131. +26 −19 lib/filestorage/file_archive.php
  132. +48 −21 lib/filestorage/file_exceptions.php
  133. +30 −25 lib/filestorage/file_packer.php
  134. +85 −85 lib/filestorage/file_storage.php
  135. +19 −20 lib/filestorage/stored_file.php
  136. +35 −26 lib/filestorage/zip_archive.php
  137. +47 −25 lib/filestorage/zip_packer.php
  138. +2 −1  lib/form/filemanager.php
  139. +0 −5 lib/grade/constants.php
  140. +1 −1  lib/html2text.php
  141. +30 −10 lib/moodlelib.php
  142. +122 −105 lib/navigationlib.php
  143. +13 −6 lib/questionlib.php
  144. +56 −18 lib/setuplib.php
  145. +24 −0 lib/simpletest/testweblib.php
  146. +8 −2 lib/weblib.php
  147. +5 −3 login/index_form.html
  148. +16 −13 mod/assignment/backup/moodle2/backup_assignment_activity_task.class.php
  149. +20 −24 mod/assignment/db/access.php
  150. +22 −25 mod/assignment/db/events.php
  151. +14 −10 mod/assignment/lib.php
  152. +15 −30 mod/chat/backup/moodle2/backup_chat_activity_task.class.php
  153. +21 −25 mod/chat/db/access.php
  154. +3 −3 mod/chat/db/events.php
  155. +17 −14 mod/choice/backup/moodle2/backup_choice_activity_task.class.php
  156. +20 −24 mod/choice/db/access.php
  157. +16 −13 mod/data/backup/moodle2/backup_data_activity_task.class.php
  158. +21 −25 mod/data/db/access.php
  159. +85 −9 mod/data/lib.php
  160. +18 −13 mod/feedback/backup/moodle2/backup_feedback_activity_task.class.php
  161. +9 −28 mod/feedback/db/access.php
  162. +8 −6 mod/feedback/lib.php
  163. +14 −13 mod/folder/backup/moodle2/backup_folder_activity_task.class.php
  164. +1 −3 mod/folder/db/access.php
  165. +27 −19 mod/folder/lib.php
  166. +17 −14 mod/forum/backup/moodle2/backup_forum_activity_task.class.php
  167. +6 −29 mod/forum/db/access.php
  168. +3 −3 mod/forum/db/events.php
  169. +35 −19 mod/forum/lib.php
  170. +16 −13 mod/glossary/backup/moodle2/backup_glossary_activity_task.class.php
  171. +21 −25 mod/glossary/db/access.php
  172. +72 −9 mod/glossary/lib.php
  173. +14 −13 mod/imscp/backup/moodle2/backup_imscp_activity_task.class.php
  174. +1 −3 mod/imscp/db/access.php
  175. +27 −19 mod/imscp/lib.php
  176. +14 −13 mod/label/backup/moodle2/backup_label_activity_task.class.php
  177. +17 −14 mod/lesson/backup/moodle2/backup_lesson_activity_task.class.php
  178. +1 −3 mod/lesson/db/access.php
  179. +25 −17 mod/lesson/lib.php
  180. +1 −1  mod/lesson/pagetypes/multichoice.php
  181. +1 −1  mod/lesson/styles.css
  182. +16 −18 mod/lti/backup/moodle2/backup_lti_activity_task.class.php
  183. +2 −4 mod/lti/db/access.php
  184. +11 −4 mod/page/backup/moodle1/lib.php
  185. +14 −13 mod/page/backup/moodle2/backup_page_activity_task.class.php
  186. +1 −3 mod/page/db/access.php
  187. +28 −19 mod/page/lib.php
  188. +13 −13 mod/quiz/backup/moodle2/backup_quiz_activity_task.class.php
  189. +1 −2  mod/quiz/db/access.php
  190. +3 −3 mod/quiz/db/events.php
  191. +14 −8 mod/quiz/lib.php
  192. +1 −2  mod/quiz/report/grading/db/access.php
  193. +1 −2  mod/quiz/report/statistics/db/access.php
  194. +4 −1 mod/quiz/report/statistics/lib.php
  195. +14 −13 mod/resource/backup/moodle2/backup_resource_activity_task.class.php
  196. +1 −3 mod/resource/db/access.php
  197. +28 −19 mod/resource/lib.php
  198. +16 −13 mod/scorm/backup/moodle2/backup_scorm_activity_task.class.php
  199. +5 −3 mod/scorm/db/access.php
  200. +20 −16 mod/scorm/lib.php
  201. +16 −13 mod/survey/backup/moodle2/backup_survey_activity_task.class.php
  202. +20 −24 mod/survey/db/access.php
  203. +14 −16 mod/url/backup/moodle2/backup_url_activity_task.class.php
  204. +1 −3 mod/url/db/access.php
  205. +36 −11 mod/wiki/backup/moodle2/backup_wiki_activity_task.class.php
  206. +21 −6 mod/wiki/db/access.php
  207. +10 −2 mod/wiki/lib.php
  208. +1 −1  mod/wiki/locallib.php
  209. +11 −10 mod/workshop/backup/moodle2/backup_workshop_activity_task.class.php
  210. +4 −4 mod/workshop/backup/moodle2/backup_workshop_settingslib.php
  211. +10 −5 mod/workshop/backup/moodle2/backup_workshop_stepslib.php
  212. +1 −3 mod/workshop/db/access.php
  213. +1 −2  mod/workshop/form/accumulative/assessment_form.php
  214. +1 −2  mod/workshop/form/accumulative/backup/moodle1/lib.php
  215. +1 −2  mod/workshop/form/accumulative/backup/moodle2/backup_workshopform_accumulative_subplugin.class.php
  216. +1 −2  mod/workshop/form/accumulative/backup/moodle2/restore_workshopform_accumulative_subplugin.class.php
  217. +1 −2  mod/workshop/form/accumulative/db/install.php
  218. +1 −2  mod/workshop/form/accumulative/db/upgrade.php
  219. +1 −2  mod/workshop/form/accumulative/edit_form.php
  220. +1 −2  mod/workshop/form/accumulative/lang/en/workshopform_accumulative.php
  221. +13 −2 mod/workshop/form/accumulative/lib.php
  222. +1 −2  mod/workshop/form/accumulative/simpletest/testlib.php
  223. +1 −2  mod/workshop/form/accumulative/version.php
  224. +1 −2  mod/workshop/form/comments/assessment_form.php
  225. +1 −2  mod/workshop/form/comments/backup/moodle1/lib.php
  226. +1 −2  mod/workshop/form/comments/backup/moodle2/backup_workshopform_comments_subplugin.class.php
  227. +1 −2  mod/workshop/form/comments/backup/moodle2/restore_workshopform_comments_subplugin.class.php
  228. +1 −2  mod/workshop/form/comments/db/install.php
  229. +1 −2  mod/workshop/form/comments/db/upgrade.php
  230. +1 −2  mod/workshop/form/comments/edit_form.php
  231. +1 −2  mod/workshop/form/comments/lang/en/workshopform_comments.php
  232. +13 −2 mod/workshop/form/comments/lib.php
  233. +1 −2  mod/workshop/form/comments/version.php
  234. +1 −2  mod/workshop/form/numerrors/assessment_form.php
  235. +1 −2  mod/workshop/form/numerrors/backup/moodle1/lib.php
  236. +1 −2  mod/workshop/form/numerrors/backup/moodle2/backup_workshopform_numerrors_subplugin.class.php
  237. +1 −2  mod/workshop/form/numerrors/backup/moodle2/restore_workshopform_numerrors_subplugin.class.php
  238. +1 −2  mod/workshop/form/numerrors/db/install.php
  239. +1 −2  mod/workshop/form/numerrors/db/upgrade.php
  240. +1 −2  mod/workshop/form/numerrors/edit_form.php
  241. +1 −2  mod/workshop/form/numerrors/lang/en/workshopform_numerrors.php
  242. +13 −2 mod/workshop/form/numerrors/lib.php
  243. +1 −2  mod/workshop/form/numerrors/settings.php
  244. +1 −2  mod/workshop/form/numerrors/simpletest/testlib.php
  245. +1 −2  mod/workshop/form/numerrors/version.php
  246. +1 −2  mod/workshop/form/rubric/assessment_form.php
  247. +1 −2  mod/workshop/form/rubric/backup/moodle1/lib.php
  248. +1 −2  mod/workshop/form/rubric/backup/moodle2/backup_workshopform_rubric_subplugin.class.php
  249. +1 −2  mod/workshop/form/rubric/backup/moodle2/restore_workshopform_rubric_subplugin.class.php
  250. +1 −2  mod/workshop/form/rubric/db/install.php
  251. +1 −2  mod/workshop/form/rubric/db/upgrade.php
  252. +1 −2  mod/workshop/form/rubric/edit_form.php
  253. +1 −2  mod/workshop/form/rubric/lang/en/workshopform_rubric.php
  254. +13 −2 mod/workshop/form/rubric/lib.php
  255. +1 −2  mod/workshop/form/rubric/simpletest/testlib.php
  256. +1 −2  mod/workshop/form/rubric/version.php
  257. +12 −3 mod/workshop/lib.php
  258. +23 −0 portfolio/googledocs/db/events.php
  259. +24 −3 portfolio/picasa/db/events.php
  260. +4 −2 question/previewlib.php
  261. +11 −2 question/type/calculated/lib.php
  262. +2 −0  question/type/calculated/questiontype.php
  263. +11 −2 question/type/calculatedmulti/lib.php
  264. +2 −0  question/type/calculatedmulti/questiontype.php
  265. +12 −2 question/type/calculatedsimple/lib.php
  266. +1 −1  question/type/edit_question_form.php
  267. +11 −2 question/type/essay/lib.php
  268. +10 −2 question/type/match/lib.php
  269. +2 −0  question/type/match/questiontype.php
  270. +10 −0 question/type/multianswer/questiontype.php
  271. +11 −2 question/type/multichoice/lib.php
  272. +2 −0  question/type/multichoice/questiontype.php
  273. +11 −2 question/type/numerical/lib.php
  274. +2 −0  question/type/numerical/questiontype.php
  275. +37 −0 question/type/questiontypebase.php
  276. +10 −2 question/type/shortanswer/lib.php
  277. +2 −0  question/type/shortanswer/questiontype.php
  278. +10 −2 question/type/truefalse/lib.php
  279. +3 −2 report/completion/db/access.php
  280. +3 −2 report/courseoverview/db/access.php
  281. +2 −0  report/log/db/access.php
  282. +2 −0  report/loglive/db/access.php
  283. +3 −2 report/outline/db/access.php
  284. +3 −2 report/participation/db/access.php
  285. +3 −2 report/progress/db/access.php
  286. +3 −2 report/questioninstances/db/access.php
  287. +4 −3 report/security/db/access.php
  288. +23 −22 report/stats/db/access.php
  289. +25 −0 repository/alfresco/db/access.php
  290. +25 −0 repository/boxnet/db/access.php
  291. +25 −0 repository/coursefiles/db/access.php
  292. +11 −1 repository/dropbox/db/access.php
  293. +25 −0 repository/filesystem/db/access.php
  294. +25 −0 repository/flickr/db/access.php
  295. +25 −0 repository/flickr_public/db/access.php
  296. +24 −0 repository/googledocs/db/access.php
  297. +25 −0 repository/local/db/access.php
  298. +25 −0 repository/merlot/db/access.php
  299. +25 −0 repository/picasa/db/access.php
  300. +11 −1 repository/recent/db/access.php
Sorry, we could not display the entire diff because too many files (372) changed.
View
3  admin/tool/customlang/db/access.php
@@ -18,8 +18,7 @@
/**
* Defines the capabilities used by the Language customization admin tool
*
- * @package tool
- * @subpackage customlang
+ * @package tool_customlang
* @copyright 2010 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
View
5 admin/tool/unittest/db/access.php
@@ -17,12 +17,13 @@
/**
* Unitest caps.
*
- * @package tool
- * @subpackage unittest
+ * @package tool_unittest
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
$capabilities = array(
// Note: do not add managers here, unittests are dangerous and not intended for production sites!!!
View
84 backup/moodle2/backup_activity_task.class.php
@@ -16,17 +16,23 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_activity_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
- * abstract activity task that provides all the properties and common tasks to be performed
- * when one activity is being backup
+ * Provides all the settings and steps to perform one complete backup of the activity
*
- * TODO: Finish phpdocs
+ * Activities are supposed to provide the subclass of this class in their file
+ * mod/MODULENAME/backup/moodle2/backup_MODULENAME_activity_task.class.php
+ * The expected name of the subclass is backup_MODULENAME_activity_task
*/
abstract class backup_activity_task extends backup_task {
@@ -38,6 +44,10 @@
/**
* Constructor - instantiates one object of this class
+ *
+ * @param string $name the task identifier
+ * @param int $moduleid course module id (id in course_modules table)
+ * @param backup_plan|null $plan the backup plan instance this task is part of
*/
public function __construct($name, $moduleid, $plan = null) {
@@ -59,28 +69,43 @@ public function __construct($name, $moduleid, $plan = null) {
parent::__construct($name, $plan);
}
+ /**
+ * @return int the course module id (id in the course_modules table)
+ */
public function get_moduleid() {
return $this->moduleid;
}
+ /**
+ * @return int the course section id (id in the course_sections table)
+ */
public function get_sectionid() {
return $this->sectionid;
}
+ /**
+ * @return string the name of the module, eg 'workshop' (from the modules table)
+ */
public function get_modulename() {
return $this->modulename;
}
+ /**
+ * @return int the id of the activity instance (id in the activity's instances table)
+ */
public function get_activityid() {
return $this->activityid;
}
+ /**
+ * @return int the id of the associated CONTEXT_MODULE instance
+ */
public function get_contextid() {
return $this->contextid;
}
/**
- * Activity tasks have their own directory to write files
+ * @return string full path to the directory where this task writes its files
*/
public function get_taskbasepath() {
return $this->get_basepath() . '/activities/' . $this->modulename . '_' . $this->moduleid;
@@ -184,9 +209,11 @@ public function execute() {
/**
- * Specialisation that, first of all, looks for the setting within
- * the task with the the prefix added and later, delegates to parent
- * without adding anything
+ * Tries to look for the instance specific setting value, task specific setting value or the
+ * common plan setting value - in that order
+ *
+ * @param string $name the name of the setting
+ * @return mixed|null the value of the setting or null if not found
*/
public function get_setting($name) {
$namewithprefix = $this->modulename . '_' . $this->moduleid . '_' . $name;
@@ -211,7 +238,7 @@ public function get_setting($name) {
// Protected API starts here
/**
- * Define the common setting that any backup activity will have
+ * Defines the common setting that any backup activity will have
*/
protected function define_settings() {
@@ -264,21 +291,44 @@ protected function define_settings() {
}
/**
- * Define (add) particular settings that each activity can have
+ * Defines activity specific settings to be added to the common ones
+ *
+ * This method is called from {@link self::define_settings()}. The activity module
+ * author may use it to define additional settings that influence the execution of
+ * the backup.
+ *
+ * Most activities just leave the method empty.
+ *
+ * @see self::define_settings() for the example how to define own settings
*/
abstract protected function define_my_settings();
/**
- * Define (add) particular steps that each activity can have
+ * Defines activity specific steps for this task
+ *
+ * This method is called from {@link self::build()}. Activities are supposed
+ * to call {self::add_step()} in it to include their specific steps in the
+ * backup plan.
*/
abstract protected function define_my_steps();
/**
- * Code the transformations to perform in the activity in
- * order to get transportable (encoded) links
+ * Encodes URLs to the activity instance's scripts into a site-independent form
+ *
+ * The current instance of the activity may be referenced from other places in
+ * the course by URLs like http://my.moodle.site/mod/workshop/view.php?id=42
+ * Obvisouly, such URLs are not valid any more once the course is restored elsewhere.
+ * For this reason the backup file does not store the original URLs but encodes them
+ * into a transportable form. During the restore, the reverse process is applied and
+ * the encoded URLs are replaced with the new ones valid for the target site.
+ *
+ * Every plugin must override this method in its subclass.
+ *
+ * @see backup_xml_transformer class that actually runs the transformation
+ * @param string $content some HTML text that eventually contains URLs to the activity instance scripts
+ * @return string the content with the URLs encoded
*/
static public function encode_content_links($content) {
throw new coding_exception('encode_content_links() method needs to be overridden in each subclass of backup_activity_task');
}
-
}
View
11 backup/moodle2/backup_block_task.class.php
@@ -16,12 +16,15 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* abstract block task that provides all the properties and common steps to be performed
* when one block is being backup
View
11 backup/moodle2/backup_course_task.class.php
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_course_task
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
View
9 backup/moodle2/backup_coursereport_plugin.class.php
@@ -24,10 +24,11 @@
* backed up, a course report should make use of the second and third
* parameters in get_plugin_element().
*
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 onwards The Open University
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 onwards The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class backup_coursereport_plugin extends backup_plugin {
// Use default parent behaviour
View
13 backup/moodle2/backup_custom_fields.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines various element classes used in specific areas
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Implementation of backup_final_element that provides one interceptor for anonymization of data
*
View
13 backup/moodle2/backup_default_block_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_default_block_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Default block task to backup blocks that haven't own DB structures to be added
* when one block is being backup
View
13 backup/moodle2/backup_final_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_final_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Final task that provides all the final steps necessary in order to finish one
* backup (mainly gathering references and creating the main xml) apart from
View
13 backup/moodle2/backup_format_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_format_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class extending standard backup_plugin in order to implement some
* helper methods related with the course formats (format plugin)
View
12 backup/moodle2/backup_gradingform_plugin.class.php
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package core
- * @subpackage backup-moodle2
- * @copyright 2011 David Mudrak <david@moodle.com>
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_gradingform_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 David Mudrak <david@moodle.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
@@ -28,5 +31,4 @@
* Base class for all advanced grading form plugins
*/
abstract class backup_gradingform_plugin extends backup_plugin {
-
}
View
13 backup/moodle2/backup_plagiarism_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_plagiarism_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class extending standard backup_plugin in order to implement some
* helper methods related with the plagiarism plugins (plagiarism plugin)
View
11 backup/moodle2/backup_plan_builder.class.php
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_plan_builder class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
View
13 backup/moodle2/backup_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class implementing the plugins support for moodle2 backups
*
View
13 backup/moodle2/backup_qtype_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_qtype_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class extending standard backup_plugin in order to implement some
* helper methods related with the questions (qtype plugin)
View
9 backup/moodle2/backup_report_plugin.class.php
@@ -24,10 +24,11 @@
* backed up, a report should make use of the second and third
* parameters in get_plugin_element().
*
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 Petr Skoda
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 Petr Skoda
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class backup_report_plugin extends backup_plugin {
// Use default parent behaviour
View
13 backup/moodle2/backup_root_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_root_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Start task that provides all the settings common to all backups and some initialization steps
*
View
13 backup/moodle2/backup_section_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_section_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* section task that provides all the properties and common steps to be performed
* when one section is being backup
View
20 backup/moodle2/backup_settingslib.php
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines classes used to handle backup settings
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// TODO: Reduce these to the minimum because ui/dependencies are 100% separated
@@ -36,6 +39,15 @@ class backup_generic_setting extends root_backup_setting {}
*/
class backup_filename_setting extends backup_generic_setting {
+ /**
+ * Instantiates a setting object
+ *
+ * @param string $name Name of the setting
+ * @param string $vtype Type of the setting, eg {@link base_setting::IS_TEXT}
+ * @param mixed $value Value of the setting
+ * @param bool $visibility Is the setting visible in the UI, eg {@link base_setting::VISIBLE}
+ * @param int $status Status of the setting with regards to the locking, eg {@link base_setting::NOT_LOCKED}
+ */
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
parent::__construct($name, $vtype, $value, $visibility, $status);
}
View
21 backup/moodle2/backup_stepslib.php
@@ -16,15 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines various backup steps that will be used by common tasks in backup
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/**
- * Define all the backup steps that will be used by common tasks in backup
- */
+defined('MOODLE_INTERNAL') || die();
/**
* create the temp dir where backup/restore will happen,
@@ -98,6 +99,7 @@ protected function define_execution() {
* we are going to add subplugin information to
* @param bool $multiple to define if multiple subplugins can produce information
* for each instance of $element (true) or no (false)
+ * @return void
*/
protected function add_subplugin_structure($subplugintype, $element, $multiple) {
@@ -135,6 +137,8 @@ protected function add_subplugin_structure($subplugintype, $element, $multiple)
/**
* As far as activity backup steps are implementing backup_subplugin stuff, they need to
* have the parent task available for wrapping purposes (get course/context....)
+ *
+ * @return backup_activity_task
*/
public function get_task() {
return $this->task;
@@ -143,6 +147,9 @@ public function get_task() {
/**
* Wraps any activity backup structure within the common 'activity' element
* that will include common to all activities information like id, context...
+ *
+ * @param backup_nested_element $activitystructure the element to wrap
+ * @return backup_nested_element the $activitystructure wrapped by the common 'activity' element
*/
protected function prepare_activity_structure($activitystructure) {
View
12 backup/moodle2/backup_subplugin.class.php
@@ -16,12 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_subplugin class
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class implementing the subplugins support for moodle2 backups
*
View
13 backup/moodle2/backup_theme_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 onwards The Open University
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_theme_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 onwards The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Base class for theme backup plugins.
*
View
13 backup/moodle2/backup_xml_transformer.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_xml_transformer class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class implementing the @xml_contenttrasnformed logic to be applied in moodle2 backups
*
View
13 backup/moodle2/restore_activity_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_activity_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* abstract activity task that provides all the properties and common tasks to be performed
* when one activity is being restored
View
13 backup/moodle2/restore_block_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_block_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* abstract block task that provides all the properties and common steps to be performed
* when one block is being restored
View
13 backup/moodle2/restore_course_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_course_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* course task that provides all the properties and common steps to be performed
* when one course is being restored
View
9 backup/moodle2/restore_coursereport_plugin.class.php
@@ -19,10 +19,11 @@
/**
* Restore for course plugin: course report.
*
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 The Open University
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class restore_coursereport_plugin extends restore_plugin {
// Use default parent behaviour
View
13 backup/moodle2/restore_default_block_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_default_block_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Default block task to restore blocks not having own DB structures to be added
*
View
13 backup/moodle2/restore_final_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_final_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Final task that provides all the final steps necessary in order to finish one
* restore like gradebook, interlinks... apart from some final cleaning
View
13 backup/moodle2/restore_format_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_format_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class extending standard restore_plugin in order to implement some
* helper methods related with the course formats (format plugin)
View
10 backup/moodle2/restore_gradingform_plugin.class.php
@@ -16,10 +16,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package core
- * @subpackage backup-moodle2
- * @copyright 2011 David Mudrak <david@moodle.com>
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_gradingform_plugin class
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 David Mudrak <david@moodle.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
View
13 backup/moodle2/restore_plagiarism_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_plagiarism_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class extending standard restore_plugin in order to implement some
* helper methods related with the plagiarism plugins
View
11 backup/moodle2/restore_plan_builder.class.php
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_plan_builder class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
View
13 backup/moodle2/restore_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class implementing the plugins support for moodle2 restore
*
View
13 backup/moodle2/restore_qtype_plugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_qtype_plugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class extending standard restore_plugin in order to implement some
* helper methods related with the questions (qtype plugin)
View
9 backup/moodle2/restore_report_plugin.class.php
@@ -19,10 +19,11 @@
/**
* Restore for plugin report.
*
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 Petr Skoda
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 Petr Skoda
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class restore_report_plugin extends restore_plugin {
// Use default parent behaviour
View
12 backup/moodle2/restore_root_task.class.php
@@ -16,12 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_root_task class
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Start task that provides all the settings common to all restores and other initial steps
*
View
13 backup/moodle2/restore_section_task.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_section_task class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* section task that provides all the properties and common steps to be performed
* when one section is being restored
View
13 backup/moodle2/restore_settingslib.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines classes used to handle restore settings
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
// TODO: Reduce these to the minimum because ui/dependencies are 100% separated
// Root restore settings
View
15 backup/moodle2/restore_stepslib.php
@@ -16,15 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines various restore steps that will be used by common tasks in restore
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-/**
- * Define all the restore steps that will be used by common tasks in restore
- */
+defined('MOODLE_INTERNAL') || die();
/**
* delete old directories and conditionally create backup_temp_ids table
View
13 backup/moodle2/restore_subplugin.class.php
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines restore_subplugin class
+ *
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Class implementing the subplugins support for moodle2 restore
*
View
9 backup/moodle2/restore_theme_plugin.class.php
@@ -19,10 +19,11 @@
/**
* Restore for course plugin: theme.
*
- * @package moodlecore
- * @subpackage backup-moodle2
- * @copyright 2011 The Open University
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package core_backup
+ * @subpackage moodle2
+ * @category backup
+ * @copyright 2011 The Open University
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class restore_theme_plugin extends restore_plugin {
// Use default parent behaviour
View
30 backup/util/settings/backup_setting.class.php
@@ -16,16 +16,18 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-settings
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines backup_setting class
+ *
+ * @package core_backup
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
- * This abstract class defines one backup_setting
- *
- * TODO: Finish phpdocs
+ * Parent class for all backup settings
*/
abstract class backup_setting extends base_setting implements checksumable {
@@ -35,12 +37,12 @@
const SECTION_LEVEL = 9;
const ACTIVITY_LEVEL = 13;
+ /** @var int Level of the setting, eg {@link self::ROOT_LEVEL} */
+ protected $level;
+
/**
- * One of the above constants
- * @var {int}
+ * {@inheritdoc}
*/
- protected $level; // level of the setting
-
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
parent::__construct($name, $vtype, $value, $visibility, $status);
// Generate a default ui
@@ -48,9 +50,7 @@ public function __construct($name, $vtype, $value = null, $visibility = self::VI
}
/**
- * Returns the level of the setting
- *
- * @return {int} One of the above constants
+ * @return int Level of the setting, eg {@link self::ROOT_LEVEL}
*/
public function get_level() {
return $this->level;
@@ -112,7 +112,7 @@ public function is_checksum_correct($checksum) {
}
}
-/*
+/**
* Exception class used by all the @backup_setting stuff
*/
class backup_setting_exception extends base_setting_exception {
View
9 backup/util/settings/base_setting.class.php
@@ -86,6 +86,15 @@
*/
protected $help = array();
+ /**
+ * Instantiates a setting object
+ *
+ * @param string $name Name of the setting
+ * @param string $vtype Type of the setting, eg {@link self::IS_TEXT}
+ * @param mixed $value Value of the setting
+ * @param bool $visibility Is the setting visible in the UI, eg {@link self::VISIBLE}
+ * @param int $status Status of the setting with regards to the locking, eg {@link self::NOT_LOCKED}
+ */
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
// Check vtype
if ($vtype !== self::IS_BOOLEAN && $vtype !== self::IS_INTEGER &&
View
17 backup/util/settings/root/root_backup_setting.class.php
@@ -16,19 +16,24 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * @package moodlecore
- * @subpackage backup-settings
- * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * Defines root_backup_setting class
+ *
+ * @package core_backup
+ * @category backup
+ * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+defined('MOODLE_INTERNAL') || die();
+
/**
* Abstract class containing all the common stuff for root backup settings
- *
- * TODO: Finish phpdocs
*/
abstract class root_backup_setting extends backup_setting {
+ /**
+ * {@inheritdoc}
+ */
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
$this->level = self::ROOT_LEVEL;
parent::__construct($name, $vtype, $value, $visibility, $status);
View
4 blocks/community/communitycourse.php
@@ -128,7 +128,7 @@
$remove = optional_param('remove', '', PARAM_INTEGER);
$communityid = optional_param('communityid', '', PARAM_INTEGER);
if ($remove != -1 and !empty($communityid) and confirm_sesskey()) {
- $communitymanager->block_community_remove_course($communityid, $USER->id);
+ $communitymanager->block_community_remove_course($communityid, $USER->id);
echo $OUTPUT->header();
echo $renderer->remove_success(new moodle_url(get_referer(false)));
echo $OUTPUT->footer();
@@ -245,4 +245,4 @@
}
}
-echo $OUTPUT->footer();
+echo $OUTPUT->footer();
View
6 blocks/community/locallib.php
@@ -82,7 +82,7 @@ public function block_community_download_course_backup($course) {
global $CFG, $USER;
require_once($CFG->libdir . "/filelib.php");
require_once($CFG->dirroot. "/course/publish/lib.php");
-
+
$params['courseid'] = $course->id;
$params['filetype'] = HUB_BACKUP_FILE_TYPE;
@@ -104,7 +104,7 @@ public function block_community_download_course_backup($course) {
$token = $registeredhub->token;
$curlurl .= '&token='.$token;
}
-
+
$ch = curl_init($curlurl);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
@@ -143,4 +143,4 @@ public function block_community_remove_course($communityid, $userid) {
array('userid' => $userid, 'id' => $communityid));
}
-}
+}
View
2  blocks/community/renderer.php
@@ -124,7 +124,7 @@ public function course_list($courses, $huburl, $contextcourseid) {
//create title html
$coursename = html_writer::tag('h3', $course->fullname,
array('class' => 'hubcoursetitle'));
- $coursenamehtml = html_writer::tag('div', $coursename,
+ $coursenamehtml = html_writer::tag('div', $coursename,
array('class' => 'hubcoursetitlepanel'));
// create screenshots html
View
18 blocks/community/yui/imagegallery/imagegallery.js
@@ -44,12 +44,12 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
this.overlay.render();
this.overlay.hide();
-
+
//attach a show event on the image divs (<tag id='image-X'>)
for (var i=0;i<this.get('imageids').length;i++)
{
var imageid = this.get('imageids')[i];
- this.imageidnumbers[imageid] = this.get('imagenumbers')[i];
+ this.imageidnumbers[imageid] = this.get('imagenumbers')[i];
Y.one('#image-'+imageid).on('click', this.show, this, imageid, 1);
}
@@ -60,9 +60,9 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
if (this.imageloadingevent != null) {
this.imageloadingevent.detach();
}
-
+
var url = this.get('huburl') + "/local/hub/webservice/download.php?courseid="
- + imageid + "&filetype=screenshot&imagewidth=original&screenshotnumber=" + screennumber;
+ + imageid + "&filetype=screenshot&imagewidth=original&screenshotnumber=" + screennumber;
/// set the mask
if (this.get('maskNode')) {
@@ -88,17 +88,17 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
var overlaytitle = Y.one('#imagetitleoverlay');
var previousimagelink = "<div id=\"previousarrow\" class=\"imagearrow\">←</div>";
var nextimagelink = "<div id=\"nextarrow\" class=\"imagearrow\">→</div>";
-
+
/// need to load the images in the overlay
var overlay = Y.one('#imageoverlay');
overlay.setContent('');
-
+
overlay.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
+ '" style="max-height:' + maxheight + 'px;"></div>'));
this.overlay.destroy();
this.overlay = new M.core.dialogue({
- headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
+ headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </div>' + nextimagelink,
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
visible: false, //by default it is not displayed
@@ -127,7 +127,7 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
if(overlaywidth > screenshot.width) {
overlaywidth = screenshot.width;
}
-
+
this.overlay.set('width', overlaywidth);
this.overlay.set("centered", true);
this.overlay.show();
@@ -196,4 +196,4 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
}, '@VERSION@', {
requires:['base','node','overlay', 'moodle-enrol-notification']
-});
+});
View
2  blocks/completionstatus/block_completionstatus.php
@@ -36,7 +36,7 @@
class block_completionstatus extends block_base {
public function init() {
- $this->title = get_string('completionstatus', 'block_completionstatus');
+ $this->title = get_string('pluginname', 'block_completionstatus');
}
public function get_content() {
View
1  blocks/completionstatus/lang/en/block_completionstatus.php
@@ -1,7 +1,6 @@
<?php
$string['completionprogressdetails'] = 'Completion progress details';
-$string['completionstatus'] = 'Course completion status';
$string['criteriagroup'] = 'Criteria group';
$string['firstofsecond'] = '{$a->first} of {$a->second}';
$string['pluginname'] = 'Course completion status';
View
2  blocks/course_list/block_course_list.php
@@ -4,7 +4,7 @@
class block_course_list extends block_list {
function init() {
- $this->title = get_string('courses');
+ $this->title = get_string('pluginname', 'block_course_list');
}
function has_config() {
View
2  blocks/course_list/lang/en/block_course_list.php
@@ -29,4 +29,4 @@
$string['confighideallcourseslink'] = 'Hide "All courses" link at the bottom of the block. Link hiding does not affects Admin\'s view';
$string['hideallcourseslink'] = 'Hide All courses link';
$string['owncourses'] = 'Admin user sees own courses';
-$string['pluginname'] = 'Course list';
+$string['pluginname'] = 'Courses';
View
6 blocks/dock.js
@@ -478,7 +478,7 @@ M.core_dock.delayEvent = function(event, options, target) {
*/
M.core_dock.fixTitleOrientation = function(item, title, text) {
var Y = this.Y;
-
+
var title = Y.one(title);
if(M.core_dock.cfg.orientation != 'vertical') {
@@ -809,7 +809,7 @@ M.core_dock.genericblock.prototype = {
*/
initialise_block : function(Y, node) {
M.core_dock.init(Y);
-
+
this.Y = Y;
if (!node) {
return false;
@@ -919,7 +919,7 @@ M.core_dock.genericblock.prototype = {
// Register an event so that when it is removed we can put it back as a block
dockitem.on('dockeditem:itemremoved', this.return_to_block, this, dockitem);
dock.add(dockitem);
-
+
if (!this.skipsetposition) {
// save the users preference
M.util.set_user_preference('docked_block_instance_'+this.id, 1);
View
13 blocks/html/lib.php
@@ -18,11 +18,18 @@
/**
* Form for editing HTML block instances.
*
- * @package block_html
* @copyright 2010 Petr Skoda (http://skodak.org)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @package block_html
+ * @category files
+ * @param stdClass $course course object
+ * @param stdClass $birecord_or_cm block instance record
+ * @param stdClass $context context object
+ * @param string $filearea file area
+ * @param array $args extra arguments
+ * @param bool $forcedownload whether or not force download
+ * @return bool
*/
-
function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $args, $forcedownload) {
global $SCRIPT;
@@ -79,4 +86,4 @@ function block_html_global_db_replace($search, $replace) {
}
}
$instances->close();
-}
+}
View
39 blocks/navigation/block_navigation.php
@@ -1,5 +1,4 @@
<?php
-
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -19,8 +18,8 @@