Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MOODLE_24_STABLE' into install_24_STABLE

  • Loading branch information...
commit efcbed9b73305bf166c0596a606d9e211ee22a20 2 parents 85ed2ec + e78a2d0
AMOS bot authored
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
4 admin/renderer.php
@@ -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
4 admin/repository.php
@@ -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) {
View
4 admin/tool/langimport/lang/en/tool_langimport.php
@@ -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';
View
42 admin/tool/xmldb/lang/en/tool_xmldb.php
@@ -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';
View
4 blocks/course_list/lang/en/block_course_list.php
@@ -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
16 calendar/lib.php
@@ -111,6 +111,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
*
* @return array array of days
@@ -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;
View
2  calendar/managesubscriptions.php
@@ -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
6 calendar/renderer.php
@@ -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;
View
1  enrol/ldap/lang/en/enrol_ldap.php
@@ -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
16 enrol/ldap/lib.php
@@ -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
2  error/index.php
@@ -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
10 files/renderer.php
@@ -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
2  grade/export/lib.php
@@ -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);
}
/**
View
16 lang/en/admin.php
@@ -118,7 +118,7 @@
$string['commonsettings'] = 'Common settings';
$string['componentinstalled'] = 'Component installed';
$string['computedfromlogs'] = 'Computed from logs since {$a}.';
-$string['condifmodeditdefaults'] = 'The values you set here define the default values that are used in the activity settings form when you create a new activity. You can also configure which activity settings are considered advanced.';
+$string['condifmodeditdefaults'] = 'Default values are used in the settings form when creating a new activity or resource.';
$string['confeditorhidebuttons'] = 'Select the buttons that should be hidden in the HTML editor.';
$string['configallcountrycodes'] = 'This is the list of countries that may be selected in various places, for example in a user\'s profile. If blank (the default) the list in countries.php in the standard English language pack is used. That is the list from ISO 3166-1. Otherwise, you can specify a comma-separated list of codes, for example \'GB,FR,ES\'. If you add new, non-standard codes here, you will need to add them to countries.php in \'en\' and your language pack.';
$string['configallowassign'] = 'You can allow people who have the roles on the left side to assign some of the column roles to other people';
@@ -159,15 +159,15 @@
http://site.example.com/admin/cron.php?password=opensesame
</pre>If this is left empty, no password is required.';
$string['configcurlcache'] = 'Time-to-live for cURL cache, in seconds.';
-$string['configcustommenuitems'] = 'You can configure a custom menu here to be shown by themes. Each line consists of some menu text, a link URL (optional) and a tooltip title (optional), separated by pipe characters. You can specify a structure using hyphens. For example:
+$string['configcustommenuitems'] = 'You can configure a custom menu here to be shown by themes. Each line consists of some menu text, a link URL (optional), a tooltip title (optional) and a language code or comma-separated list of codes (optional, for displaying the line to users of the specified language only), separated by pipe characters. You can specify a structure using hyphens. For example:
<pre>
Moodle community|http://moodle.org
-Moodle free support|http://moodle.org/support
-Moodle development|http://moodle.org/development
--Moodle Tracker|http://tracker.moodle.org
---Moodle Docs|http://docs.moodle.org
--Moodle News|http://moodle.org/news
-Moodle company
+--Moodle Docs|http://docs.moodle.org|Moodle Docs in German
+--German Moodle Docs|http://docs.moodle.org/de|Documentation in German|de
+-Moodle News|http://moodle.org/news Moodle company
-Moodle commercial hosting|http://moodle.com/hosting
-Moodle commercial support|http://moodle.com/support
</pre>';
@@ -523,10 +523,10 @@
$string['filtersettings'] = 'Manage filters';
$string['filtersettingsgeneral'] = 'General filter settings';
$string['filteruploadedfiles'] = 'Filter uploaded files';
-$string['forcelogin'] = 'Force users to login';
-$string['forceloginforprofileimage'] = 'Force users to login to view user pictures';
+$string['forcelogin'] = 'Force users to log in';
+$string['forceloginforprofileimage'] = 'Force users to log in to view user pictures';
$string['forceloginforprofileimage_help'] = 'If enabled, users must login in order to view user profile pictures and the default user picture will be used in all notification emails.';
-$string['forceloginforprofiles'] = 'Force users to login for profiles';
+$string['forceloginforprofiles'] = 'Force users to log in for profiles';
$string['forcetimezone'] = 'Force default timezone';
$string['formatuninstallwithcourses'] = 'There are {$a->count} courses using {$a->format}. Their format will be changed to {$a->defaultformat} (default format for this site). Some format-specific data may be lost. Are you sure you want to proceed?';
$string['formatuninstallconfirm'] = '{$a} will be uninstalled. No courses currently use it. Continue?';
View
2  lang/en/completion.php
@@ -51,7 +51,7 @@
$string['completionexpected'] = 'Expect completed on';
$string['completionexpected_help']='This setting specifies the date when the activity is expected to be completed. The date is not shown to students and is only displayed in the activity completion report.';
$string['completionicons'] = 'Completion tick boxes';
-$string['completionicons_help'] = 'A tick next an activity name may be used to indicate when the activity is complete.
+$string['completionicons_help'] = 'A tick next to an activity name may be used to indicate when the activity is complete.
If a box with a dotted border is shown, a tick will appear automatically when you have completed the activity according to conditions set by the teacher.
View
2  lang/en/error.php
@@ -211,7 +211,7 @@
$string['duplicateroleshortname'] = 'There is already a role with this short name!';
$string['duplicateusername'] = 'Duplicate username - skipping record';
$string['emailfail'] = 'Emailing failed';
-$string['error'] = 'Error occured';
+$string['error'] = 'Error occurred';
$string['errorcleaningdirectory'] = 'Error cleaning directory "{$a}"';
$string['errorcopyingfiles'] = 'Error copying files';
$string['errorcreatingdirectory'] = 'Error creating directory "{$a}"';
View
2  lang/en/install.php
@@ -38,7 +38,7 @@
renaming the admin directory in your installation, and putting that
new name here. For example: <br /> <br /><b>moodleadmin</b><br /> <br />
This will fix admin links in Moodle.';
-$string['availablelangs'] = 'List of available languages';
+$string['availablelangs'] = 'Available language packs';
$string['caution'] = 'Caution';
$string['cliadminpassword'] = 'New admin user password';
$string['cliadminusername'] = 'Admin account username';
View
2  lang/en/mathslib.php
@@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['anunexpectederroroccured'] = 'an unexpected error occured';
+$string['anunexpectederroroccured'] = 'an unexpected error occurred';
$string['cannotassigntoconstant'] = 'cannot assign to constant \'{$a}\'';
$string['cannotredefinebuiltinfunction'] = 'cannot redefine built-in function \'{$a}()\'';
$string['divisionbyzero'] = 'division by zero';
View
1  lang/en/moodle.php
@@ -328,6 +328,7 @@
If you use this area to store course files, you can expose yourself to a number of privacy and security issues, as well as experiencing missing files in backups, course imports and any time content is shared or re-used. It is therefore recommended that you do not use this area unless you really know what you are doing.';
$string['courselegacyfiles_link'] = 'coursefiles2';
+$string['courselegacyfilesofcourse'] = 'Legacy course files: {$a}';
$string['courseoverview'] = 'Course overview';
$string['courseoverviewgraph'] = 'Course overview graph';
$string['courseprofiles'] = 'Course profiles';
View
2  lang/en/repository.php
@@ -102,7 +102,7 @@
$string['erroruniquename'] = 'Repository instance name should be unique';
$string['errorpostmaxsize'] = 'The uploaded file may exceed the post_max_size directive in php.ini.';
$string['errorwhilecommunicatingwith'] = 'Error while communicating with the repository \'{$a}\'.';
-$string['errorwhiledownload'] = 'An error occured while downloading the file: {$a}';
+$string['errorwhiledownload'] = 'An error occurred while downloading the file: {$a}';
$string['existingrepository'] = 'This repository already exists';
$string['federatedsearch'] = 'Federated search';
$string['fileexists'] = 'File name already being used, please use another name';
View
3  lib/configonlylib.php
@@ -95,6 +95,9 @@ function min_fix_utf8($value) {
error_reporting($olderror ^ E_NOTICE);
}
+ // No null bytes expected in our data, so let's remove it.
+ $value = str_replace("\0", '', $value);
+
static $buggyiconv = null;
if ($buggyiconv === null) {
$buggyiconv = (!function_exists('iconv') or iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'') !== '100€');
View
1  lib/dml/mssql_native_moodle_database.php
@@ -639,6 +639,7 @@ protected function emulate_bound_params($sql, array $params=null) {
} else {
$param = str_replace("'", "''", $param);
+ $param = str_replace("\0", "", $param);
$return .= "N'$param'";
}
View
1  lib/dml/sqlsrv_native_moodle_database.php
@@ -719,6 +719,7 @@ protected function emulate_bound_params($sql, array $params = null) {
$return .= $param;
} else {
$param = str_replace("'", "''", $param);
+ $param = str_replace("\0", "", $param);
$return .= "N'$param'";
}
View
7 lib/editor/tinymce/module.js
@@ -68,6 +68,13 @@ M.editor_tinymce.init_editor = function(Y, editorid, options) {
ed.contentDocument.addEventListener('keydown', function() {
ed.contentWindow.focus();
});
+
+ // Whenever a touch event is registered against the content document,
+ // reapply focus. This works around an issue with the location caret not
+ // being focusable without use of the Loupe.
+ ed.contentDocument.addEventListener('touchend', function() {
+ ed.contentWindow.focus();
+ });
});
};
}
View
8 lib/ldaplib.php
@@ -241,9 +241,11 @@ function ldap_find_userdn($ldapconnection, $username, $contexts, $objectclass, $
}
if ($search_sub) {
- $ldap_result = ldap_search($ldapconnection, $context,
- '(&'.$objectclass.'('.$search_attrib.'='.ldap_filter_addslashes($username).'))',
- array($search_attrib));
+ if (!$ldap_result = @ldap_search($ldapconnection, $context,
+ '(&'.$objectclass.'('.$search_attrib.'='.ldap_filter_addslashes($username).'))',
+ array($search_attrib))) {
+ break; // Not found in this context.
+ }
} else {
$ldap_result = ldap_list($ldapconnection, $context,
'(&'.$objectclass.'('.$search_attrib.'='.ldap_filter_addslashes($username).'))',
View
5 lib/modinfolib.php
@@ -1228,7 +1228,8 @@ public function is_user_access_restricted_by_capability() {
}
// You are blocked if you don't have the capability.
- return !has_capability($capability, context_module::instance($this->id));
+ $userid = $this->modinfo->get_user_id();
+ return !has_capability($capability, context_module::instance($this->id), $userid);
}
/**
@@ -1237,7 +1238,7 @@ public function is_user_access_restricted_by_capability() {
* @return bool True if the user cannot see the module. False if the activity is either available or should be greyed out.
*/
public function is_user_access_restricted_by_conditional_access() {
- global $CFG, $USER;
+ global $CFG;
if (empty($CFG->enableavailability)) {
return false;
View
2  lib/moodlelib.php
@@ -1164,6 +1164,8 @@ function fix_utf8($value) {
// shortcut
return $value;
}
+ // No null bytes expected in our data, so let's remove it.
+ $value = str_replace("\0", '', $value);
// Lower error reporting because glibc throws bogus notices.
$olderror = error_reporting();
View
2  lib/tests/configonlylib_test.php
@@ -44,7 +44,7 @@ class core_configonlylib_testcase extends advanced_testcase {
*/
public function test_min_fix_utf8() {
$this->assertSame('abc', min_fix_utf8('abc'));
- $this->assertSame("žlutý koníček přeskočil potůček \n\t\r\0", min_fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));
+ $this->assertSame("žlutý koníček přeskočil potůček \n\t\r", min_fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));
$this->assertSame('', min_fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.');
}
View
55 lib/tests/modinfolib_test.php
@@ -176,6 +176,61 @@ public function test_is_user_access_restricted_by_conditional_access() {
$this->assertFalse($cm_info->is_user_access_restricted_by_conditional_access());
}
+ public function test_is_user_access_restricted_by_capability() {
+ global $DB;
+
+ $this->resetAfterTest();
+
+ // Create a course and a mod_assign instance.
+ $course = $this->getDataGenerator()->create_course();
+ $assign = $this->getDataGenerator()->create_module('assign', array('course'=>$course->id));
+
+ // Create and enrol a student.
+ $coursecontext = context_course::instance($course->id);
+ $studentrole = $DB->get_record('role', array('shortname' => 'student'), '*', MUST_EXIST);
+ $student = $this->getDataGenerator()->create_user();
+ role_assign($studentrole->id, $student->id, $coursecontext);
+ $enrolplugin = enrol_get_plugin('manual');
+ $enrolinstance = $DB->get_record('enrol', array('courseid' => $course->id, 'enrol' => 'manual'));
+ $enrolplugin->enrol_user($enrolinstance, $student->id);
+ $this->setUser($student);
+
+ // Make sure student can see the module.
+ $cm = get_fast_modinfo($course->id)->instances['assign'][$assign->id];
+ $this->assertTrue($cm->uservisible);
+ $this->assertFalse($cm->is_user_access_restricted_by_capability());
+
+ // Prohibit student to view mod_assign for the course.
+ role_change_permission($studentrole->id, $coursecontext, 'mod/assign:view', CAP_PROHIBIT);
+ get_fast_modinfo($course->id, 0, true);
+ $cm = get_fast_modinfo($course->id)->instances['assign'][$assign->id];
+ $this->assertFalse($cm->uservisible);
+ $this->assertTrue($cm->is_user_access_restricted_by_capability());
+
+ // Restore permission to student to view mod_assign for the course.
+ role_change_permission($studentrole->id, $coursecontext, 'mod/assign:view', CAP_INHERIT);
+ get_fast_modinfo($course->id, 0, true);
+ $cm = get_fast_modinfo($course->id)->instances['assign'][$assign->id];
+ $this->assertTrue($cm->uservisible);
+ $this->assertFalse($cm->is_user_access_restricted_by_capability());
+
+ // Prohibit student to view mod_assign for the particular module.
+ role_change_permission($studentrole->id, context_module::instance($cm->id), 'mod/assign:view', CAP_PROHIBIT);
+ get_fast_modinfo($course->id, 0, true);
+ $cm = get_fast_modinfo($course->id)->instances['assign'][$assign->id];
+ $this->assertFalse($cm->uservisible);
+ $this->assertTrue($cm->is_user_access_restricted_by_capability());
+
+ // Check calling get_fast_modinfo() for different user:
+ $this->setAdminUser();
+ $cm = get_fast_modinfo($course->id)->instances['assign'][$assign->id];
+ $this->assertTrue($cm->uservisible);
+ $this->assertFalse($cm->is_user_access_restricted_by_capability());
+ $cm = get_fast_modinfo($course->id, $student->id)->instances['assign'][$assign->id];
+ $this->assertFalse($cm->uservisible);
+ $this->assertTrue($cm->is_user_access_restricted_by_capability());
+ }
+
private function refresh_cm_info($course, $assign) {
get_fast_modinfo(0, 0, true);
return get_fast_modinfo($course)->instances['assign'][$assign->id];
View
2  lib/tests/moodlelib_test.php
@@ -486,7 +486,7 @@ function test_fix_utf8() {
$this->assertEquals($object, fix_utf8($object));
// valid utf8 string
- $this->assertSame("žlutý koníček přeskočil potůček \n\t\r\0", fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));
+ $this->assertSame("žlutý koníček přeskočil potůček \n\t\r", fix_utf8("žlutý koníček přeskočil potůček \n\t\r\0"));
// invalid utf8 string
$this->assertSame('', fix_utf8('a'.chr(130).'š'), 'This fails with buggy iconv() when mbstring extenstion is not available as fallback.');
View
2  login/change_password.php
@@ -40,7 +40,7 @@
if ($return) {
// this redirect prevents security warning because https can not POST to http pages
if (empty($SESSION->wantsurl)
- or stripos(str_replace('https://', 'http://', $SESSION->wantsurl), str_replace('https://', 'http://', $CFG->wwwroot.'/login/change_password.php') === 0)) {
+ or stripos(str_replace('https://', 'http://', $SESSION->wantsurl), str_replace('https://', 'http://', $CFG->wwwroot.'/login/change_password.php')) === 0) {
$returnto = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$id";
} else {
$returnto = $SESSION->wantsurl;
View
3  mod/assign/backup/moodle2/restore_assign_stepslib.php
@@ -89,6 +89,9 @@ protected function process_assign($data) {
$data->cutoffdate = $this->apply_date_offset($data->cutoffdate);
}
+ if ($data->grade < 0) { // Scale found, get mapping.
+ $data->grade = -($this->get_mappingid('scale', abs($data->grade)));
+ }
$newitemid = $DB->insert_record('assign', $data);
View
11 mod/assign/locallib.php
@@ -3128,9 +3128,10 @@ private function gradebook_item_update($submission=NULL, $grade=NULL) {
$team = groups_get_members($submission->groupid, 'u.id');
foreach ($team as $member) {
- $submission->groupid = 0;
- $submission->userid = $member->id;
- $this->gradebook_item_update($submission, null);
+ $membersubmission = clone $submission;
+ $membersubmission->groupid = 0;
+ $membersubmission->userid = $member->id;
+ $this->gradebook_item_update($membersubmission, null);
}
return;
}
@@ -4472,7 +4473,7 @@ private function process_lock($userid = 0) {
// Give each submission plugin a chance to process the locking.
$plugins = $this->get_submission_plugins();
- $submission = $this->get_user_submission($userid, false);
+ $submission = $this->get_user_submission($userid, true);
foreach ($plugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$plugin->lock($submission);
@@ -4508,7 +4509,7 @@ private function process_unlock($userid = 0) {
// Give each submission plugin a chance to process the locking.
$plugins = $this->get_submission_plugins();
- $submission = $this->get_user_submission($userid, false);
+ $submission = $this->get_user_submission($userid, true);
foreach ($plugins as $plugin) {
if ($plugin->is_enabled() && $plugin->is_visible()) {
$plugin->unlock($submission);
View
9 mod/assignment/backup/moodle1/lib.php
@@ -194,7 +194,8 @@ protected function get_subplugin_handler($subplugin) {
}
if (!isset($this->subpluginhandlers[$subplugin])) {
- throw new moodle1_convert_exception('unsupported_subplugin', 'assignment_'.$subplugin);
+ // Generic handling, prevents breaking conversion process...
+ $this->subpluginhandlers[$subplugin] = new moodle1_assignment_unsupported_subplugin_handler($this, $subplugin);
}
return $this->subpluginhandlers[$subplugin];
@@ -236,4 +237,10 @@ public function append_subplugin_data($data) {
//you will probably want to do stuff with $this->xmlwriter here (within your overridden method) to write plugin specific data.
}
+}
+
+/**
+ * This class handles subplugins that do not exist or that are not supported
+ */
+class moodle1_assignment_unsupported_subplugin_handler extends moodle1_assignment_subplugin_handler {
}
View
20 mod/assignment/backup/moodle2/restore_assignment_stepslib.php
@@ -72,6 +72,11 @@ protected function process_assignment($data) {
$newitemid = $DB->insert_record('assignment', $data);
// immediately after inserting "activity" record, call this
$this->apply_activity_instance($newitemid);
+
+ // Hide unsupported sub-plugins
+ if (!$this->is_valid_assignment_subplugin($data->assignmenttype)) {
+ $DB->set_field('course_modules', 'visible', 0, array('id' => $this->get_task()->get_moduleid()));
+ }
}
protected function process_assignment_submission($data) {
@@ -100,4 +105,19 @@ protected function after_execute() {
$this->add_related_files('mod_assignment', 'submission', 'assignment_submission');
$this->add_related_files('mod_assignment', 'response', 'assignment_submission');
}
+
+ /**
+ * Determine if a sub-plugin is supported or not
+ *
+ * @param string $type
+ * @return bool
+ */
+ protected function is_valid_assignment_subplugin($type) {
+ static $subplugins = null;
+
+ if (is_null($subplugins)) {
+ $subplugins = get_plugin_list('assignment');
+ }
+ return array_key_exists($type, $subplugins);
+ }
}
View
1  mod/assignment/lang/en/assignment.php
@@ -223,3 +223,4 @@
$string['viewmysubmission'] = 'View my submission';
$string['viewsubmissions'] = 'View {$a} submitted assignments';
$string['yoursubmission'] = 'Your submission';
+$string['unsupportedsubplugin'] = 'The assignment type of \'{$a}\' is not currently supported. You may wait until the assignment type is made available, or delete the assignment.';
View
7 mod/assignment/lib.php
@@ -3948,7 +3948,12 @@ function assignment_extend_settings_navigation(settings_navigation $settings, na
global $PAGE, $DB, $USER, $CFG;
$assignmentrow = $DB->get_record("assignment", array("id" => $PAGE->cm->instance));
- require_once "$CFG->dirroot/mod/assignment/type/$assignmentrow->assignmenttype/assignment.class.php";
+
+ $classfile = "$CFG->dirroot/mod/assignment/type/$assignmentrow->assignmenttype/assignment.class.php";
+ if (!file_exists($classfile)) {
+ return;
+ }
+ require_once($classfile);
$assignmentclass = 'assignment_'.$assignmentrow->assignmenttype;
$assignmentinstance = new $assignmentclass($PAGE->cm->id, $assignmentrow, $PAGE->cm, $PAGE->course);
View
8 mod/assignment/mod_form.php
@@ -9,7 +9,7 @@ class mod_assignment_mod_form extends moodleform_mod {
protected $_assignmentinstance = null;
function definition() {
- global $CFG, $DB, $PAGE;
+ global $CFG, $DB, $PAGE, $COURSE;
$mform =& $this->_form;
// this hack is needed for different settings of each subtype
@@ -29,7 +29,11 @@ function definition() {
$mform->setType('type', PARAM_ALPHA);
$mform->setDefault('type', $type);
- require_once($CFG->dirroot.'/mod/assignment/type/'.$type.'/assignment.class.php');
+ $classfile = $CFG->dirroot.'/mod/assignment/type/'.$type.'/assignment.class.php';
+ if (!file_exists($classfile)) {
+ throw new moodle_exception('unsupportedsubplugin', 'assignment', new moodle_url('/course/view.php', array('id' => $COURSE->id)), $type);
+ }
+ require_once($classfile);
$assignmentclass = 'assignment_'.$type;
$assignmentinstance = new $assignmentclass();
View
6 mod/assignment/view.php
@@ -40,7 +40,11 @@
$PAGE->requires->js('/mod/assignment/assignment.js');
-require ("$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php");
+$classfile = "$CFG->dirroot/mod/assignment/type/$assignment->assignmenttype/assignment.class.php";
+if (!file_exists($classfile)) {
+ throw new moodle_exception('unsupportedsubplugin', 'assignment', new moodle_url('/course/view.php', array('id' => $course->id)), $assignment->assignmenttype);
+}
+require ($classfile);
$assignmentclass = "assignment_$assignment->assignmenttype";
$assignmentinstance = new $assignmentclass($cm->id, $assignment, $cm, $course);
View
12 mod/forum/lang/en/forum.php
@@ -408,14 +408,14 @@
$string['trackingoff'] = 'Off';
$string['trackingon'] = 'On';
$string['trackingoptional'] = 'Optional';
-$string['trackingtype'] = 'Read tracking for this forum?';
-$string['trackingtype_help'] = 'If enabled, participants can track read and unread messages in the forum and in discussions.
+$string['trackingtype'] = 'Read tracking';
+$string['trackingtype_help'] = 'If enabled, participants can track read and unread posts in the forum and in discussions. There are three options:
-There are three options:
-
-* Optional - Participants can choose whether to turn tracking on or off
+* Optional - Participants can choose whether to turn tracking on or off via a link in the administration block
* On - Tracking is always on
-* Off - Tracking is always off';
+* Off - Read and unread posts are not tracked
+
+Note: Forum tracking must also be enabled in the user\'s profile settings.';
$string['unread'] = 'Unread';
$string['unreadposts'] = 'Unread posts';
$string['unreadpostsnumber'] = '{$a} unread posts';
View
2  mod/lesson/lang/en/lesson.php
@@ -235,7 +235,7 @@
$string['maxgrade_help'] = 'This setting specifies the maximum grade for the lesson. If set to 0, the lesson does not appear in the grades pages.';
$string['maxhighscores'] = 'Number of high scores displayed';
$string['maximumnumberofanswersbranches'] = 'Maximum number of answers';
-$string['maximumnumberofanswersbranches_help'] = 'This setting specifies the maximum number of answers that may be used in the lesson. If only true/false questions are used, it can be set to 2. The setting may be changed at any time, since it only effects what the teacher sees, not the data.';
+$string['maximumnumberofanswersbranches_help'] = 'This setting specifies the maximum number of answers that may be used in the lesson. If only true/false questions are used, it can be set to 2. The setting may be changed at any time, since it only affects what the teacher sees, not the data.';
$string['maximumnumberofattempts'] = 'Maximum number of attempts';
$string['maximumnumberofattempts_help'] = 'This setting specifies the maximum number of attempts allowed for each question. If answered incorrectly repeatedly, when the maximum is reached, the next page of the lesson is displayed.';
$string['maximumnumberofattemptsreached'] = 'Maximum number of attempts reached - Moving to next page';
View
2  mod/lti/lang/en/lti.php
@@ -224,7 +224,7 @@
$string['lti:view'] = 'Launch external tool activities';
$string['lti_administration'] = 'LTI Administration';
$string['lti_errormsg'] = 'The tool returned the following error message: "{$a}"';
-$string['lti_launch_error'] = 'An error occured when launching the external tool: ';
+$string['lti_launch_error'] = 'An error occurred when launching the external tool:';
$string['lti_launch_error_tool_request'] = '<p>
To submit a request for an administrator to complete the tool configuration, click <a href="{$a->admin_request_url}" target="_top">here</a>.
</p>';
View
26 portfolio/googledocs/db/upgrade.php
@@ -20,6 +20,7 @@
*/
function xmldb_portfolio_googledocs_upgrade($oldversion) {
global $CFG, $DB;
+ require_once(__DIR__.'/upgradelib.php');
$dbman = $DB->get_manager();
@@ -49,28 +50,3 @@ function xmldb_portfolio_googledocs_upgrade($oldversion) {
return true;
}
-
-function portfolio_googledocs_admin_upgrade_notification() {
- $admins = get_admins();
-
- if (empty($admins)) {
- return;
- }
- $a = new stdClass;
- $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
-
- foreach ($admins as $admin) {
- $message = new stdClass();
- $message->component = 'moodle';
- $message->name = 'notices';
- $message->userfrom = get_admin();
- $message->userto = $admin;
- $message->smallmessage = get_string('oauth2upgrade_message_small', 'portfolio_googledocs');
- $message->subject = get_string('oauth2upgrade_message_subject', 'portfolio_googledocs');
- $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_googledocs', $a);
- $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_googledocs', $a);
- $message->fullmessageformat = FORMAT_PLAIN;
- $message->notification = 1;
- message_send($message);
- }
-}
View
53 portfolio/googledocs/db/upgradelib.php
@@ -0,0 +1,53 @@
+<?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/>.
+
+/**
+ * Googledocs portfolio upgrade script.
+ *
+ * @package portfolio_googledocs
+ * @copyright 2013 Dan Poltawski <dan@moodle.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * Inform admins about setup required for googledocs change.
+ */
+function portfolio_googledocs_admin_upgrade_notification() {
+ $admins = get_admins();
+
+ if (empty($admins)) {
+ return;
+ }
+ $a = new stdClass;
+ $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
+
+ foreach ($admins as $admin) {
+ $message = new stdClass();
+ $message->component = 'moodle';
+ $message->name = 'notices';
+ $message->userfrom = get_admin();
+ $message->userto = $admin;
+ $message->smallmessage = get_string('oauth2upgrade_message_small', 'portfolio_googledocs');
+ $message->subject = get_string('oauth2upgrade_message_subject', 'portfolio_googledocs');
+ $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_googledocs', $a);
+ $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_googledocs', $a);
+ $message->fullmessageformat = FORMAT_PLAIN;
+ $message->notification = 1;
+ message_send($message);
+ }
+}
View
26 portfolio/picasa/db/upgrade.php
@@ -20,6 +20,7 @@
*/
function xmldb_portfolio_picasa_upgrade($oldversion) {
global $CFG, $DB;
+ require_once(__DIR__.'/upgradelib.php');
$dbman = $DB->get_manager();
@@ -49,28 +50,3 @@ function xmldb_portfolio_picasa_upgrade($oldversion) {
return true;
}
-
-function portfolio_picasa_admin_upgrade_notification() {
- $admins = get_admins();
-
- if (empty($admins)) {
- return;
- }
- $a = new stdClass;
- $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
-
- foreach ($admins as $admin) {
- $message = new stdClass();
- $message->component = 'moodle';
- $message->name = 'notices';
- $message->userfrom = get_admin();
- $message->userto = $admin;
- $message->smallmessage = get_string('oauth2upgrade_message_small', 'portfolio_picasa');
- $message->subject = get_string('oauth2upgrade_message_subject', 'portfolio_picasa');
- $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_picasa', $a);
- $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_picasa', $a);
- $message->fullmessageformat = FORMAT_PLAIN;
- $message->notification = 1;
- message_send($message);
- }
-}
View
53 portfolio/picasa/db/upgradelib.php
@@ -0,0 +1,53 @@
+<?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/>.
+
+/**
+ * Picasa portfolio upgrade script.
+ *
+ * @package portfolio_picasa
+ * @copyright 2013 Dan Poltawski <dan@moodle.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * Inform admins about setup required for picasa change.
+ */
+function portfolio_picasa_admin_upgrade_notification() {
+ $admins = get_admins();
+
+ if (empty($admins)) {
+ return;
+ }
+ $a = new stdClass;
+ $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
+
+ foreach ($admins as $admin) {
+ $message = new stdClass();
+ $message->component = 'moodle';
+ $message->name = 'notices';
+ $message->userfrom = get_admin();
+ $message->userto = $admin;
+ $message->smallmessage = get_string('oauth2upgrade_message_small', 'portfolio_picasa');
+ $message->subject = get_string('oauth2upgrade_message_subject', 'portfolio_picasa');
+ $message->fullmessage = get_string('oauth2upgrade_message_content', 'portfolio_picasa', $a);
+ $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'portfolio_picasa', $a);
+ $message->fullmessageformat = FORMAT_PLAIN;
+ $message->notification = 1;
+ message_send($message);
+ }
+}
View
1  question/engine/lib.php
@@ -26,6 +26,7 @@
defined('MOODLE_INTERNAL') || die();
+require_once($CFG->libdir . '/filelib.php');
require_once(dirname(__FILE__) . '/questionusage.php');
require_once(dirname(__FILE__) . '/questionattempt.php');
require_once(dirname(__FILE__) . '/questionattemptstep.php');
View
2  report/security/lang/en/report_security.php
@@ -85,7 +85,7 @@
$string['check_noauth_error'] = 'The No authentication plugin cannot be used on production sites.';
$string['check_noauth_name'] = 'No authentication';
$string['check_noauth_ok'] = 'No authentication plugin is disabled.';
-$string['check_openprofiles_details'] = '<p>Open user profiles can be abused by spammers. It is recommended that either <code>Force users to login for profiles</code> or <code>Force users to login</code> are enabled.</p>';
+$string['check_openprofiles_details'] = 'Open user profiles can be abused by spammers. It is recommended that either <code>Force users to log in for profiles</code> or <code>Force users to log in</code> are enabled.';
$string['check_openprofiles_error'] = 'Anyone can may view user profiles without logging in.';
$string['check_openprofiles_name'] = 'Open user profiles';
$string['check_openprofiles_ok'] = 'Login is required before viewing user profiles.';
View
11 repository/coursefiles/lib.php
@@ -180,10 +180,15 @@ public function is_visible() {
return parent::is_visible();
}
+ /**
+ * Return the repository name.
+ *
+ * @return string
+ */
public function get_name() {
- list($context, $course, $cm) = get_context_info_array($this->context->id);
- if (!empty($course)) {
- return get_string('courselegacyfiles') . format_string($course->shortname, true, array('context' => get_course_context($context)));
+ $context = $this->context->get_course_context(false);
+ if ($context) {
+ return get_string('courselegacyfilesofcourse', 'moodle', $context->get_context_name(false, true));
} else {
return get_string('courselegacyfiles');
}
View
7 repository/filepicker.js
@@ -502,6 +502,7 @@ M.core_filepicker.show = function(Y, options) {
M.core_filepicker.init(Y, options);
}
M.core_filepicker.instances[options.client_id].show();
+ document.getElementById("filepicker-"+ options.client_id).focus();
};
M.core_filepicker.set_templates = function(Y, templates) {
@@ -1293,11 +1294,13 @@ M.core_filepicker.init = function(Y, options) {
},
render: function() {
var client_id = this.options.client_id;
+ var fpid = "filepicker-"+ client_id;
+ var labelid = 'fp-dialog-label_'+ client_id;
this.fpnode = Y.Node.createWithFilesSkin(M.core_filepicker.templates.generallayout).
- set('id', 'filepicker-'+client_id);
+ set('id', fpid).set('aria-labelledby', labelid);
this.mainui = new Y.Panel({
srcNode : this.fpnode,
- headerContent: M.str.repository.filepicker,
+ headerContent: '<span id="'+ labelid +'">'+ M.str.repository.filepicker +'</span>',
zIndex : 7500,
centered : true,
modal : true,
View
26 repository/googledocs/db/upgrade.php
@@ -20,6 +20,7 @@
*/
function xmldb_repository_googledocs_upgrade($oldversion) {
global $CFG, $DB;
+ require_once(__DIR__.'/upgradelib.php');
$dbman = $DB->get_manager();
@@ -52,28 +53,3 @@ function xmldb_repository_googledocs_upgrade($oldversion) {
return true;
}
-
-function repository_googledocs_admin_upgrade_notification() {
- $admins = get_admins();
-
- if (empty($admins)) {
- return;
- }
-
- $a = new stdClass;
- $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
- foreach ($admins as $admin) {
- $message = new stdClass();
- $message->component = 'moodle';
- $message->name = 'notices';
- $message->userfrom = get_admin();
- $message->userto = $admin;
- $message->smallmessage = get_string('oauth2upgrade_message_small', 'repository_googledocs');
- $message->subject = get_string('oauth2upgrade_message_subject', 'repository_googledocs');
- $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_googledocs', $a);
- $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_googledocs', $a);
- $message->fullmessageformat = FORMAT_PLAIN;
- $message->notification = 1;
- message_send($message);
- }
-}
View
53 repository/googledocs/db/upgradelib.php
@@ -0,0 +1,53 @@
+<?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/>.
+
+/**
+ * Googledocs repository upgrade script.
+ *
+ * @package repository_googledocs
+ * @copyright 2013 Dan Poltawski <dan@moodle.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * Inform admins about setup required for googledocs change.
+ */
+function repository_googledocs_admin_upgrade_notification() {
+ $admins = get_admins();
+
+ if (empty($admins)) {
+ return;
+ }
+
+ $a = new stdClass;
+ $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
+ foreach ($admins as $admin) {
+ $message = new stdClass();
+ $message->component = 'moodle';
+ $message->name = 'notices';
+ $message->userfrom = get_admin();
+ $message->userto = $admin;
+ $message->smallmessage = get_string('oauth2upgrade_message_small', 'repository_googledocs');
+ $message->subject = get_string('oauth2upgrade_message_subject', 'repository_googledocs');
+ $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_googledocs', $a);
+ $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_googledocs', $a);
+ $message->fullmessageformat = FORMAT_PLAIN;
+ $message->notification = 1;
+ message_send($message);
+ }
+}
View
13 repository/lib.php
@@ -255,6 +255,7 @@ public function create($silent = false) {
}
//run plugin_init function
if (!repository::static_function($this->_typename, 'plugin_init')) {
+ $this->update_visibility(false);
if (!$silent) {
throw new repository_exception('cannotinitplugin', 'repository');
}
@@ -1074,7 +1075,7 @@ public static function get_instance($id) {
*
* @static
* @param string $plugin repository plugin name
- * @param string $function funciton name
+ * @param string $function function name
* @return mixed
*/
public static function static_function($plugin, $function) {
@@ -1087,14 +1088,6 @@ public static function static_function($plugin, $function) {
return false;
}
- $pname = null;
- if (is_object($plugin) || is_array($plugin)) {
- $plugin = (object)$plugin;
- $pname = $plugin->name;
- } else {
- $pname = $plugin;
- }
-
$args = func_get_args();
if (count($args) <= 2) {
$args = array();
@@ -2306,7 +2299,7 @@ public function print_search() {
/**
* For oauth like external authentication, when external repository direct user back to moodle,
- * this funciton will be called to set up token and token_secret
+ * this function will be called to set up token and token_secret
*/
public function callback() {
}
View
26 repository/picasa/db/upgrade.php
@@ -20,6 +20,7 @@
*/
function xmldb_repository_picasa_upgrade($oldversion) {
global $CFG, $DB;
+ require_once(__DIR__.'/upgradelib.php');
$dbman = $DB->get_manager();
@@ -52,28 +53,3 @@ function xmldb_repository_picasa_upgrade($oldversion) {
return true;
}
-
-function repository_picasa_admin_upgrade_notification() {
- $admins = get_admins();
-
- if (empty($admins)) {
- return;
- }
- $a = new stdClass;
- $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
-
- foreach ($admins as $admin) {
- $message = new stdClass();
- $message->component = 'moodle';
- $message->name = 'notices';
- $message->userfrom = get_admin();
- $message->userto = $admin;
- $message->smallmessage = get_string('oauth2upgrade_message_small', 'repository_picasa');
- $message->subject = get_string('oauth2upgrade_message_subject', 'repository_picasa');
- $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_picasa', $a);
- $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_picasa', $a);
- $message->fullmessageformat = FORMAT_PLAIN;
- $message->notification = 1;
- message_send($message);
- }
-}
View
53 repository/picasa/db/upgradelib.php
@@ -0,0 +1,53 @@
+<?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/>.
+
+/**
+ * Picasa repository upgrade script.
+ *
+ * @package repository_picasa
+ * @copyright 2013 Dan Poltawski <dan@moodle.com>
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+/**
+ * Inform admins about setup required for google picasa change.
+ */
+function repository_picasa_admin_upgrade_notification() {
+ $admins = get_admins();
+
+ if (empty($admins)) {
+ return;
+ }
+ $a = new stdClass;
+ $a->docsurl = get_docs_url('Google_OAuth_2.0_setup');
+
+ foreach ($admins as $admin) {
+ $message = new stdClass();
+ $message->component = 'moodle';
+ $message->name = 'notices';
+ $message->userfrom = get_admin();
+ $message->userto = $admin;
+ $message->smallmessage = get_string('oauth2upgrade_message_small', 'repository_picasa');
+ $message->subject = get_string('oauth2upgrade_message_subject', 'repository_picasa');
+ $message->fullmessage = get_string('oauth2upgrade_message_content', 'repository_picasa', $a);
+ $message->fullmessagehtml = get_string('oauth2upgrade_message_content', 'repository_picasa', $a);
+ $message->fullmessageformat = FORMAT_PLAIN;
+ $message->notification = 1;
+ message_send($message);
+ }
+}
View
1  theme/base/style/core.css
@@ -301,6 +301,7 @@ input#id_externalurl {direction:ltr;}
.groupmanagementtable #potentialcell {width: 42%;}
.groupmanagementtable #buttonscell {width: 16%;}
.groupmanagementtable #buttonscell input {width: 80%;}
+.groupmanagementtable #buttonscell p.arrow_button input {width: auto;min-width: 80%;margin: 0 auto;}
.groupmanagementtable #removeselect_wrapper,
.groupmanagementtable #addselect_wrapper {width: 100%;}
.groupmanagementtable #removeselect_wrapper label,
View
3  user/messageselect.php
@@ -58,13 +58,12 @@
$url->param('deluser', $deluser);
}
$PAGE->set_url($url);
-$PAGE->set_context(context_system::instance());
if (!$course = $DB->get_record('course', array('id'=>$id))) {
print_error('invalidcourseid');
}
-require_login();
+require_login($course);
$coursecontext = context_course::instance($id); // Course context
$systemcontext = context_system::instance(); // SYSTEM context
View
2  user/profile/field/menu/lang/en/profilefield_menu.php
@@ -23,4 +23,4 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['pluginname'] = 'Menu of choices';
+$string['pluginname'] = 'Dropdown menu';
View
4 version.php
@@ -29,11 +29,11 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012120305.12; // 20121203 = branching date YYYYMMDD - do not modify!
+$version = 2012120305.13; // 20121203 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
-$release = '2.4.5+ (Build: 20130830)'; // Human-friendly version name
+$release = '2.4.5+ (Build: 20130905)'; // Human-friendly version name
$branch = '24'; // this version's branch
$maturity = MATURITY_STABLE; // this version's maturity level
Please sign in to comment.
Something went wrong with that request. Please try again.