Permalink
Browse files

Merge branch 'MOODLE_24_STABLE' into install_24_STABLE

  • Loading branch information...
2 parents 85ed2ec + e78a2d0 commit efcbed9b73305bf166c0596a606d9e211ee22a20 AMOS bot committed Sep 6, 2013
Showing with 471 additions and 198 deletions.
  1. +3 −1 admin/renderer.php
  2. +3 −1 admin/repository.php
  3. +2 −2 admin/tool/langimport/lang/en/tool_langimport.php
  4. +28 −14 admin/tool/xmldb/lang/en/tool_xmldb.php
  5. +2 −2 blocks/course_list/lang/en/block_course_list.php
  6. +12 −4 calendar/lib.php
  7. +1 −1 calendar/managesubscriptions.php
  8. +4 −2 calendar/renderer.php
  9. +1 −0 enrol/ldap/lang/en/enrol_ldap.php
  10. +12 −4 enrol/ldap/lib.php
  11. +1 −1 error/index.php
  12. +5 −5 files/renderer.php
  13. +1 −1 grade/export/lib.php
  14. +8 −8 lang/en/admin.php
  15. +1 −1 lang/en/completion.php
  16. +1 −1 lang/en/error.php
  17. +1 −1 lang/en/install.php
  18. +1 −1 lang/en/mathslib.php
  19. +1 −0 lang/en/moodle.php
  20. +1 −1 lang/en/repository.php
  21. +3 −0 lib/configonlylib.php
  22. +1 −0 lib/dml/mssql_native_moodle_database.php
  23. +1 −0 lib/dml/sqlsrv_native_moodle_database.php
  24. +7 −0 lib/editor/tinymce/module.js
  25. +5 −3 lib/ldaplib.php
  26. +3 −2 lib/modinfolib.php
  27. +2 −0 lib/moodlelib.php
  28. +1 −1 lib/tests/configonlylib_test.php
  29. +55 −0 lib/tests/modinfolib_test.php
  30. +1 −1 lib/tests/moodlelib_test.php
  31. +1 −1 login/change_password.php
  32. +3 −0 mod/assign/backup/moodle2/restore_assign_stepslib.php
  33. +6 −5 mod/assign/locallib.php
  34. +8 −1 mod/assignment/backup/moodle1/lib.php
  35. +20 −0 mod/assignment/backup/moodle2/restore_assignment_stepslib.php
  36. +1 −0 mod/assignment/lang/en/assignment.php
  37. +6 −1 mod/assignment/lib.php
  38. +6 −2 mod/assignment/mod_form.php
  39. +5 −1 mod/assignment/view.php
  40. +6 −6 mod/forum/lang/en/forum.php
  41. +1 −1 mod/lesson/lang/en/lesson.php
  42. +1 −1 mod/lti/lang/en/lti.php
  43. +1 −25 portfolio/googledocs/db/upgrade.php
  44. +53 −0 portfolio/googledocs/db/upgradelib.php
  45. +1 −25 portfolio/picasa/db/upgrade.php
  46. +53 −0 portfolio/picasa/db/upgradelib.php
  47. +1 −0 question/engine/lib.php
  48. +1 −1 report/security/lang/en/report_security.php
  49. +8 −3 repository/coursefiles/lib.php
  50. +5 −2 repository/filepicker.js
  51. +1 −25 repository/googledocs/db/upgrade.php
  52. +53 −0 repository/googledocs/db/upgradelib.php
  53. +3 −10 repository/lib.php
  54. +1 −25 repository/picasa/db/upgrade.php
  55. +53 −0 repository/picasa/db/upgradelib.php
  56. +1 −0 theme/base/style/core.css
  57. +1 −2 user/messageselect.php
  58. +1 −1 user/profile/field/menu/lang/en/profilefield_menu.php
  59. +2 −2 version.php
