Permalink
Browse files

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

  • Loading branch information...
pcharsle committed Feb 26, 2012
2 parents c0c175e + c4a12af commit 9ea62d00441d05ff5064c293c2192cb46a2ad341
Showing with 8,323 additions and 4,237 deletions.
  1. +4 −1 admin/mnet/peer_forms.php
  2. +2 −0 admin/settings/grades.php
  3. +15 −15 admin/tool/customlang/lang/en/tool_customlang.php
  4. +1 −0 backup/cc/cc_includes.php
  5. +1 −1 backup/cc/cc_lib/cc_asssesment.php
  6. +4 −4 backup/cc/cc_lib/cc_basiclti.php
  7. +10 −1 backup/cc/cc_lib/cc_convert_moodle2.php
  8. +39 −0 backup/cc/cc_lib/cc_converter_label.php
  9. +2 −2 backup/cc/cc_lib/cc_forum.php
  10. +2 −2 backup/cc/cc_lib/cc_page.php
  11. +8 −14 backup/cc/cc_lib/cc_resources.php
  12. +1 −1 backup/cc/cc_lib/cc_weblink.php
  13. +12 −0 backup/cc/cc_lib/xmlbase.php
  14. +17 −6 backup/moodle2/backup_plan_builder.class.php
  15. +6 −0 backup/moodle2/restore_stepslib.php
  16. +3 −0 blocks/community/communitycourse.php
  17. +1 −0 blocks/dock.js
  18. +77 −8 blog/rsslib.php
  19. +3 −0 course/publish/backup.php
  20. +1 −1 enrol/ldap/lang/en/enrol_ldap.php
  21. +7 −1 enrol/manual/lib.php
  22. +6 −2 enrol/manual/yui/quickenrolment/quickenrolment.js
  23. +8 −1 grade/edit/letter/edit_form.php
  24. +1 −2 grade/edit/letter/index.php
  25. +8 −1 grade/edit/letter/tabs.php
  26. +8 −1 grade/edit/outcome/course.php
  27. +1 −2 grade/edit/outcome/edit.php
  28. +8 −1 grade/edit/outcome/edit_form.php
  29. +7 −2 grade/edit/outcome/export.php
  30. +8 −1 grade/edit/outcome/import.php
  31. +8 −1 grade/edit/outcome/import_outcomes_form.php
  32. +1 −2 grade/edit/outcome/index.php
  33. +8 −1 grade/edit/outcome/tabs.php
  34. +8 −1 grade/edit/scale/edit.php
  35. +8 −1 grade/edit/scale/edit_form.php
  36. +8 −1 grade/edit/scale/index.php
  37. +8 −1 grade/edit/settings/form.php
  38. +8 −1 grade/edit/settings/index.php
  39. +8 −1 grade/edit/tree/action.php
  40. +8 −1 grade/edit/tree/calculation.php
  41. +8 −1 grade/edit/tree/calculation_form.php
  42. +8 −1 grade/edit/tree/category.php
  43. +8 −1 grade/edit/tree/category_form.php
  44. +8 −1 grade/edit/tree/grade.php
  45. +8 −1 grade/edit/tree/grade_form.php
  46. +2 −3 grade/edit/tree/index.php
  47. +9 −1 grade/edit/tree/item.php
  48. +8 −1 grade/edit/tree/item_form.php
  49. +8 −1 grade/edit/tree/lib.php
  50. +8 −1 grade/edit/tree/outcomeitem.php
  51. +8 −1 grade/edit/tree/outcomeitem_form.php
  52. +2 −0 grade/grading/form/rubric/styles.css
  53. +1 −2 grade/grading/manage.php
  54. +1 −2 grade/grading/pick.php
  55. +6 −3 grade/index.php
  56. +6 −7 grade/lib.php
  57. +26 −16 grade/querylib.php
  58. +7 −1 grade/report/grader/ajax_callbacks.php
  59. +8 −1 grade/report/grader/db/access.php
  60. +8 −1 grade/report/grader/index.php
  61. +1 −1 grade/report/grader/lang/en/gradereport_grader.php
  62. +6 −4 grade/report/grader/lib.php
  63. +8 −1 grade/report/grader/preferences.php
  64. +2 −5 grade/report/grader/preferences_form.php
  65. +8 −1 grade/report/grader/quickedit_item.php
  66. +8 −1 grade/report/grader/settings.php
  67. +8 −1 grade/report/grader/tabs.php
  68. +2 −3 grade/report/grader/version.php
  69. +8 −1 grade/report/index.php
  70. +6 −5 grade/report/lib.php
  71. +8 −1 grade/report/outcomes/db/access.php
  72. +8 −1 grade/report/outcomes/index.php
  73. +1 −1 grade/report/outcomes/lang/en/gradereport_outcomes.php
  74. +2 −3 grade/report/outcomes/version.php
  75. +8 −1 grade/report/overview/db/access.php
  76. +8 −1 grade/report/overview/index.php
  77. +1 −2 grade/report/overview/lang/en/gradereport_overview.php
  78. +6 −4 grade/report/overview/lib.php
  79. +3 −4 grade/report/overview/renderer.php
  80. +7 −2 grade/report/overview/settings.php
  81. +2 −3 grade/report/overview/version.php
  82. +8 −1 grade/report/user/db/access.php
  83. +8 −1 grade/report/user/index.php
  84. +1 −2 grade/report/user/lang/en/gradereport_user.php
  85. +6 −4 grade/report/user/lib.php
  86. +2 −3 grade/report/user/renderer.php
  87. +7 −2 grade/report/user/settings.php
  88. +2 −3 grade/report/user/version.php
  89. +2 −2 group/assign.php
  90. +21 −6 group/autogroup.php
  91. +40 −4 group/autogroup_form.php
  92. +18 −3 group/clientlib.js
  93. +19 −4 group/delete.php
  94. +67 −45 group/externallib.php
  95. +19 −5 group/group.php
  96. +41 −8 group/group_form.php
  97. +19 −5 group/grouping.php
  98. +37 −8 group/grouping_form.php
  99. +1 −1 group/groupings.php
  100. +1 −1 group/import.php
  101. +32 −0 group/import_form.php
  102. +21 −7 group/index.php
  103. +62 −25 group/lib.php
  104. +19 −5 group/members.php
  105. +19 −4 group/overview.php
  106. +22 −0 group/tabs.php
  107. +1 −1 install/lang/ca/error.php
  108. +5 −5 install/lang/de/admin.php
  109. +1 −1 install/lang/it/admin.php
  110. +33 −0 install/lang/ka/moodle.php
  111. +34 −0 install/lang/lt/admin.php
  112. +1 −0 install/lang/lt/moodle.php
  113. +34 −0 install/lang/lt_uni/langconfig.php
  114. +2 −0 lang/en/backup.php
  115. +2 −0 lang/en/grades.php
  116. +4 −4 lang/en/langconfig.php
  117. +1 −0 lang/en/mnet.php
  118. +8 −11 lib/ajax/ajaxlib.php
  119. +1 −1 lib/ajax/getnavbranch.php
  120. +21 −27 lib/ajax/setuserpref.php
  121. +1 −1 lib/db/install.xml
  122. +42 −0 lib/db/upgrade.php
  123. +32 −10 lib/dml/database_column_info.php
  124. +332 −296 lib/dml/moodle_database.php
  125. +1 −0 lib/dml/moodle_recordset.php
  126. +8 −4 lib/dml/moodle_temptables.php
  127. +10 −1 lib/dml/moodle_transaction.php
  128. +33 −24 lib/dml/mssql_native_moodle_database.php
  129. +1 −1 lib/dml/mssql_native_moodle_recordset.php
  130. +1 −1 lib/dml/mssql_native_moodle_temptables.php
  131. +33 −24 lib/dml/mysqli_native_moodle_database.php
  132. +6 −1 lib/dml/mysqli_native_moodle_recordset.php
  133. +1 −1 lib/dml/mysqli_native_moodle_temptables.php
  134. +51 −31 lib/dml/oci_native_moodle_database.php
  135. +1 −1 lib/dml/oci_native_moodle_package.sql
  136. +1 −1 lib/dml/oci_native_moodle_recordset.php
  137. +1 −1 lib/dml/oci_native_moodle_temptables.php
  138. +16 −9 lib/dml/pdo_moodle_database.php
  139. +6 −1 lib/dml/pdo_moodle_recordset.php
  140. +32 −23 lib/dml/pgsql_native_moodle_database.php
  141. +8 −2 lib/dml/pgsql_native_moodle_recordset.php
  142. +1 −1 lib/dml/pgsql_native_moodle_temptables.php
  143. +9 −2 lib/dml/sqlite3_pdo_moodle_database.php
  144. +34 −25 lib/dml/sqlsrv_native_moodle_database.php
  145. +2 −2 lib/dml/sqlsrv_native_moodle_recordset.php
  146. +9 −4 lib/dml/sqlsrv_native_moodle_temptables.php
  147. +86 −33 lib/dmllib.php
  148. +58 −34 lib/form/advcheckbox.php
  149. +48 −30 lib/form/button.php
  150. +61 −14 lib/form/cancel.php
  151. +64 −18 lib/form/checkbox.php
  152. +69 −69 lib/form/dateselector.php
  153. +72 −73 lib/form/datetimeselector.php
  154. +72 −40 lib/form/duration.php
  155. +130 −9 lib/form/editor.php
  156. +55 −13 lib/form/file.php
  157. +113 −10 lib/form/filemanager.php
  158. +74 −4 lib/form/filepicker.php
  159. +39 −9 lib/form/format.php
  160. +31 −30 lib/form/grading.php
  161. +60 −15 lib/form/group.php
  162. +46 −16 lib/form/header.php
  163. +46 −10 lib/form/hidden.php
  164. +60 −8 lib/form/htmleditor.php
  165. +43 −15 lib/form/modgrade.php
  166. +41 −14 lib/form/modvisible.php
  167. +47 −9 lib/form/password.php
  168. +46 −4 lib/form/passwordunmask.php
  169. +33 −10 lib/form/questioncategory.php
  170. +57 −9 lib/form/radio.php
  171. +50 −24 lib/form/recaptcha.php
  172. +25 −6 lib/form/searchableselector.php
  173. +73 −22 lib/form/select.php
  174. +113 −185 lib/form/selectgroups.php
  175. +80 −24 lib/form/selectwithlink.php
  176. +41 −17 lib/form/selectyesno.php
  177. +54 −26 lib/form/simpletest/testduration.php
  178. +53 −9 lib/form/static.php
  179. +48 −12 lib/form/submit.php
  180. +52 −0 lib/form/submitlink.php
  181. +81 −36 lib/form/tags.php
  182. +60 −11 lib/form/text.php
  183. +65 −23 lib/form/textarea.php
  184. +61 −12 lib/form/url.php
  185. +59 −12 lib/form/warning.php
  186. +273 −260 lib/formslib.php
  187. +188 −12 lib/grade/constants.php
  188. +120 −122 lib/grade/grade_category.php
  189. +80 −55 lib/grade/grade_grade.php
  190. +192 −121 lib/grade/grade_item.php
  191. +75 −34 lib/grade/grade_object.php
  192. +43 −21 lib/grade/grade_outcome.php
  193. +35 −14 lib/grade/grade_scale.php
  194. +18 −27 lib/grade/simpletest/testgradecategory.php
  195. +18 −27 lib/grade/simpletest/testgradegrades.php
  196. +18 −27 lib/grade/simpletest/testgradeitem.php
  197. +18 −27 lib/grade/simpletest/testgradeoutcome.php
  198. +18 −27 lib/grade/simpletest/testgradescale.php
  199. +126 −122 lib/gradelib.php
  200. +51 −44 lib/grouplib.php
  201. +35 −35 lib/messagelib.php
  202. +72 −36 lib/moodlelib.php
  203. +37 −20 lib/outputactions.php
  204. +536 −331 lib/outputcomponents.php
  205. +43 −27 lib/outputfactories.php
  206. +122 −95 lib/outputlib.php
  207. +262 −92 lib/outputrenderers.php
  208. +88 −52 lib/outputrequirementslib.php
  209. +479 −183 lib/pagelib.php
  210. +2 −2 lib/pluginlib.php
  211. +120 −52 lib/rsslib.php
  212. +8 −8 lib/simpletest/testmoodlelib.php
  213. +4 −4 message/defaultoutputs.php
  214. +4 −6 message/discussion.php
  215. +3 −4 message/edit.php
  216. +14 −6 message/externallib.php
  217. +6 −4 message/index.php
  218. +12 −18 message/lib.php
  219. +25 −0 message/output/email/db/install.php
  220. +22 −26 message/output/email/db/upgrade.php
  221. +4 −5 message/output/email/lang/en/message_email.php
  222. +19 −28 message/output/email/lib.php
  223. +36 −34 message/output/email/message_output_email.php
  224. +4 −5 message/output/email/settings.php
  225. +2 −3 message/output/email/version.php
  226. +26 −0 message/output/jabber/db/install.php
  227. +22 −26 message/output/jabber/db/upgrade.php
  228. +4 −5 message/output/jabber/lang/en/message_jabber.php
  229. +17 −26 message/output/jabber/lib.php
  230. +35 −33 message/output/jabber/message_output_jabber.php
  231. +2 −3 message/output/jabber/settings.php
  232. +3 −4 message/output/jabber/version.php
  233. +66 −37 message/output/lib.php
  234. +25 −0 message/output/popup/db/install.php
  235. +22 −26 message/output/popup/db/upgrade.php
  236. +1 −2 message/output/popup/lang/en/message_popup.php
  237. +18 −27 message/output/popup/lib.php
  238. +30 −6 message/output/popup/message_output_popup.php
  239. +4 −5 message/output/popup/version.php
  240. +16 −16 message/renderer.php
  241. +33 −2 message/send_form.php
  242. +1 −1 mnet/peer.php
  243. +27 −1 mod/assignment/grade.php
  244. +32 −9 mod/assignment/lib.php
  245. +12 −0 mod/assignment/type/upload/assignment.class.php
  246. +12 −0 mod/assignment/type/uploadsingle/assignment.class.php
  247. +5 −6 mod/data/lib.php
  248. +43 −8 mod/data/rsslib.php
  249. +15 −12 mod/forum/lib.php
  250. +53 −23 mod/forum/rsslib.php
  251. +5 −4 mod/glossary/db/install.xml
  252. +15 −0 mod/glossary/db/upgrade.php
  253. +3 −4 mod/glossary/formats/entrylist/entrylist_format.php
  254. +3 −0 mod/glossary/lang/en/glossary.php
  255. +12 −14 mod/glossary/lib.php
  256. +6 −0 mod/glossary/mod_form.php
  257. +42 −6 mod/glossary/rsslib.php
  258. +2 −13 mod/glossary/showentry.php
  259. +1 −1 mod/glossary/version.php
  260. +5 −0 mod/glossary/view.php
  261. +39 −6 mod/lesson/backup/moodle2/restore_lesson_stepslib.php
  262. +5 −6 mod/lesson/grade.php
  263. +1 −0 mod/lesson/lang/en/lesson.php
  264. +6 −5 mod/lesson/lib.php
  265. +3 −13 mod/lesson/renderer.php
  266. +1 −0 mod/lesson/styles.css
  267. +2 −0 mod/lti/lib.php
  268. +4 −4 mod/quiz/grade.php
  269. +5 −1 mod/quiz/lib.php
  270. +4 −4 mod/scorm/datamodels/debug.js.php
  271. +0 −14 mod/scorm/datamodels/scorm_datamodels.js
  272. +9 −0 mod/scorm/grade.php
  273. +1 −1 mod/scorm/lang/en/scorm.php
  274. +4 −6 mod/scorm/lib.php
  275. +8 −19 mod/scorm/locallib.php
  276. +17 −12 mod/scorm/mod_form.php
  277. +5 −5 mod/scorm/module.js
  278. +0 −1 mod/scorm/report/basic/report.php
  279. +0 −1 mod/scorm/report/interactions/report.php
  280. +1 −0 mod/scorm/styles.css
  281. +1 −0 mod/workshop/lib.php
  282. +1 −1 repository/filepicker.js
  283. +17 −8 rss/file.php
  284. +14 −9 rss/renderer.php
  285. +6 −2 theme/afterburner/style/afterburner_layout.css
  286. +3 −3 theme/arialist/style/settings.css
  287. +2 −0 theme/standard/style/core.css
  288. +2 −2 version.php
  289. +11 −7 webservice/lib.php
  290. +17 −13 webservice/rest/locallib.php
  291. +0 −3 webservice/rest/server.php
  292. +1 −1 webservice/soap/locallib.php
@@ -98,6 +98,7 @@ function definition() {
$mform->addElement('textarea', 'public_key', get_string('publickey', 'mnet'), array('rows' => 17, 'cols' => 100, 'class' => 'smalltext'));
$mform->setType('public_key', PARAM_PEM);
+ $mform->addRule('public_key', get_string('required'), 'required');
// finished with form controls, now the static informational stuff
if ($mnet_peer && !empty($mnet_peer->bootstrapped)) {
@@ -160,7 +161,9 @@ function validation($data) {
}
$mnet_peer = new mnet_peer(); // idiotic api
$mnet_peer->wwwroot = $data['wwwroot']; // just hard-set this rather than bootstrap the object
- if (!$credentials = $mnet_peer->check_credentials($data['public_key'])) {
+ if (empty($data['public_key'])) {
+ $errors['public_key'] = get_string('publickeyrequired', 'mnet');
+ } else if (!$credentials = $mnet_peer->check_credentials($data['public_key'])) {
$errmsg = '';
foreach ($mnet_peer->error as $err) {
$errmsg .= $err['code'] . ': ' . $err['text'].'<br />';
@@ -58,6 +58,8 @@
GRADE_NAVMETHOD_TABS => new lang_string('tabs', 'grades'),
GRADE_NAVMETHOD_COMBO => new lang_string('combo', 'grades'))));
+ $temp->add(new admin_setting_configcheckbox('recovergradesdefault', new lang_string('recovergradesdefault', 'grades'), new lang_string('recovergradesdefault_help', 'grades'), 0));
+
$temp->add(new admin_setting_special_gradeexport());
$temp->add(new admin_setting_special_gradelimiting());
@@ -16,7 +16,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
- * Strings for Language customization admin tool
+ * Strings for Language customisation admin tool
*
* @package tool
* @subpackage customlang
@@ -26,36 +26,36 @@
defined('MOODLE_INTERNAL') || die();
-$string['checkin'] = 'Check in strings into disk';
-$string['checkout'] = 'Check out strings into the translator';
-$string['checkoutdone'] = 'Strings checked out successfully into the translator';
-$string['checkoutinprogress'] = 'Checking out strings into the translator';
-$string['confirmcheckin'] = 'You are about to check in modified strings into your local language pack. This will export the customized strings from the translator into the data directory and Moodle will start using the modified strings. Press \'Continue\' button to proceed check in.';
+$string['checkin'] = 'Save strings to language pack';
+$string['checkout'] = 'Open language pack for editing';
+$string['checkoutdone'] = 'Language pack loaded';
+$string['checkoutinprogress'] = 'Loading language pack';
+$string['confirmcheckin'] = 'You are about to save modifications to your local language pack. This will export the customised strings from the translator into you Moodle data directory and Moodle will start using the modified strings. Press \'Continue\' to proceed with saving.';
$string['customlang:edit'] = 'Edit local translation';
$string['customlang:view'] = 'View local translation';
$string['filter'] = 'Filter strings';
$string['filtercomponent'] = 'Show strings of these components';
-$string['filtercustomized'] = 'Customized only';
+$string['filtercustomized'] = 'Customised only';
$string['filtermodified'] = 'Modified only';
$string['filteronlyhelps'] = 'Help only';
$string['filtershowstrings'] = 'Show strings';
$string['filterstringid'] = 'String identifier';
$string['filtersubstring'] = 'Only strings containing';
$string['headingcomponent'] = 'Component';
-$string['headinglocal'] = 'Local customization';
+$string['headinglocal'] = 'Local customisation';
$string['headingstandard'] = 'Standard text';
$string['headingstringid'] = 'String';
-$string['markinguptodate'] = 'Marking the customization as up-to-date';
-$string['markinguptodate_help'] = 'The customized translation may get outdated if either the English original or the master translation has modified since the string was customized on your site. Review the customized translation. If you find it up-to-date, click the checkbox. Edit it otherwise.';
+$string['markinguptodate'] = 'Marking the customisation as up-to-date';
+$string['markinguptodate_help'] = 'The customised translation may get outdated if either the English original or the master translation has modified since the string was customised on your site. Review the customised translation. If you find it up-to-date, click the checkbox. Edit it otherwise.';
$string['markuptodate'] = 'mark as up-to-date';
-$string['modifiedno'] = 'There are no modified strings to check in.';
-$string['modifiednum'] = 'There are {$a} modified strings. You must check in them into disk to store them permanently.';
+$string['modifiedno'] = 'There are no modified strings to save.';
+$string['modifiednum'] = 'There are {$a} modified strings. Do you wish to save these changes to your local language pack?';
$string['nostringsfound'] = 'No strings found, please modify the filter settings';
$string['placeholder'] = 'Placeholders';
$string['placeholder_help'] = 'Placeholders are special statements like `{$a}` or `{$a->something}` within the string. They are replaced with a value when the string is actually printed.
It is important to copy them exactly as they are in the original string. Do not translate them nor change their left-to-right orientation.';
$string['placeholderwarning'] = 'string contains a placeholder';
-$string['pluginname'] = 'Language customization';
-$string['savecheckin'] = 'Save and check in strings into files';
-$string['savecontinue'] = 'Save and continue editing';
+$string['pluginname'] = 'Language customisation';
+$string['savecheckin'] = 'Save changes to the language pack';
+$string['savecontinue'] = 'Apply changes and continue editing';
@@ -39,4 +39,5 @@
require_once($CFG->dirroot .'/backup/cc/cc_lib/cc_converter_resource.php');
require_once($CFG->dirroot .'/backup/cc/cc_lib/cc_converter_quiz.php');
require_once($CFG->dirroot .'/backup/cc/cc_lib/cc_converter_page.php');
+require_once($CFG->dirroot .'/backup/cc/cc_lib/cc_converter_label.php');
require_once($CFG->dirroot .'/backup/cc/cc_lib/cc_convert_moodle2.php');
@@ -1821,7 +1821,7 @@ public function set_section(cc_assesment_section $object) {
}
public function set_title($value) {
- $this->assessment_title = $value;
+ $this->assessment_title = self::safexml($value);
}
protected function on_save() {
@@ -55,10 +55,10 @@ class basicltil1_resurce_file extends general_cc_file {
protected $cartridge_icon = null;
public function set_title($title) {
- $this->title = $title;
+ $this->title = self::safexml($title);
}
public function set_description($description) {
- $this->description = $description;
+ $this->description = self::safexml($description);
}
public function set_launch_url ($url) {
$this->launch_url = $url;
@@ -77,11 +77,11 @@ public function set_vendor_code ($code) {
$this->vendor = true;
}
public function set_vendor_name ($name) {
- $this->vendor_name = $name;
+ $this->vendor_name = self::safexml($name);
$this->vendor = true;
}
public function set_vendor_description ($desc) {
- $this->vendor_description = $desc;
+ $this->vendor_description = self::safexml($desc);
$this->vendor = true;
}
public function set_vendor_url ($url) {
@@ -80,9 +80,17 @@ public static function convert($packagedir, $outdir) {
if ($docp->load($moodle_backup)) {
//sections
$sections = array();
+ $coursef = new XMLGenericDocument();
+ $course_file = $dir . DIRECTORY_SEPARATOR .'course' . DIRECTORY_SEPARATOR . 'course.xml';
+ $coursef->load($course_file);
+ $numsections = (int)$coursef->nodeValue('/course/numsections');
$section_list = $docp->nodeList('/moodle_backup/information/contents/sections/section');
if (!empty($section_list)) {
+ $count = 0;
foreach ($section_list as $node) {
+ if ($count > $numsections) {
+ break;
+ }
$sectionid = $docp->nodeValue('sectionid', $node);
$sectiontitle = $docp->nodeValue('title' , $node);
$sectionpath = $docp->nodeValue('directory', $node);
@@ -92,14 +100,15 @@ public static function convert($packagedir, $outdir) {
DIRECTORY_SEPARATOR .
$sectionpath .
DIRECTORY_SEPARATOR .
- 'section.xml';
+ 'section.xml';
if ($secp->load($section_file)) {
$rawvalue = $secp->nodeValue('/section/sequence');
if ($rawvalue != '$@NULL@$') {
$sequence = explode(',', $rawvalue);
}
}
$sections[$sectionid] = array($sectiontitle, $sequence);
+ $count++;
}
}
//organization title
@@ -0,0 +1,39 @@
+<?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/>.
+/**
+ * @package backup-convert
+ * @subpackage cc-library
+ * @copyright 2012 Darko Miletic <dmiletic@moodlerooms.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once 'cc_converters.php';
+require_once 'cc_general.php';
+
+class cc_converter_label extends cc_converter {
+
+ public function __construct(cc_i_item &$item, cc_i_manifest &$manifest, $rootpath, $path){
+ $this->defaultfile = 'label.xml';
+ parent::__construct($item, $manifest, $rootpath, $path);
+ }
+
+ public function convert($outdir) {
+ $resitem = new cc_item();
+ $resitem->title = $this->doc->nodeValue('/activity/label/name');
+ $this->item->add_child_item($resitem);
+ return true;
+ }
+}
@@ -37,11 +37,11 @@ class forum1_resurce_file extends general_cc_file {
protected $attachments = array();
public function set_title($title) {
- $this->title = $title;
+ $this->title = self::safexml($title);
}
public function set_text($text, $type='text/plain') {
- $this->text = $text;
+ $this->text = self::safexml($text);
$this->text_type = $type;
}
@@ -35,11 +35,11 @@ public function set_content($value) {
}
public function set_title($value) {
- $this->title = $value;
+ $this->title = self::safexml($value);
}
public function set_intro($value) {
- $this->intro = htmlspecialchars(strip_tags($value), ENT_COMPAT, 'UTF-8', false);
+ $this->intro = self::safexml(strip_tags($value));
}
protected function on_create() {
@@ -183,20 +183,14 @@ public function process_resource($manifestroot, &$fname, $folder) {
throw new Exception('The file doesnt exist!');
}
- //TODO: ver el tema de fpatch con el tema de unix y windows
- //$fpathtocheck = $this->adjust_path($manifestroot,$fname);
- //!empty($fpathtocheck) &&
- if (GetDepFiles($manifestroot, $fname, $this->folder, $this->files)) {
- array_unshift($this->files,$folder.$fname);
- $this->init_empty_new();
- $this->href = $folder.$fname;
- $this->identifierref = $folder.$fname;
- $this->filename = $fname;
- $this->isempty = false;
- $this->folder = $folder;
- } else {
- $this->init_clean();
- }
+ GetDepFiles($manifestroot, $fname, $this->folder, $this->files);
+ array_unshift($this->files,$folder.$fname);
+ $this->init_empty_new();
+ $this->href = $folder.$fname;
+ $this->identifierref = $folder.$fname;
+ $this->filename = $fname;
+ $this->isempty = false;
+ $this->folder = $folder;
}
public function adjust_path($mroot, $fname) {
@@ -44,7 +44,7 @@ class url1_resurce_file extends general_cc_file {
* @param string $title
*/
public function set_title($title) {
- $this->title = htmlentities($title);
+ $this->title = self::safexml($title);
}
/**
@@ -41,6 +41,18 @@ class XMLGenericDocument {
private $is_html = false;
+ /**
+ * @param string $value
+ * @return string
+ */
+ public static function safexml($value) {
+ $result = htmlspecialchars(html_entity_decode($value, ENT_QUOTES, 'UTF-8'),
+ ENT_NOQUOTES,
+ 'UTF-8',
+ false);
+ return $result;
+ }
+
function __construct($ch = 'UTF-8',$validatenow=true){
$this->charset = $ch;
$this->documentInit();
@@ -123,12 +123,23 @@ static protected function build_activity_plan($controller, $id) {
// Add the activity task, responsible for outputting
// all the module related information
- $plan->add_task(backup_factory::get_backup_activity_task($controller->get_format(), $id));
-
- // For the given activity, add as many block tasks as necessary
- $blockids = backup_plan_dbops::get_blockids_from_moduleid($id);
- foreach ($blockids as $blockid) {
- $plan->add_task(backup_factory::get_backup_block_task($controller->get_format(), $blockid, $id));
+ try {
+ $plan->add_task(backup_factory::get_backup_activity_task($controller->get_format(), $id));
+
+ // For the given activity, add as many block tasks as necessary
+ $blockids = backup_plan_dbops::get_blockids_from_moduleid($id);
+ foreach ($blockids as $blockid) {
+ try {
+ $plan->add_task(backup_factory::get_backup_block_task($controller->get_format(), $blockid, $id));
+ } catch (backup_task_exception $e) {
+ $a = stdClass();
+ $a->mid = $id;
+ $a->bid = $blockid;
+ $controller->log(get_string('error_block_for_module_not_found', 'backup', $a), backup::LOG_WARNING);
+ }
+ }
+ } catch (backup_task_exception $e) {
+ $controller->log(get_string('error_course_module_not_found', 'backup', $id), backup::LOG_WARNING);
}
}
@@ -1124,6 +1124,12 @@ public function process_course($data) {
unset($data->idnumber);
}
+ // Any empty value for course->hiddensections will lead to 0 (default, show collapsed).
+ // It has been reported that some old 1.9 courses may have it null leading to DB error. MDL-31532
+ if (empty($data->hiddensections)) {
+ $data->hiddensections = 0;
+ }
+
// Only restrict modules if original course was and target site too for new courses
$data->restrictmodules = $data->restrictmodules && !empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor == 'all';
@@ -110,6 +110,9 @@
$sizeinfo->total = number_format($backupsize / 1000000, 2);
echo html_writer::tag('div', get_string('downloadingsize', 'block_community', $sizeinfo),
array('class' => 'textinfo'));
+ if (ob_get_level()) {
+ ob_flush();
+ }
flush();
$filenames = $communitymanager->block_community_download_course_backup($course);
echo html_writer::tag('div', get_string('downloaded', 'block_community'),
View
@@ -539,6 +539,7 @@ M.core_dock.fixTitleOrientation = function(item, title, text) {
svg.appendChild(txt);
title.append(svg);
+ title.append(Y.Node.create('<span class="accesshide">'+text+'</span>'));
item.on('dockeditem:drawcomplete', function(txt, title){
txt.setAttribute('fill', Y.one(title).getStyle('color'));
Oops, something went wrong.

0 comments on commit 9ea62d0

Please sign in to comment.