View
@@ -918,9 +918,11 @@ protected function required_column(plugininfo_base $plugin, plugin_manager $plug
} else {
$str = 'otherplugin';
}
+ $componenturl = new moodle_url('https://moodle.org/plugins/view.php?plugin='.$component);
+ $componenturl = html_writer::tag('a', $component, array('href' => $componenturl->out()));
$requires[] = html_writer::tag('li',
get_string($str, 'core_plugin',
- array('component' => $component, 'version' => $requiredversion)),
+ array('component' => $componenturl, 'version' => $requiredversion)),
array('class' => $class));
}
View
@@ -140,8 +140,10 @@ function repository_action_url($repository) {
$success = $repositorytype->update_options($settings);
} else {
$type = new repository_type($plugin, (array)$fromform, $visible);
- $type->create();
$success = true;
+ if (!$repoid = $type->create()) {
+ $success = false;
+ }
$data = data_submitted();
}
if ($success) {
@@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['install'] = 'Install selected language pack';
+$string['install'] = 'Install selected language pack(s)';
$string['installedlangs'] = 'Installed language packs';
$string['langimport'] = 'Language import utility';
$string['langimportdisabled'] = 'Language import feature has been disabled. You have to update your language packs manually at the file-system level. Do not forget to purge string caches after you do so.';
@@ -38,7 +38,7 @@
$string['pluginname'] = 'Language packs';
$string['purgestringcaches'] = 'Purge string caches';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="http://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
-$string['uninstall'] = 'Uninstall selected language pack';
+$string['uninstall'] = 'Uninstall selected language pack(s)';
$string['uninstallconfirm'] = 'You are about to completely uninstall language pack {$a}, are you sure?';
$string['updatelangs'] = 'Update all installed language packs';
@@ -33,24 +33,38 @@
$string['confirmdeletekey'] = 'Are you absolutely sure that you want to delete the key:';
$string['confirmdeletetable'] = 'Are you absolutely sure that you want to delete the table:';
$string['confirmdeletexmlfile'] = 'Are you absolutely sure that you want to delete the file:';
-$string['confirmcheckbigints'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-11038">potential wrong integer fields</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the integers in your DB properly defined.<br /><br />
-Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
-It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of wrong integers.<br /><br />
+$string['confirmcheckbigints'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-11038">potential wrong integer fields</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the integers in your DB properly defined.
+
+Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
+
+It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of wrong integers.
+
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
-$string['confirmcheckdefaults'] = 'This functionality will search for inconsistent default values in your Moodle server, generating (but not executing!) the needed SQL statements to have all the default values properly defined.<br /><br />
-Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
-It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of inconsistent default values.<br /><br />
+$string['confirmcheckdefaults'] = 'This functionality will search for inconsistent default values in your Moodle server, generating (but not executing!) the needed SQL statements to have all the default values properly defined.
+
+Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
+
+It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of inconsistent default values.
+
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
-$string['confirmcheckforeignkeys'] = 'This functionality will search for potential violations of the foreign keys defined in the install.xml definitions. (Moodle does not currently generate actual foreign key constraints in the database, which is why invalid data may be present.)<br /><br />
-It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of missing indexes.<br /><br />
+$string['confirmcheckforeignkeys'] = 'This functionality will search for potential violations of the foreign keys defined in the install.xml definitions. (Moodle does not currently generate actual foreign key constraints in the database, which is why invalid data may be present.)
+
+It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of missing indexes.
+
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
-$string['confirmcheckindexes'] = 'This functionality will search for potential missing indexes in your Moodle server, generating (but not executing!) automatically the needed SQL statements to keep everything updated.<br /><br />
-Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
-It\'s highly recommended to be running the latest (+ version) available of your Moodle release (1.8, 1.9, 2.x ...) before executing the search of missing indexes.<br /><br />
+$string['confirmcheckindexes'] = 'This functionality will search for potential missing indexes in your Moodle server, generating (but not executing!) automatically the needed SQL statements to keep everything updated.
+
+Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
+
+It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of missing indexes.
+
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
-$string['confirmcheckoraclesemantics'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-29322">Oracle varchar2 columns using BYTE semantics</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the columns converted to use CHAR semantics instead (better for cross-db compatibility and increased contents max. length).<br /><br />
-Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).<br /><br />
-It\'s highly recommended to be running the latest (+ version) available of your Moodle release (2.2, 2.3, 2.x ...) before executing the search of BYTE semantics.<br /><br />
+$string['confirmcheckoraclesemantics'] = 'This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-29322">Oracle varchar2 columns using BYTE semantics</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the columns converted to use CHAR semantics instead (better for cross-db compatibility and increased contents max. length).
+
+Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
+
+It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of BYTE semantics.
+
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
$string['confirmrevertchanges'] = 'Are you absolutely sure that you want to revert changes performed over:';
$string['create'] = 'Create';
@@ -26,9 +26,9 @@
$string['adminview'] = 'Admin view';
$string['allcourses'] = 'Admin user sees all courses';
$string['configadminview'] = 'What should the admin see in the course list block?';
-$string['confighideallcourseslink'] = 'Hide "All courses" link at the bottom of the block. Link hiding does not affects Admin\'s view';
+$string['confighideallcourseslink'] = 'Remove the \'All courses\' link under the list of courses. (This setting does not affect the admin view.)';
$string['course_list:addinstance'] = 'Add a new courses block';
$string['course_list:myaddinstance'] = 'Add a new courses block to My home';
-$string['hideallcourseslink'] = 'Hide All courses link';
+$string['hideallcourseslink'] = 'Hide \'All courses\' link';
$string['owncourses'] = 'Admin user sees own courses';
$string['pluginname'] = 'Courses';
View
@@ -110,6 +110,16 @@
*/
define('CALENDAR_IMPORT_EVENT_INSERTED', 2);
+/**
+ * CALENDAR_SUBSCRIPTION_UPDATE - Used to represent update action for subscriptions in various forms.
+ */
+define('CALENDAR_SUBSCRIPTION_UPDATE', 1);
+
+/**
+ * CALENDAR_SUBSCRIPTION_REMOVE - Used to represent remove action for subscriptions in various forms.
+ */
+define('CALENDAR_SUBSCRIPTION_REMOVE', 2);
+
/**
* Return the days of the week
*
@@ -2851,11 +2861,9 @@ function calendar_process_subscription_row($subscriptionid, $pollinterval, $acti
// Fetch the subscription from the database making sure it exists.
$sub = $DB->get_record('event_subscriptions', array('id' => $subscriptionid), '*', MUST_EXIST);
- $strupdate = get_string('update');
- $strremove = get_string('remove');
// Update or remove the subscription, based on action.
switch ($action) {
- case $strupdate:
+ case CALENDAR_SUBSCRIPTION_UPDATE:
// Skip updating file subscriptions.
if (empty($sub->url)) {
break;
@@ -2866,7 +2874,7 @@ function calendar_process_subscription_row($subscriptionid, $pollinterval, $acti
// Update the events.
return "<p>".get_string('subscriptionupdated', 'calendar', $sub->name)."</p>" . calendar_update_subscription_events($subscriptionid);
- case $strremove:
+ case CALENDAR_SUBSCRIPTION_REMOVE:
calendar_delete_subscription($subscriptionid);
return get_string('subscriptionremoved', 'calendar', $sub->name);
break;
@@ -33,7 +33,7 @@
// Used for processing subscription actions.
$subscriptionid = optional_param('id', 0, PARAM_INT);
$pollinterval = optional_param('pollinterval', 0, PARAM_INT);
-$action = optional_param('action', '', PARAM_ALPHA);
+$action = optional_param('action', '', PARAM_INT);
$url = new moodle_url('/calendar/managesubscriptions.php');
if ($courseid != SITEID) {
View
@@ -814,9 +814,11 @@ protected function subscription_action_form($subscription, $courseid) {
$html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'course', 'value' => $courseid));
$html .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'id', 'value' => $subscription->id));
if (!empty($subscription->url)) {
- $html .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'action', 'value' => get_string('update')));
+ $html .= html_writer::tag('button', get_string('update'), array('type' => 'submit', 'name' => 'action',
+ 'value' => CALENDAR_SUBSCRIPTION_UPDATE));
}
- $html .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'action', 'value' => get_string('remove')));
+ $html .= html_writer::tag('button', get_string('remove'), array('type' => 'submit', 'name' => 'action',
+ 'value' => CALENDAR_SUBSCRIPTION_REMOVE));
$html .= html_writer::end_tag('div');
$html .= html_writer::end_tag('form');
return $html;
@@ -55,6 +55,7 @@
$string['createcourseextid'] = 'CREATE User enrolled to a nonexistant course \'{$a->courseextid}\'';
$string['createnotcourseextid'] = 'User enrolled to a nonexistant course \'{$a->courseextid}\'';
$string['creatingcourse'] = 'Creating course \'{$a}\'...';
+$string['duplicateshortname'] = "Course creation failed. Duplicate short name. Skipping course with idnumber '{\$a->idnumber}'...";
$string['editlock'] = 'Lock value';
$string['emptyenrolment'] = "Empty enrolment for role '{\$a->role_shortname}' in course '{\$a->course_shortname}'\n";
$string['enrolname'] = 'LDAP';
View
@@ -184,9 +184,10 @@ public function sync_user_enrolments($user) {
if ($this->get_config('autocreate')) { // Autocreate
error_log($this->errorlogtag.get_string('createcourseextid', 'enrol_ldap',
array('courseextid'=>$course_ext_id)));
- if ($newcourseid = $this->create_course($enrol)) {
- $course = $DB->get_record('course', array('id'=>$newcourseid));
+ if (!$newcourseid = $this->create_course($enrol)) {
+ continue;
}
+ $course = $DB->get_record('course', array('id'=>$newcourseid));
} else {
error_log($this->errorlogtag.get_string('createnotcourseextid', 'enrol_ldap',
array('courseextid'=>$course_ext_id)));
@@ -400,9 +401,10 @@ public function sync_enrolments() {
if ($this->get_config('autocreate')) { // Autocreate
error_log($this->errorlogtag.get_string('createcourseextid', 'enrol_ldap',
array('courseextid'=>$idnumber)));
- if ($newcourseid = $this->create_course($course)) {
- $course_obj = $DB->get_record('course', array('id'=>$newcourseid));
+ if (!$newcourseid = $this->create_course($course)) {
+ continue;
}
+ $course_obj = $DB->get_record('course', array('id'=>$newcourseid));
} else {
error_log($this->errorlogtag.get_string('createnotcourseextid', 'enrol_ldap',
array('courseextid'=>$idnumber)));
@@ -977,6 +979,12 @@ function create_course($course_ext, $skip_fix_course_sortorder=false) {
$course->summary = $course_ext[$this->get_config('course_summary')][0];
}
+ // Check if the shortname already exists if it does - skip course creation.
+ if ($DB->record_exists('course', array('shortname' => $course->shortname))) {
+ error_log($this->errorlogtag . get_string('duplicateshortname', 'enrol_ldap', $course));
+ return false;
+ }
+
$newcourse = create_course($course);
return $newcourse->id;
}
View
@@ -49,9 +49,9 @@
header("Status: 404 Not Found");
$PAGE->set_url('/error/');
+ $PAGE->set_context(get_system_context());
$PAGE->set_title($site->fullname .':Error');
$PAGE->set_heading($site->fullname .': Error 404');
- $PAGE->set_context(get_system_context());
$PAGE->navbar->add('Error 404 - File not Found');
echo $OUTPUT->header();
echo $OUTPUT->box(get_string('pagenotexist', 'error'). '<br />'.s($requesturi), 'generalbox boxaligncenter');
View
@@ -201,9 +201,9 @@ private function fm_print_generallayout($fm) {
<div class="fp-navbar">
<div class="filemanager-toolbar">
<div class="fp-toolbar">
- <div class="{!}fp-btn-add"><a href="#"><img src="'.$this->pix_url('a/add_file').'" /> '.$straddfile.'</a></div>
- <div class="{!}fp-btn-mkdir"><a href="#"><img src="'.$this->pix_url('a/create_folder').'" /> '.$strmakedir.'</a></div>
- <div class="{!}fp-btn-download"><a href="#"><img src="'.$this->pix_url('a/download_all').'" /> '.$strdownload.'</a></div>
+ <div class="{!}fp-btn-add"><a role="button" href="#"><img src="'.$this->pix_url('a/add_file').'" /> '.$straddfile.'</a></div>
+ <div class="{!}fp-btn-mkdir"><a role="button" href="#"><img src="'.$this->pix_url('a/create_folder').'" /> '.$strmakedir.'</a></div>
+ <div class="{!}fp-btn-download"><a role="button" href="#"><img src="'.$this->pix_url('a/download_all').'" /> '.$strdownload.'</a></div>
</div>
<div class="{!}fp-viewbar">
<a class="{!}fp-vb-icons" href="#"></a>
@@ -520,10 +520,10 @@ private function fm_print_restrictions($fm) {
*/
private function fp_js_template_generallayout() {
$rv = '
-<div class="file-picker fp-generallayout">
+<div tabindex="0" class="file-picker fp-generallayout" role="dialog" aria-live="assertive">
<div class="fp-repo-area">
<ul class="fp-list">
- <li class="{!}fp-repo"><a href="#"><img class="{!}fp-repo-icon" width="16" height="16" />&nbsp;<span class="{!}fp-repo-name"></span></a></li>
+ <li class="{!}fp-repo"><a href="#"><img class="{!}fp-repo-icon" alt=" " width="16" height="16" />&nbsp;<span class="{!}fp-repo-name"></span></a></li>
</ul>
</div>
<div class="fp-repo-items" tabindex="0">
View
@@ -189,7 +189,7 @@ public function format_column_name($grade_item, $feedback=false) {
$name .= ' ('.get_string('feedback').')';
}
- return strip_tags($name);
+ return html_to_text($name, 0, false);
}
/**
Oops, something went wrong.

0 comments on commit efcbed9

Please sign in to comment.