Merge branch 'MDL-50812-master' of https://github.com/nashtechdev01/moodle
authorDavid Monllao <davidm@moodle.com>
Tue, 5 Jun 2018 09:51:09 +0000 (11:51 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 6 Jun 2018 09:16:13 +0000 (11:16 +0200)
166 files changed:
admin/tool/customlang/db/upgrade.php
admin/tool/dataprivacy/createdatarequest.php
admin/tool/log/db/upgrade.php
admin/tool/log/store/database/db/upgrade.php
admin/tool/log/store/standard/db/upgrade.php
admin/tool/monitor/db/upgrade.php
admin/tool/policy/classes/output/page_agreedocs.php
admin/tool/policy/index.php
admin/tool/policy/lib.php
admin/tool/policy/tests/behat/consent.feature
admin/tool/recyclebin/classes/category_bin.php
admin/tool/recyclebin/classes/course_bin.php
admin/tool/usertours/db/upgrade.php
auth/cas/db/upgrade.php
auth/db/db/upgrade.php
auth/email/db/upgrade.php
auth/ldap/db/upgrade.php
auth/manual/db/upgrade.php
auth/mnet/db/upgrade.php
auth/none/db/upgrade.php
auth/oauth2/db/upgrade.php
auth/shibboleth/db/upgrade.php
blocks/badges/db/upgrade.php
blocks/calendar_month/db/upgrade.php
blocks/calendar_upcoming/db/upgrade.php
blocks/community/db/upgrade.php
blocks/completionstatus/db/upgrade.php
blocks/course_summary/db/upgrade.php
blocks/html/db/upgrade.php
blocks/navigation/db/upgrade.php
blocks/quiz_results/db/upgrade.php
blocks/recent_activity/db/upgrade.php
blocks/rss_client/db/upgrade.php
blocks/section_links/db/upgrade.php
blocks/selfcompletion/db/upgrade.php
blocks/settings/db/upgrade.php
composer.json
composer.lock
course/classes/management_renderer.php
course/format/renderer.php
course/format/topics/db/upgrade.php
course/format/weeks/db/upgrade.php
course/management.php
course/renderer.php
course/tests/courselib_test.php
enrol/database/db/upgrade.php
enrol/flatfile/db/upgrade.php
enrol/guest/db/upgrade.php
enrol/imsenterprise/db/upgrade.php
enrol/lti/db/upgrade.php
enrol/manual/db/upgrade.php
enrol/mnet/db/upgrade.php
enrol/paypal/db/upgrade.php
enrol/self/db/upgrade.php
filter/mathjaxloader/db/upgrade.php
filter/mediaplugin/db/upgrade.php
filter/tex/db/upgrade.php
grade/grading/form/guide/db/upgrade.php
grade/grading/form/rubric/db/upgrade.php
grade/report/overview/db/upgrade.php
grade/report/user/db/upgrade.php
index.php
lib/antivirus/clamav/db/upgrade.php
lib/behat/classes/behat_config_util.php
lib/classes/oauth2/api.php
lib/classes/output/icon_system_fontawesome.php
lib/db/upgrade.php
lib/ddl/mysql_sql_generator.php
lib/dml/mariadb_native_moodle_database.php
lib/dml/mysqli_native_moodle_database.php
lib/editor/atto/db/upgrade.php
lib/editor/atto/plugins/equation/db/upgrade.php
lib/editor/tinymce/db/upgrade.php
lib/editor/tinymce/plugins/spellchecker/db/upgrade.php
lib/editor/tinymce/readme_moodle.txt
lib/editor/tinymce/tiny_mce/3.5.11/themes/advanced/skins/moodle/ui.css
lib/ltiprovider/readme_moodle.txt
lib/ltiprovider/src/ToolProvider/ToolProvider.php
lib/moodlelib.php
lib/templates/single_select.mustache
media/player/videojs/classes/plugin.php
message/output/email/db/upgrade.php
message/output/jabber/db/upgrade.php
message/output/popup/amd/build/notification_popover_controller.min.js
message/output/popup/amd/src/notification_popover_controller.js
message/output/popup/db/upgrade.php
message/output/popup/mark_notification_read.php [new file with mode: 0644]
message/templates/message_area_contact.mustache
mod/assign/db/upgrade.php
mod/assign/feedback/comments/db/upgrade.php
mod/assign/feedback/editpdf/db/upgrade.php
mod/assign/feedback/editpdf/styles.css
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js
mod/assign/feedback/editpdf/yui/src/editor/js/annotationhighlight.js
mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
mod/assign/feedback/file/db/upgrade.php
mod/assign/submission/comments/db/upgrade.php
mod/assign/submission/file/db/upgrade.php
mod/assign/submission/onlinetext/db/upgrade.php
mod/assignment/db/upgrade.php
mod/book/db/upgrade.php
mod/chat/db/upgrade.php
mod/choice/db/upgrade.php
mod/data/db/upgrade.php
mod/feedback/db/upgrade.php
mod/folder/db/upgrade.php
mod/forum/db/upgrade.php
mod/forum/rsslib.php
mod/forum/tests/rsslib_test.php [new file with mode: 0644]
mod/glossary/db/upgrade.php
mod/imscp/db/upgrade.php
mod/label/db/upgrade.php
mod/lesson/db/upgrade.php
mod/lesson/renderer.php
mod/lesson/tests/behat/lesson_delete_answers.feature
mod/lesson/tests/behat/lesson_edit_cluster.feature
mod/lesson/tests/behat/lesson_edit_pages.feature
mod/lti/db/upgrade.php
mod/page/db/upgrade.php
mod/quiz/db/upgrade.php
mod/quiz/report/overview/db/upgrade.php
mod/quiz/report/statistics/db/upgrade.php
mod/resource/db/upgrade.php
mod/scorm/db/upgrade.php
mod/survey/db/upgrade.php
mod/url/db/upgrade.php
mod/wiki/db/upgrade.php
mod/workshop/db/upgrade.php
mod/workshop/form/accumulative/db/upgrade.php
mod/workshop/form/comments/db/upgrade.php
mod/workshop/form/numerrors/db/upgrade.php
mod/workshop/form/rubric/db/upgrade.php
pix/t/online.png [new file with mode: 0644]
pix/t/online.svg [new file with mode: 0644]
portfolio/boxnet/db/upgrade.php
portfolio/googledocs/db/upgrade.php
portfolio/picasa/db/upgrade.php
question/behaviour/manualgraded/db/upgrade.php
question/tests/behat/edit_questions_standard_tags.feature [new file with mode: 0644]
question/type/calculated/db/upgrade.php
question/type/ddmarker/db/upgrade.php
question/type/edit_question_form.php
question/type/essay/db/upgrade.php
question/type/match/db/upgrade.php
question/type/multianswer/db/upgrade.php
question/type/multichoice/db/upgrade.php
question/type/numerical/db/upgrade.php
question/type/random/db/upgrade.php
question/type/randomsamatch/db/upgrade.php
question/type/shortanswer/db/upgrade.php
repository/boxnet/db/upgrade.php
repository/dropbox/db/upgrade.php
repository/flickr/db/upgrade.php
repository/googledocs/db/upgrade.php
repository/onedrive/db/upgrade.php
repository/picasa/db/upgrade.php
theme/boost/classes/output/core_course/management/renderer.php
theme/boost/scss/moodle/message.scss
theme/bootstrapbase/less/moodle/message.less
theme/bootstrapbase/style/moodle.css
theme/more/db/upgrade.php
user/classes/participants_table.php
version.php
webservice/xmlrpc/locallib.php

index a7ff6a3..e771cc9 100644 (file)
@@ -38,5 +38,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index cd7f575..83a5c90 100644 (file)
@@ -53,8 +53,9 @@ if ($manage) {
 $PAGE->set_context($context);
 
 // If contactdataprotectionofficer is disabled, send the user back to the profile page, or the privacy policy page.
-if (!\tool_dataprivacy\api::can_contact_dpo()) {
-    redirect($returnurl, get_string('contactdpoviaprivacypolicy', 'tool_dataprivacy'), \core\output\notification::NOTIFY_ERROR);
+// That is, unless you have sufficient capabilities to perform this on behalf of a user.
+if (!$manage && !\tool_dataprivacy\api::can_contact_dpo()) {
+    redirect($returnurl, get_string('contactdpoviaprivacypolicy', 'tool_dataprivacy'), 0, \core\output\notification::NOTIFY_ERROR);
 }
 
 $mform = new tool_dataprivacy_data_request_form($url->out(false), ['manage' => !empty($manage)]);
index 06d7441..2c7e2b0 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_tool_log_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f9c8a8b..7b6fed2 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 610b61c..f0dd415 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 1358647..67fbb42 100644 (file)
@@ -76,5 +76,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5ede161..af6ebd6 100644 (file)
@@ -69,6 +69,9 @@ class page_agreedocs implements renderable, templatable {
     /** @var array Info or error messages to show. */
     protected $messages = [];
 
+    /** @var bool This is an existing user (rather than non-loggedin/guest). */
+    protected $isexistinguser;
+
     /**
      * Prepare the page for rendering.
      *
@@ -87,6 +90,7 @@ class page_agreedocs implements renderable, templatable {
 
         $this->action = $action;
 
+        $this->isexistinguser = isloggedin() && !isguestuser();
         $behalfid = $behalfid ?: $USER->id;
         if ($realuser->id != $behalfid) {
             $this->behalfuser = core_user::get_user($behalfid, '*', MUST_EXIST);
@@ -112,7 +116,7 @@ class page_agreedocs implements renderable, templatable {
     protected function accept_and_revoke_policies() {
         global $USER;
 
-        if (!empty($USER->id)) {
+        if ($this->isexistinguser) {
             // Existing user.
             if (!empty($this->action) && confirm_sesskey()) {
                 // The form has been sent. Update policies acceptances according to $this->agreedocs.
@@ -182,15 +186,13 @@ class page_agreedocs implements renderable, templatable {
      * Before display the consent page, the user has to view all the still-non-accepted policy docs.
      * This function checks if the non-accepted policy docs have been shown and redirect to them.
      *
-     * @param array $userid User identifier who wants to access to the consent page.
-     * @param url $returnurl URL to return after shown the policy docs.
+     * @param int $userid User identifier who wants to access to the consent page.
+     * @param moodle_url $returnurl URL to return after shown the policy docs.
      */
     protected function redirect_to_policies($userid, $returnurl = null) {
-        global $USER;
-
-        $acceptances = api::get_user_acceptances($userid);
         $allpolicies = $this->policies;
-        if (!empty($userid)) {
+        if ($this->isexistinguser) {
+            $acceptances = api::get_user_acceptances($userid);
             foreach ($allpolicies as $policy) {
                 if (api::is_user_version_accepted($userid, $policy->id, $acceptances)) {
                     // If this version is accepted by the user, remove from the pending policies list.
@@ -234,16 +236,30 @@ class page_agreedocs implements renderable, templatable {
     }
 
     /**
-     * Redirect to $SESSION->wantsurl if defined or to $CFG->wwwroot if not.
+     * Redirect to signup page if defined or to $CFG->wwwroot if not.
      */
     protected function redirect_to_previous_url() {
         global $SESSION;
 
-        if (!empty($SESSION->wantsurl)) {
-            $returnurl = $SESSION->wantsurl;
-            unset($SESSION->wantsurl);
+        if ($this->isexistinguser) {
+            // Existing user.
+            if (!empty($SESSION->wantsurl)) {
+                $returnurl = $SESSION->wantsurl;
+                unset($SESSION->wantsurl);
+            } else {
+                $returnurl = new moodle_url('/admin/tool/policy/user.php');
+            }
         } else {
-            $returnurl = (new moodle_url('/admin/tool/policy/user.php'))->out();
+            // Non-authenticated user.
+            $issignup = \cache::make('core', 'presignup')->get('tool_policy_issignup');
+            if ($issignup) {
+                // User came here from signup page - redirect back there.
+                $returnurl = new moodle_url('/login/signup.php');
+                \cache::make('core', 'presignup')->set('tool_policy_issignup', false);
+            } else {
+                // Guests should not be on this page unless it's part of signup - redirect home.
+                $returnurl = new moodle_url('/');
+            }
         }
 
         redirect($returnurl);
@@ -255,35 +271,35 @@ class page_agreedocs implements renderable, templatable {
      * @param int $userid
      */
     protected function prepare_global_page_access($userid) {
-        global $PAGE, $SESSION, $SITE, $USER;
+        global $PAGE, $SITE, $USER;
 
         // Guest users or not logged users (but the users during the signup process) are not allowed to access to this page.
-        $newsignupuser = !empty($SESSION->wantsurl) && strpos($SESSION->wantsurl, 'login/signup.php') !== false;
-        if (isguestuser() || (empty($USER->id) && !$newsignupuser)) {
+        $newsignupuser = \cache::make('core', 'presignup')->get('tool_policy_issignup');
+        if (!$this->isexistinguser && !$newsignupuser) {
             $this->redirect_to_previous_url();
         }
 
         // Check for correct user capabilities.
-        if (!empty($USER->id)) {
+        if ($this->isexistinguser) {
             // For existing users, it's needed to check if they have the capability for accepting policies.
             api::can_accept_policies($this->behalfid, true);
         } else {
             // For new users, the behalfid parameter is ignored.
-            if ($this->behalfid != $USER->id) {
+            if ($this->behalfid) {
                 redirect(new moodle_url('/admin/tool/policy/index.php'));
             }
         }
 
         // If the current user has the $USER->policyagreed = 1 or $userpolicyagreed = 1
-        // and $SESSION->wantsurl is defined, redirect to the return page.
-        $hasagreedsignupuser = empty($USER->id) && $this->signupuserpolicyagreed;
+        // redirect to the return page.
+        $hasagreedsignupuser = !$this->isexistinguser && $this->signupuserpolicyagreed;
         $hasagreedloggeduser = $USER->id == $userid && !empty($USER->policyagreed);
         if (!is_siteadmin() && ($hasagreedsignupuser || $hasagreedloggeduser)) {
             $this->redirect_to_previous_url();
         }
 
         $myparams = [];
-        if (!empty($USER->id) && !empty($this->behalfid) && $this->behalfid != $USER->id) {
+        if ($this->isexistinguser && !empty($this->behalfid) && $this->behalfid != $USER->id) {
             $myparams['userid'] = $this->behalfid;
         }
         $myurl = new moodle_url('/admin/tool/policy/index.php', $myparams);
@@ -308,7 +324,6 @@ class page_agreedocs implements renderable, templatable {
         global $USER;
 
         // Get all the policy version acceptances for this user.
-        $acceptances = api::get_user_acceptances($userid);
         $lang = current_language();
         foreach ($this->policies as $policy) {
             // Get a link to display the full policy document.
@@ -320,9 +335,10 @@ class page_agreedocs implements renderable, templatable {
             $policymodal = html_writer::link($policy->url, $policy->name, $policyattributes);
 
             // Check if this policy version has been agreed or not.
-            if (!empty($userid)) {
+            if ($this->isexistinguser) {
                 // Existing user.
                 $versionagreed = false;
+                $acceptances = api::get_user_acceptances($userid);
                 $policy->versionacceptance = api::get_user_version_acceptance($userid, $policy->id, $acceptances);
                 if (!empty($policy->versionacceptance)) {
                     // The policy version has ever been agreed. Check if status = 1 to know if still is accepted.
@@ -352,13 +368,13 @@ class page_agreedocs implements renderable, templatable {
      * Export the page data for the mustache template.
      *
      * @param renderer_base $output renderer to be used to render the page elements.
-     * @return stdClass
+     * @return \stdClass
      */
     public function export_for_template(renderer_base $output) {
         global $USER;
 
         $myparams = [];
-        if (!empty($USER->id) && !empty($this->behalfid) && $this->behalfid != $USER->id) {
+        if ($this->isexistinguser && !empty($this->behalfid) && $this->behalfid != $USER->id) {
             $myparams['userid'] = $this->behalfid;
         }
         $data = (object) [
index 4be8554..067d8fa 100644 (file)
@@ -45,7 +45,7 @@ $PAGE->set_pagelayout('standard');
 $PAGE->set_url('/admin/tool/policy/index.php');
 $PAGE->set_popup_notification_allowed(false);
 
-if (!empty($USER->id)) {
+if (isloggedin() && !isguestuser()) {
     // Existing user.
     $haspermissionagreedocs = api::can_accept_policies($behalfid);
 } else {
index 6c9afa9..3073212 100644 (file)
@@ -116,7 +116,7 @@ function tool_policy_standard_footer_html() {
  * Hooks redirection to policy acceptance pages before sign up.
  */
 function tool_policy_pre_signup_requests() {
-    global $CFG, $SESSION;
+    global $CFG;
 
     // Do nothing if we are not set as the site policies handler.
     if (empty($CFG->sitepolicyhandler) || $CFG->sitepolicyhandler !== 'tool_policy') {
@@ -127,7 +127,7 @@ function tool_policy_pre_signup_requests() {
     $userpolicyagreed = cache::make('core', 'presignup')->get('tool_policy_userpolicyagreed');
     if (!empty($policies) && !$userpolicyagreed) {
         // Redirect to "Policy" pages for consenting before creating the user.
-        $SESSION->wantsurl = (new \moodle_url('/login/signup.php'))->out();
+        cache::make('core', 'presignup')->set('tool_policy_issignup', 1);
         redirect(new \moodle_url('/admin/tool/policy/index.php'));
     }
 }
index ec9aae6..fde43cc 100644 (file)
@@ -611,3 +611,55 @@ Feature: User must accept policy managed by this plugin when logging in and sign
     And I should see "Policies and agreements"
     And I should see "No permission to agree to the policies on behalf of this user"
     And I should see "Sorry, you do not have the required permission to agree to the following policies on behalf of User 1"
+
+  Scenario: Accept policy on sign up as a guest, one policy
+    Given the following config values are set as admin:
+      | registerauth    | email |
+      | passwordpolicy  | 0     |
+      | sitepolicyhandler | tool_policy |
+    Given the following policies exist:
+      | Policy | Name             | Revision | Content    | Summary     | Status   |
+      | P1     | This site policy |          | full text1 | short text1 | archived |
+      | P1     | This site policy |          | full text2 | short text2 | active   |
+      | P1     | This site policy |          | full text3 | short text3 | draft    |
+    And I am on site homepage
+    And I follow "Log in"
+    # First log in as a guest
+    And I press "Log in as a guest"
+    # Now sign up
+    And I follow "Log in"
+    When I press "Create new account"
+    Then I should see "This site policy"
+    And I should see "short text2"
+    And I should see "full text2"
+    And I press "Next"
+    And I should see "Please agree to the following policies"
+    And I should see "This site policy"
+    And I should see "short text2"
+    And I should not see "full text2"
+    And I set the field "I agree to the This site policy" to "1"
+    And I press "Next"
+    And I should not see "I understand and agree"
+    And I set the following fields to these values:
+      | Username      | user1                 |
+      | Password      | user1                 |
+      | Email address | user1@address.invalid |
+      | Email (again) | user1@address.invalid |
+      | First name    | User1                 |
+      | Surname       | L1                    |
+    And I press "Create my new account"
+    And I should see "Confirm your account"
+    And I should see "An email should have been sent to your address at user1@address.invalid"
+    And I confirm email for "user1"
+    And I should see "Thanks, User1 L1"
+    And I should see "Your registration has been confirmed"
+    And I open my profile in edit mode
+    And the field "First name" matches value "User1"
+    And I log out
+    # Confirm that user can login and browse the site.
+    And I log in as "user1"
+    And I follow "Profile" in the user menu
+    # User can see his own agreements in the profile.
+    And I follow "Policies and agreements"
+    And "Agreed" "icon" should exist in the "This site policy" "table_row"
+    And I log out
index 26d8b53..b08b6a5 100644 (file)
@@ -288,13 +288,24 @@ class category_bin extends base_bin {
         global $DB;
 
         // Grab the course category context.
-        $context = \context_coursecat::instance($this->_categoryid);
-
-        // Delete the files.
-        $fs = get_file_storage();
-        $files = $fs->get_area_files($context->id, 'tool_recyclebin', TOOL_RECYCLEBIN_COURSECAT_BIN_FILEAREA, $item->id);
-        foreach ($files as $file) {
-            $file->delete();
+        $context = \context_coursecat::instance($this->_categoryid, IGNORE_MISSING);
+        if (!empty($context)) {
+            // Delete the files.
+            $fs = get_file_storage();
+            $fs->delete_area_files($context->id, 'tool_recyclebin', TOOL_RECYCLEBIN_COURSECAT_BIN_FILEAREA, $item->id);
+        } else {
+            // Course category has been deleted. Find records using $item->id as this is unique for coursecat recylebin.
+            $files = $DB->get_recordset('files', [
+                'component' => 'tool_recyclebin',
+                'filearea' => TOOL_RECYCLEBIN_COURSECAT_BIN_FILEAREA,
+                'itemid' => $item->id,
+            ]);
+            $fs = get_file_storage();
+            foreach ($files as $filer) {
+                $file = $fs->get_file_instance($filer);
+                $file->delete();
+            }
+            $files->close();
         }
 
         // Delete the record.
@@ -302,6 +313,11 @@ class category_bin extends base_bin {
             'id' => $item->id
         ));
 
+        // The coursecat might have been deleted, check we have a context before triggering event.
+        if (!$context) {
+            return;
+        }
+
         // Fire event.
         $event = \tool_recyclebin\event\category_bin_item_deleted::create(array(
             'objectid' => $item->id,
index e935d69..fb5d779 100644 (file)
@@ -274,13 +274,25 @@ class course_bin extends base_bin {
         global $DB;
 
         // Grab the course context.
-        $context = \context_course::instance($this->_courseid);
-
-        // Delete the files.
-        $fs = get_file_storage();
-        $files = $fs->get_area_files($context->id, 'tool_recyclebin', TOOL_RECYCLEBIN_COURSE_BIN_FILEAREA, $item->id);
-        foreach ($files as $file) {
-            $file->delete();
+        $context = \context_course::instance($this->_courseid, IGNORE_MISSING);
+
+        if (!empty($context)) {
+            // Delete the files.
+            $fs = get_file_storage();
+            $fs->delete_area_files($context->id, 'tool_recyclebin', TOOL_RECYCLEBIN_COURSE_BIN_FILEAREA, $item->id);
+        } else {
+            // Course context has been deleted. Find records using $item->id as this is unique for course bin recyclebin.
+            $files = $DB->get_recordset('files', [
+                'component' => 'tool_recyclebin',
+                'filearea' => TOOL_RECYCLEBIN_COURSE_BIN_FILEAREA,
+                'itemid' => $item->id,
+            ]);
+            $fs = get_file_storage();
+            foreach ($files as $filer) {
+                $file = $fs->get_file_instance($filer);
+                $file->delete();
+            }
+            $files->close();
         }
 
         // Delete the record.
index c564472..088b76b 100644 (file)
@@ -51,5 +51,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f3999b3..f331335 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 621a17e..57bdd1e 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_auth_db_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 9af8c79..0ad4e2d 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_auth_email_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 02f1323..2132366 100644 (file)
@@ -66,5 +66,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 03dbdb2..40499cd 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 9db6da9..09690f0 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 981d9ee..aa1ad76 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_auth_none_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d213cce..4d7a093 100644 (file)
@@ -44,5 +44,8 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 43e07dd..9dbf7c3 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index bb9b3cf..a352f44 100644 (file)
@@ -54,5 +54,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 4403a77..81eec4e 100644 (file)
@@ -54,5 +54,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index dbe19a5..3e768b0 100644 (file)
@@ -54,5 +54,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d01face..30d70e3 100644 (file)
@@ -55,5 +55,8 @@ function xmldb_block_community_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f0837fc..ce5ac4b 100644 (file)
@@ -57,5 +57,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 763a538..d0872b4 100644 (file)
@@ -57,5 +57,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5ad7f22..930ebde 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_block_html_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 07b4381..f6fca69 100644 (file)
@@ -64,5 +64,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 18ee857..144a6d5 100644 (file)
@@ -54,5 +54,8 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d9bf407..570c792 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d968dda..c4888e8 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_block_rss_client_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 0200032..c8b43b7 100644 (file)
@@ -58,5 +58,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 7e5e56a..285658f 100644 (file)
@@ -57,5 +57,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 2a9dceb..842c428 100644 (file)
@@ -64,5 +64,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 3c6ddd6..5b526cc 100644 (file)
@@ -7,7 +7,7 @@
     "require-dev": {
         "phpunit/phpunit": "6.5.*",
         "phpunit/dbUnit": "3.0.*",
-        "moodlehq/behat-extension": "3.35.1",
+        "moodlehq/behat-extension": "3.36.0",
         "mikey179/vfsStream": "^1.6"
     }
 }
index c79a846..e8aaa2f 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "content-hash": "f047772340a956bbf2c02d91536b11c6",
+    "content-hash": "956ce0b653b805efb6a9a483f8c9a847",
     "packages": [],
     "packages-dev": [
         {
         },
         {
             "name": "behat/mink-browserkit-driver",
-            "version": "v1.3.2",
+            "version": "1.3.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/minkphp/MinkBrowserKitDriver.git",
-                "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb"
+                "reference": "1b9a7ce903cfdaaec5fb32bfdbb26118343662eb"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/10e67fb4a295efcd62ea0bf16025a85ea19534fb",
-                "reference": "10e67fb4a295efcd62ea0bf16025a85ea19534fb",
+                "url": "https://api.github.com/repos/minkphp/MinkBrowserKitDriver/zipball/1b9a7ce903cfdaaec5fb32bfdbb26118343662eb",
+                "reference": "1b9a7ce903cfdaaec5fb32bfdbb26118343662eb",
                 "shasum": ""
             },
             "require": {
                 "behat/mink": "^1.7.1@dev",
                 "php": ">=5.3.6",
-                "symfony/browser-kit": "~2.3|~3.0",
-                "symfony/dom-crawler": "~2.3|~3.0"
+                "symfony/browser-kit": "~2.3|~3.0|~4.0",
+                "symfony/dom-crawler": "~2.3|~3.0|~4.0"
             },
             "require-dev": {
-                "silex/silex": "~1.2",
-                "symfony/phpunit-bridge": "~2.7|~3.0"
+                "mink/driver-testsuite": "dev-master",
+                "symfony/http-kernel": "~2.3|~3.0|~4.0"
             },
             "type": "mink-driver",
             "extra": {
                 "browser",
                 "testing"
             ],
-            "time": "2016-03-05T08:59:47+00:00"
+            "time": "2018-05-02T09:25:31+00:00"
         },
         {
             "name": "behat/mink-extension",
         },
         {
             "name": "guzzlehttp/guzzle",
-            "version": "6.3.0",
+            "version": "6.3.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
+                "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
-                "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
+                "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
                 "shasum": ""
             },
             "require": {
             },
             "require-dev": {
                 "ext-curl": "*",
-                "phpunit/phpunit": "^4.0 || ^5.0",
+                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
                 "psr/log": "^1.0"
             },
             "suggest": {
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "6.2-dev"
+                    "dev-master": "6.3-dev"
                 }
             },
             "autoload": {
                 "rest",
                 "web service"
             ],
-            "time": "2017-06-22T18:50:49+00:00"
+            "time": "2018-04-22T15:46:56+00:00"
         },
         {
             "name": "guzzlehttp/promises",
         },
         {
             "name": "moodlehq/behat-extension",
-            "version": "v3.35.1",
+            "version": "v3.36.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/moodlehq/moodle-behat-extension.git",
-                "reference": "e6e92fd551185f73603bad5694e854f3f6906e0e"
+                "reference": "ba8c4b8b323e05f7af128604f3f3dc60c953135a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/e6e92fd551185f73603bad5694e854f3f6906e0e",
-                "reference": "e6e92fd551185f73603bad5694e854f3f6906e0e",
+                "url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/ba8c4b8b323e05f7af128604f3f3dc60c953135a",
+                "reference": "ba8c4b8b323e05f7af128604f3f3dc60c953135a",
                 "shasum": ""
             },
             "require": {
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
-                "GPLv3"
+                "GPL-3.0-or-later"
             ],
             "authors": [
                 {
                 "Behat",
                 "moodle"
             ],
-            "time": "2018-01-24T14:09:40+00:00"
+            "time": "2018-02-04T18:04:02+00:00"
         },
         {
             "name": "myclabs/deep-copy",
         },
         {
             "name": "phpspec/prophecy",
-            "version": "1.7.5",
+            "version": "1.7.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpspec/prophecy.git",
-                "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401"
+                "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401",
-                "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401",
+                "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
+                "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712",
                 "shasum": ""
             },
             "require": {
                 "doctrine/instantiator": "^1.0.2",
                 "php": "^5.3|^7.0",
                 "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
-                "sebastian/comparator": "^1.1|^2.0",
+                "sebastian/comparator": "^1.1|^2.0|^3.0",
                 "sebastian/recursion-context": "^1.0|^2.0|^3.0"
             },
             "require-dev": {
                 "spy",
                 "stub"
             ],
-            "time": "2018-02-19T10:16:54+00:00"
+            "time": "2018-04-18T13:57:24+00:00"
         },
         {
             "name": "phpunit/dbunit",
         },
         {
             "name": "phpunit/php-code-coverage",
-            "version": "5.3.0",
+            "version": "5.3.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
-                "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1"
+                "reference": "c89677919c5dd6d3b3852f230a663118762218ac"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1",
-                "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1",
+                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac",
+                "reference": "c89677919c5dd6d3b3852f230a663118762218ac",
                 "shasum": ""
             },
             "require": {
                 "testing",
                 "xunit"
             ],
-            "time": "2017-12-06T09:29:45+00:00"
+            "time": "2018-04-06T15:36:58+00:00"
         },
         {
             "name": "phpunit/php-file-iterator",
         },
         {
             "name": "phpunit/phpunit",
-            "version": "6.5.7",
+            "version": "6.5.8",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/phpunit.git",
-                "reference": "6bd77b57707c236833d2b57b968e403df060c9d9"
+                "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6bd77b57707c236833d2b57b968e403df060c9d9",
-                "reference": "6bd77b57707c236833d2b57b968e403df060c9d9",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
+                "reference": "4f21a3c6b97c42952fd5c2837bb354ec0199b97b",
                 "shasum": ""
             },
             "require": {
                 "testing",
                 "xunit"
             ],
-            "time": "2018-02-26T07:01:09+00:00"
+            "time": "2018-04-10T11:38:34+00:00"
         },
         {
             "name": "phpunit/phpunit-mock-objects",
-            "version": "5.0.6",
+            "version": "5.0.7",
             "source": {
                 "type": "git",
                 "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
-                "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf"
+                "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
-                "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3eaf040f20154d27d6da59ca2c6e28ac8fd56dce",
+                "reference": "3eaf040f20154d27d6da59ca2c6e28ac8fd56dce",
                 "shasum": ""
             },
             "require": {
                 "mock",
                 "xunit"
             ],
-            "time": "2018-01-06T05:45:45+00:00"
+            "time": "2018-05-29T13:50:43+00:00"
         },
         {
             "name": "psr/container",
         },
         {
             "name": "symfony/browser-kit",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/browser-kit.git",
-                "reference": "490f27762705c8489bd042fe3e9377a191dba9b4"
+                "reference": "840bb6f0d5b3701fd768b68adf7193c2d0f98f79"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/browser-kit/zipball/490f27762705c8489bd042fe3e9377a191dba9b4",
-                "reference": "490f27762705c8489bd042fe3e9377a191dba9b4",
+                "url": "https://api.github.com/repos/symfony/browser-kit/zipball/840bb6f0d5b3701fd768b68adf7193c2d0f98f79",
+                "reference": "840bb6f0d5b3701fd768b68adf7193c2d0f98f79",
                 "shasum": ""
             },
             "require": {
             ],
             "description": "Symfony BrowserKit Component",
             "homepage": "https://symfony.com",
-            "time": "2018-01-03T07:37:34+00:00"
+            "time": "2018-03-19T22:32:39+00:00"
         },
         {
             "name": "symfony/class-loader",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/class-loader.git",
         },
         {
             "name": "symfony/config",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/config.git",
-                "reference": "05e10567b529476a006b00746c5f538f1636810e"
+                "reference": "73e055cf2e6467715f187724a0347ea32079967c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/config/zipball/05e10567b529476a006b00746c5f538f1636810e",
-                "reference": "05e10567b529476a006b00746c5f538f1636810e",
+                "url": "https://api.github.com/repos/symfony/config/zipball/73e055cf2e6467715f187724a0347ea32079967c",
+                "reference": "73e055cf2e6467715f187724a0347ea32079967c",
                 "shasum": ""
             },
             "require": {
                 "php": "^5.5.9|>=7.0.8",
-                "symfony/filesystem": "~2.8|~3.0|~4.0"
+                "symfony/filesystem": "~2.8|~3.0|~4.0",
+                "symfony/polyfill-ctype": "~1.8"
             },
             "conflict": {
                 "symfony/dependency-injection": "<3.3",
             ],
             "description": "Symfony Config Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-14T10:03:57+00:00"
+            "time": "2018-05-14T16:49:53+00:00"
         },
         {
             "name": "symfony/console",
-            "version": "v3.3.16",
+            "version": "v3.3.17",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
         },
         {
             "name": "symfony/css-selector",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/css-selector.git",
-                "reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a"
+                "reference": "d2ce52290b648ae33b5301d09bc14ee378612914"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/css-selector/zipball/544655f1fc078a9cd839fdda2b7b1e64627c826a",
-                "reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a",
+                "url": "https://api.github.com/repos/symfony/css-selector/zipball/d2ce52290b648ae33b5301d09bc14ee378612914",
+                "reference": "d2ce52290b648ae33b5301d09bc14ee378612914",
                 "shasum": ""
             },
             "require": {
             ],
             "description": "Symfony CssSelector Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-03T14:55:07+00:00"
+            "time": "2018-05-16T12:49:49+00:00"
         },
         {
             "name": "symfony/debug",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/debug.git",
-                "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc"
+                "reference": "b28fd73fefbac341f673f5efd707d539d6a19f68"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/debug/zipball/9b1071f86e79e1999b3d3675d2e0e7684268b9bc",
-                "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc",
+                "url": "https://api.github.com/repos/symfony/debug/zipball/b28fd73fefbac341f673f5efd707d539d6a19f68",
+                "reference": "b28fd73fefbac341f673f5efd707d539d6a19f68",
                 "shasum": ""
             },
             "require": {
             ],
             "description": "Symfony Debug Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-28T21:49:22+00:00"
+            "time": "2018-05-16T14:03:39+00:00"
         },
         {
             "name": "symfony/dependency-injection",
-            "version": "v3.3.16",
+            "version": "v3.3.17",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/dependency-injection.git",
         },
         {
             "name": "symfony/dom-crawler",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/dom-crawler.git",
-                "reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d"
+                "reference": "201b210fafcdd193c1e45b2994bf7133fb6263e8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2bb5d3101cc01f4fe580e536daf4f1959bc2d24d",
-                "reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d",
+                "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/201b210fafcdd193c1e45b2994bf7133fb6263e8",
+                "reference": "201b210fafcdd193c1e45b2994bf7133fb6263e8",
                 "shasum": ""
             },
             "require": {
                 "php": "^5.5.9|>=7.0.8",
+                "symfony/polyfill-ctype": "~1.8",
                 "symfony/polyfill-mbstring": "~1.0"
             },
             "require-dev": {
             ],
             "description": "Symfony DomCrawler Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-22T10:48:49+00:00"
+            "time": "2018-05-01T22:53:27+00:00"
         },
         {
             "name": "symfony/event-dispatcher",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/event-dispatcher.git",
-                "reference": "58990682ac3fdc1f563b7e705452921372aad11d"
+                "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/58990682ac3fdc1f563b7e705452921372aad11d",
-                "reference": "58990682ac3fdc1f563b7e705452921372aad11d",
+                "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/fdd5abcebd1061ec647089c6c41a07ed60af09f8",
+                "reference": "fdd5abcebd1061ec647089c6c41a07ed60af09f8",
                 "shasum": ""
             },
             "require": {
             ],
             "description": "Symfony EventDispatcher Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-14T10:03:57+00:00"
+            "time": "2018-04-06T07:35:25+00:00"
         },
         {
             "name": "symfony/filesystem",
-            "version": "v3.4.6",
+            "version": "v3.4.11",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/filesystem.git",
-                "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541"
+                "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/filesystem/zipball/253a4490b528597aa14d2bf5aeded6f5e5e4a541",
-                "reference": "253a4490b528597aa14d2bf5aeded6f5e5e4a541",
+                "url": "https://api.github.com/repos/symfony/filesystem/zipball/8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0",
+                "reference": "8e03ca3fa52a0f56b87506f38cf7bd3f9442b3a0",
                 "shasum": ""
             },
             "require": {
-                "php": "^5.5.9|>=7.0.8"
+                "php": "^5.5.9|>=7.0.8",
+                "symfony/polyfill-ctype": "~1.8"
             },
             "type": "library",
             "extra": {
             ],
             "description": "Symfony Filesystem Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-22T10:48:49+00:00"
+            "time": "2018-05-16T08:49:21+00:00"
+        },
+        {
+            "name": "symfony/polyfill-ctype",
+            "version": "v1.8.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-ctype.git",
+                "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
+                "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.3"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.8-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Ctype\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                },
+                {
+                    "name": "Gert de Pagter",
+                    "email": "BackEndTea@gmail.com"
+                }
+            ],
+            "description": "Symfony polyfill for ctype functions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "ctype",
+                "polyfill",
+                "portable"
+            ],
+            "time": "2018-04-30T19:57:29+00:00"
         },
         {
             "name": "symfony/polyfill-mbstring",
-            "version": "v1.7.0",
+            "version": "v1.8.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/polyfill-mbstring.git",
-                "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
-                "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171",
+                "reference": "3296adf6a6454a050679cde90f95350ad604b171",
                 "shasum": ""
             },
             "require": {
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "1.7-dev"
+                    "dev-master": "1.8-dev"
                 }
             },
             "autoload": {
                 "portable",
                 "shim"
             ],
-            "time": "2018-01-30T19:27:44+00:00"
+            "time": "2018-04-26T10:06:28+00:00"
         },
         {
             "name": "symfony/process",
-            "version": "v2.8.36",
+            "version": "v2.8.41",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/process.git",
-                "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9"
+                "reference": "713952f2ccbcc8342ecdbe1cb313d3e2da8aad28"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/process/zipball/756f614c5061729ea245ac6717231f7e3bfb74f9",
-                "reference": "756f614c5061729ea245ac6717231f7e3bfb74f9",
+                "url": "https://api.github.com/repos/symfony/process/zipball/713952f2ccbcc8342ecdbe1cb313d3e2da8aad28",
+                "reference": "713952f2ccbcc8342ecdbe1cb313d3e2da8aad28",
                 "shasum": ""
             },
             "require": {
             ],
             "description": "Symfony Process Component",
             "homepage": "https://symfony.com",
-            "time": "2018-02-12T17:44:58+00:00"
+            "time": "2018-05-15T21:17:45+00:00"
         },
         {
             "name": "symfony/translation",
-            "version": "v3.3.16",
+            "version": "v3.3.17",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/translation.git",
         },
         {
             "name": "symfony/yaml",
-            "version": "v3.3.16",
+            "version": "v3.3.17",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/yaml.git",
index 56e47e9..f66cd8c 100644 (file)
@@ -484,9 +484,11 @@ class core_course_management_renderer extends plugin_renderer_base {
      * @param course_in_list $course The currently selected course.
      * @param int $page The page being displayed.
      * @param int $perpage The number of courses to display per page.
+     * @param string|null $viewmode The view mode the page is in, one out of 'default', 'combined', 'courses' or 'categories'.
      * @return string
      */
-    public function course_listing(coursecat $category = null, course_in_list $course = null, $page = 0, $perpage = 20) {
+    public function course_listing(coursecat $category = null, course_in_list $course = null, $page = 0, $perpage = 20,
+        $viewmode = 'default') {
 
         if ($category === null) {
             $html = html_writer::start_div('select-a-category');
@@ -527,13 +529,13 @@ class core_course_management_renderer extends plugin_renderer_base {
         $html .= html_writer::tag('h3', $category->get_formatted_name(),
             array('id' => 'course-listing-title', 'tabindex' => '0'));
         $html .= $this->course_listing_actions($category, $course, $perpage);
-        $html .= $this->listing_pagination($category, $page, $perpage);
+        $html .= $this->listing_pagination($category, $page, $perpage, false, $viewmode);
         $html .= html_writer::start_tag('ul', array('class' => 'ml-1 course-list', 'role' => 'group'));
         foreach ($category->get_courses($options) as $listitem) {
             $html .= $this->course_listitem($category, $listitem, $courseid);
         }
         $html .= html_writer::end_tag('ul');
-        $html .= $this->listing_pagination($category, $page, $perpage, true);
+        $html .= $this->listing_pagination($category, $page, $perpage, true, $viewmode);
         $html .= $this->course_bulk_actions($category);
         $html .= html_writer::end_div();
         return $html;
@@ -546,9 +548,10 @@ class core_course_management_renderer extends plugin_renderer_base {
      * @param int $page The current page.
      * @param int $perpage The number of courses to display per page.
      * @param bool $showtotals Set to true to show the total number of courses and what is being displayed.
+     * @param string|null $viewmode The view mode the page is in, one out of 'default', 'combined', 'courses' or 'categories'.
      * @return string
      */
-    protected function listing_pagination(coursecat $category, $page, $perpage, $showtotals = false) {
+    protected function listing_pagination(coursecat $category, $page, $perpage, $showtotals = false, $viewmode = 'default') {
         $html = '';
         $totalcourses = $category->get_courses_count();
         $totalpages = ceil($totalcourses / $perpage);
@@ -582,7 +585,12 @@ class core_course_management_renderer extends plugin_renderer_base {
             }
         }
         $items = array();
-        $baseurl = new moodle_url('/course/management.php', array('categoryid' => $category->id));
+        if ($viewmode !== 'default') {
+            $baseurl = new moodle_url('/course/management.php', array('categoryid' => $category->id,
+                'view' => $viewmode));
+        } else {
+            $baseurl = new moodle_url('/course/management.php', array('categoryid' => $category->id));
+        }
         if ($page > 0) {
             $items[] = $this->action_button(new moodle_url($baseurl, array('page' => 0)), get_string('first'));
             $items[] = $this->action_button(new moodle_url($baseurl, array('page' => $page - 1)), get_string('prev'));
index b12e4c6..357c0a3 100644 (file)
@@ -414,7 +414,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
     }
 
     /**
-     * Generate a summary of a section for display on the 'coruse index page'
+     * Generate a summary of a section for display on the 'course index page'
      *
      * @param stdClass $section The course_section entry from DB
      * @param stdClass $course The course entry from DB
@@ -604,7 +604,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
      * Show if something is on on the course clipboard (moving around)
      *
      * @param stdClass $course The course entry from DB
-     * @param int $sectionno The section number in the coruse which is being dsiplayed
+     * @param int $sectionno The section number in the course which is being displayed
      * @return string HTML to output.
      */
     protected function course_activity_clipboard($course, $sectionno = null) {
@@ -634,7 +634,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
      *
      * @param stdClass $course The course entry from DB
      * @param array $sections The course_sections entries from the DB
-     * @param int $sectionno The section number in the coruse which is being dsiplayed
+     * @param int $sectionno The section number in the course which is being displayed
      * @return array associative array with previous and next section link
      */
     protected function get_nav_links($course, $sections, $sectionno) {
@@ -679,7 +679,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
     /**
      * Generate the header html of a stealth section
      *
-     * @param int $sectionno The section number in the coruse which is being dsiplayed
+     * @param int $sectionno The section number in the course which is being displayed
      * @return string HTML to output.
      */
     protected function stealth_section_header($sectionno) {
@@ -709,7 +709,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
     /**
      * Generate the html for a hidden section
      *
-     * @param int $sectionno The section number in the coruse which is being dsiplayed
+     * @param int $sectionno The section number in the course which is being displayed
      * @param int|stdClass $courseorid The course to get the section name for (object or just course id)
      * @return string HTML to output.
      */
index 3f35b53..e4e4ac1 100644 (file)
@@ -59,5 +59,8 @@ function xmldb_format_topics_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2018030900, 'format', 'topics');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a68f713..893d716 100644 (file)
@@ -95,5 +95,8 @@ function xmldb_format_weeks_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2018030900, 'format', 'weeks');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8c4d6ff..b083e28 100644 (file)
@@ -495,7 +495,7 @@ if ($displaycategorylisting) {
 if ($displaycourselisting) {
     echo $renderer->grid_column_start($coursesize, 'course-listing');
     if (!$issearching) {
-        echo $renderer->course_listing($category, $course, $page, $perpage);
+        echo $renderer->course_listing($category, $course, $page, $perpage, $viewmode);
     } else {
         list($courses, $coursescount, $coursestotal) =
             \core_course\management\helper::search_courses($search, $blocklist, $modulelist, $page, $perpage);
index 68767ff..b3cd970 100644 (file)
@@ -2311,6 +2311,208 @@ class core_course_renderer extends plugin_renderer_base {
 
         return $hubdescription;
     }
+
+    /**
+     * Output frontpage summary text and frontpage modules (stored as section 1 in site course)
+     *
+     * This may be disabled in settings
+     *
+     * @return string
+     */
+    public function frontpage_section1() {
+        global $SITE, $USER;
+
+        $output = '';
+        $editing = $this->page->user_is_editing();
+
+        if ($editing) {
+            // Make sure section with number 1 exists.
+            course_create_sections_if_missing($SITE, 1);
+        }
+
+        $modinfo = get_fast_modinfo($SITE);
+        $section = $modinfo->get_section_info(1);
+        if (($section && (!empty($modinfo->sections[1]) or !empty($section->summary))) or $editing) {
+            $output .= $this->box_start('generalbox sitetopic');
+
+            // If currently moving a file then show the current clipboard.
+            if (ismoving($SITE->id)) {
+                $stractivityclipboard = strip_tags(get_string('activityclipboard', '', $USER->activitycopyname));
+                $output .= '<p><font size="2">';
+                $cancelcopyurl = new moodle_url('/course/mod.php', ['cancelcopy' => 'true', 'sesskey' => sesskey()]);
+                $output .= "$stractivityclipboard&nbsp;&nbsp;(" . html_writer::link($cancelcopyurl, get_string('cancel')) .')';
+                $output .= '</font></p>';
+            }
+
+            $context = context_course::instance(SITEID);
+
+            // If the section name is set we show it.
+            if (trim($section->name) !== '') {
+                $output .= $this->heading(
+                    format_string($section->name, true, array('context' => $context)),
+                    2,
+                    'sectionname'
+                );
+            }
+
+            $summarytext = file_rewrite_pluginfile_urls($section->summary,
+                'pluginfile.php',
+                $context->id,
+                'course',
+                'section',
+                $section->id);
+            $summaryformatoptions = new stdClass();
+            $summaryformatoptions->noclean = true;
+            $summaryformatoptions->overflowdiv = true;
+
+            $output .= format_text($summarytext, $section->summaryformat, $summaryformatoptions);
+
+            if ($editing && has_capability('moodle/course:update', $context)) {
+                $streditsummary = get_string('editsummary');
+                $editsectionurl = new moodle_url('/course/editsection.php', ['id' => $section->id]);
+                $output .= html_writer::link($editsectionurl, $this->pix_icon('t/edit', $streditsummary)) .
+                    "<br /><br />";
+            }
+
+            $output .= $this->course_section_cm_list($SITE, $section);
+
+            $output .= $this->course_section_add_cm_control($SITE, $section->section);
+            $output .= $this->box_end();
+        }
+
+        return $output;
+    }
+
+    /**
+     * Output news for the frontpage (extract from site-wide news forum)
+     *
+     * @param stdClass $newsforum record from db table 'forum' that represents the site news forum
+     * @return string
+     */
+    protected function frontpage_news($newsforum) {
+        global $CFG, $SITE, $SESSION, $USER;
+        require_once($CFG->dirroot .'/mod/forum/lib.php');
+
+        $output = '';
+
+        if (isloggedin()) {
+            $SESSION->fromdiscussion = $CFG->wwwroot;
+            $subtext = '';
+            if (\mod_forum\subscriptions::is_subscribed($USER->id, $newsforum)) {
+                if (!\mod_forum\subscriptions::is_forcesubscribed($newsforum)) {
+                    $subtext = get_string('unsubscribe', 'forum');
+                }
+            } else {
+                $subtext = get_string('subscribe', 'forum');
+            }
+            $suburl = new moodle_url('/mod/forum/subscribe.php', array('id' => $newsforum->id, 'sesskey' => sesskey()));
+            $output .= html_writer::tag('div', html_writer::link($suburl, $subtext), array('class' => 'subscribelink'));
+        }
+
+        ob_start();
+        forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'plain', 'p.modified DESC');
+        $output .= ob_get_contents();
+        ob_end_clean();
+
+        return $output;
+    }
+
+    /**
+     * Renders part of frontpage with a skip link (i.e. "My courses", "Site news", etc.)
+     *
+     * @param string $skipdivid
+     * @param string $contentsdivid
+     * @param string $header Header of the part
+     * @param string $contents Contents of the part
+     * @return string
+     */
+    protected function frontpage_part($skipdivid, $contentsdivid, $header, $contents) {
+        $output = html_writer::link('#' . $skipdivid,
+            get_string('skipa', 'access', core_text::strtolower(strip_tags($header))),
+            array('class' => 'skip-block skip'));
+
+        // Wrap frontpage part in div container.
+        $output .= html_writer::start_tag('div', array('id' => $contentsdivid));
+        $output .= $this->heading($header);
+
+        $output .= $contents;
+
+        // End frontpage part div container.
+        $output .= html_writer::end_tag('div');
+
+        $output .= html_writer::tag('span', '', array('class' => 'skip-block-to', 'id' => $skipdivid));
+        return $output;
+    }
+
+    /**
+     * Outputs contents for frontpage as configured in $CFG->frontpage or $CFG->frontpageloggedin
+     *
+     * @return string
+     */
+    public function frontpage() {
+        global $CFG, $SITE;
+
+        $output = '';
+
+        if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) {
+            $frontpagelayout = $CFG->frontpageloggedin;
+        } else {
+            $frontpagelayout = $CFG->frontpage;
+        }
+
+        foreach (explode(',', $frontpagelayout) as $v) {
+            switch ($v) {
+                // Display the main part of the front page.
+                case FRONTPAGENEWS:
+                    if ($SITE->newsitems) {
+                        // Print forums only when needed.
+                        require_once($CFG->dirroot .'/mod/forum/lib.php');
+                        if (($newsforum = forum_get_course_forum($SITE->id, 'news')) &&
+                                ($forumcontents = $this->frontpage_news($newsforum))) {
+                            $newsforumcm = get_fast_modinfo($SITE)->instances['forum'][$newsforum->id];
+                            $output .= $this->frontpage_part('skipsitenews', 'site-news-forum',
+                                $newsforumcm->get_formatted_name(), $forumcontents);
+                        }
+                    }
+                    break;
+
+                case FRONTPAGEENROLLEDCOURSELIST:
+                    $mycourseshtml = $this->frontpage_my_courses();
+                    if (!empty($mycourseshtml)) {
+                        $output .= $this->frontpage_part('skipmycourses', 'frontpage-course-list',
+                            get_string('mycourses'), $mycourseshtml);
+                        break;
+                    }
+                    // No "break" here. If there are no enrolled courses - continue to 'Available courses'.
+
+                case FRONTPAGEALLCOURSELIST:
+                    $availablecourseshtml = $this->frontpage_available_courses();
+                    if (!empty($availablecourseshtml)) {
+                        $output .= $this->frontpage_part('skipavailablecourses', 'frontpage-available-course-list',
+                            get_string('availablecourses'), $availablecourseshtml);
+                    }
+                    break;
+
+                case FRONTPAGECATEGORYNAMES:
+                    $output .= $this->frontpage_part('skipcategories', 'frontpage-category-names',
+                        get_string('categories'), $this->frontpage_categories_list());
+                    break;
+
+                case FRONTPAGECATEGORYCOMBO:
+                    $output .= $this->frontpage_part('skipcourses', 'frontpage-category-combo',
+                        get_string('courses'), $this->frontpage_combo_list());
+                    break;
+
+                case FRONTPAGECOURSESEARCH:
+                    $output .= $this->box($this->course_search_form('', 'short'), 'mdl-align');
+                    break;
+
+            }
+            $output .= '<br />';
+        }
+
+        return $output;
+    }
 }
 
 /**
index 546b020..249948d 100644 (file)
@@ -863,7 +863,7 @@ class core_course_courselib_testcase extends advanced_testcase {
         // Test move the marked section down..
         move_section_to($course, 2, 4);
 
-        // Verify that the coruse marker has been moved along with the section..
+        // Verify that the course marker has been moved along with the section..
         $course = $DB->get_record('course', array('id' => $course->id));
         $this->assertEquals(4, $course->marker);
 
index 351cf66..38122c2 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_enrol_database_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 59ae42e..91590e5 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_enrol_flatfile_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index cb6fb76..8785b4f 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_enrol_guest_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a4e1df7..bc6dd13 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 353a7ad..aae9a1d 100644 (file)
@@ -264,5 +264,8 @@ function xmldb_enrol_lti_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index cec4ea4..4760dde 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_enrol_manual_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 6f22cca..d313c11 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_enrol_mnet_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index bdbbbf6..ad195b1 100644 (file)
@@ -54,5 +54,8 @@ function xmldb_enrol_paypal_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 4965298..d5e81ad 100644 (file)
@@ -51,5 +51,8 @@ function xmldb_enrol_self_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5294046..3080092 100644 (file)
@@ -183,5 +183,8 @@ MathJax.Hub.Config({
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c89fab9..705aeaf 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_filter_mediaplugin_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 53cc010..7f85c8a 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_filter_tex_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 5677911..6566abf 100644 (file)
@@ -46,5 +46,8 @@ function xmldb_gradingform_guide_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 92e65e3..1150ad0 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_gradingform_rubric_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index b083ffb..7c212ca 100644 (file)
@@ -48,5 +48,8 @@ function xmldb_gradereport_overview_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index ea9d000..892e6b3 100644 (file)
@@ -38,5 +38,8 @@ function xmldb_gradereport_user_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 502093c..01b2b5f 100644 (file)
--- a/index.php
+++ b/index.php
@@ -111,215 +111,27 @@ $PAGE->set_heading($SITE->fullname);
 $courserenderer = $PAGE->get_renderer('core', 'course');
 echo $OUTPUT->header();
 
-// Print Section or custom info.
 $siteformatoptions = course_get_format($SITE)->get_format_options();
 $modinfo = get_fast_modinfo($SITE);
-$modnames = get_module_types_names();
-$modnamesplural = get_module_types_names(true);
 $modnamesused = $modinfo->get_used_module_names();
-$mods = $modinfo->get_cms();
 
+// Print Section or custom info.
 if (!empty($CFG->customfrontpageinclude)) {
+    // Pre-fill some variables that custom front page might use.
+    $modnames = get_module_types_names();
+    $modnamesplural = get_module_types_names(true);
+    $mods = $modinfo->get_cms();
+
     include($CFG->customfrontpageinclude);
 
 } else if ($siteformatoptions['numsections'] > 0) {
-    if ($editing) {
-        // Make sure section with number 1 exists.
-        course_create_sections_if_missing($SITE, 1);
-        // Re-request modinfo in case section was created.
-        $modinfo = get_fast_modinfo($SITE);
-    }
-    $section = $modinfo->get_section_info(1);
-    if (($section && (!empty($modinfo->sections[1]) or !empty($section->summary))) or $editing) {
-        echo $OUTPUT->box_start('generalbox sitetopic');
-
-        // If currently moving a file then show the current clipboard.
-        if (ismoving($SITE->id)) {
-            $stractivityclipboard = strip_tags(get_string('activityclipboard', '', $USER->activitycopyname));
-            echo '<p><font size="2">';
-            echo "$stractivityclipboard&nbsp;&nbsp;(<a href=\"course/mod.php?cancelcopy=true&amp;sesskey=".sesskey()."\">";
-            echo get_string('cancel') . '</a>)';
-            echo '</font></p>';
-        }
-
-        $context = context_course::instance(SITEID);
-
-        // If the section name is set we show it.
-        if (trim($section->name) !== '') {
-            echo $OUTPUT->heading(
-                format_string($section->name, true, array('context' => $context)),
-                2,
-                'sectionname'
-            );
-        }
-
-        $summarytext = file_rewrite_pluginfile_urls($section->summary,
-            'pluginfile.php',
-            $context->id,
-            'course',
-            'section',
-            $section->id);
-        $summaryformatoptions = new stdClass();
-        $summaryformatoptions->noclean = true;
-        $summaryformatoptions->overflowdiv = true;
-
-        echo format_text($summarytext, $section->summaryformat, $summaryformatoptions);
-
-        if ($editing && has_capability('moodle/course:update', $context)) {
-            $streditsummary = get_string('editsummary');
-            echo "<a title=\"$streditsummary\" " .
-                 " href=\"course/editsection.php?id=$section->id\">" . $OUTPUT->pix_icon('t/edit', $streditsummary) .
-                 "</a><br /><br />";
-        }
-
-        $courserenderer = $PAGE->get_renderer('core', 'course');
-        echo $courserenderer->course_section_cm_list($SITE, $section);
-
-        echo $courserenderer->course_section_add_cm_control($SITE, $section->section);
-        echo $OUTPUT->box_end();
-    }
+    echo $courserenderer->frontpage_section1();
 }
 // Include course AJAX.
 include_course_ajax($SITE, $modnamesused);
 
-if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) {
-    $frontpagelayout = $CFG->frontpageloggedin;
-} else {
-    $frontpagelayout = $CFG->frontpage;
-}
-
-foreach (explode(',', $frontpagelayout) as $v) {
-    switch ($v) {
-        // Display the main part of the front page.
-        case FRONTPAGENEWS:
-            if ($SITE->newsitems) {
-                // Print forums only when needed.
-                require_once($CFG->dirroot .'/mod/forum/lib.php');
-
-                if (! $newsforum = forum_get_course_forum($SITE->id, 'news')) {
-                    print_error('cannotfindorcreateforum', 'forum');
-                }
-
-                // Fetch news forum context for proper filtering to happen.
-                $newsforumcm = get_coursemodule_from_instance('forum', $newsforum->id, $SITE->id, false, MUST_EXIST);
-                $newsforumcontext = context_module::instance($newsforumcm->id, MUST_EXIST);
-
-                $forumname = format_string($newsforum->name, true, array('context' => $newsforumcontext));
-                echo html_writer::link('#skipsitenews',
-                    get_string('skipa', 'access', core_text::strtolower(strip_tags($forumname))),
-                    array('class' => 'skip-block skip'));
-
-                // Wraps site news forum in div container.
-                echo html_writer::start_tag('div', array('id' => 'site-news-forum'));
-
-                if (isloggedin()) {
-                    $SESSION->fromdiscussion = $CFG->wwwroot;
-                    $subtext = '';
-                    if (\mod_forum\subscriptions::is_subscribed($USER->id, $newsforum)) {
-                        if (!\mod_forum\subscriptions::is_forcesubscribed($newsforum)) {
-                            $subtext = get_string('unsubscribe', 'forum');
-                        }
-                    } else {
-                        $subtext = get_string('subscribe', 'forum');
-                    }
-                    echo $OUTPUT->heading($forumname);
-                    $suburl = new moodle_url('/mod/forum/subscribe.php', array('id' => $newsforum->id, 'sesskey' => sesskey()));
-                    echo html_writer::tag('div', html_writer::link($suburl, $subtext), array('class' => 'subscribelink'));
-                } else {
-                    echo $OUTPUT->heading($forumname);
-                }
-
-                forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'plain', 'p.modified DESC');
-
-                // End site news forum div container.
-                echo html_writer::end_tag('div');
+echo $courserenderer->frontpage();
 
-                echo html_writer::tag('span', '', array('class' => 'skip-block-to', 'id' => 'skipsitenews'));
-            }
-        break;
-
-        case FRONTPAGEENROLLEDCOURSELIST:
-            $mycourseshtml = $courserenderer->frontpage_my_courses();
-            if (!empty($mycourseshtml)) {
-                echo html_writer::link('#skipmycourses',
-                    get_string('skipa', 'access', core_text::strtolower(get_string('mycourses'))),
-                    array('class' => 'skip skip-block'));
-
-                // Wrap frontpage course list in div container.
-                echo html_writer::start_tag('div', array('id' => 'frontpage-course-list'));
-
-                echo $OUTPUT->heading(get_string('mycourses'));
-                echo $mycourseshtml;
-
-                // End frontpage course list div container.
-                echo html_writer::end_tag('div');
-
-                echo html_writer::tag('span', '', array('class' => 'skip-block-to', 'id' => 'skipmycourses'));
-                break;
-            }
-            // No "break" here. If there are no enrolled courses - continue to 'Available courses'.
-
-        case FRONTPAGEALLCOURSELIST:
-            $availablecourseshtml = $courserenderer->frontpage_available_courses();
-            if (!empty($availablecourseshtml)) {
-                echo html_writer::link('#skipavailablecourses',
-                    get_string('skipa', 'access', core_text::strtolower(get_string('availablecourses'))),
-                    array('class' => 'skip skip-block'));
-
-                // Wrap frontpage course list in div container.
-                echo html_writer::start_tag('div', array('id' => 'frontpage-course-list'));
-
-                echo $OUTPUT->heading(get_string('availablecourses'));
-                echo $availablecourseshtml;
-
-                // End frontpage course list div container.
-                echo html_writer::end_tag('div');
-
-                echo html_writer::tag('span', '', array('class' => 'skip-block-to', 'id' => 'skipavailablecourses'));
-            }
-        break;
-
-        case FRONTPAGECATEGORYNAMES:
-            echo html_writer::link('#skipcategories',
-                get_string('skipa', 'access', core_text::strtolower(get_string('categories'))),
-                array('class' => 'skip skip-block'));
-
-            // Wrap frontpage category names in div container.
-            echo html_writer::start_tag('div', array('id' => 'frontpage-category-names'));
-
-            echo $OUTPUT->heading(get_string('categories'));
-            echo $courserenderer->frontpage_categories_list();
-
-            // End frontpage category names div container.
-            echo html_writer::end_tag('div');
-
-            echo html_writer::tag('span', '', array('class' => 'skip-block-to', 'id' => 'skipcategories'));
-        break;
-
-        case FRONTPAGECATEGORYCOMBO:
-            echo html_writer::link('#skipcourses',
-                get_string('skipa', 'access', core_text::strtolower(get_string('courses'))),
-                array('class' => 'skip skip-block'));
-
-            // Wrap frontpage category combo in div container.
-            echo html_writer::start_tag('div', array('id' => 'frontpage-category-combo'));
-
-            echo $OUTPUT->heading(get_string('courses'));
-            echo $courserenderer->frontpage_combo_list();
-
-            // End frontpage category combo div container.
-            echo html_writer::end_tag('div');
-
-            echo html_writer::tag('span', '', array('class' => 'skip-block-to', 'id' => 'skipcourses'));
-        break;
-
-        case FRONTPAGECOURSESEARCH:
-            echo $OUTPUT->box($courserenderer->course_search_form('', 'short'), 'mdl-align');
-        break;
-
-    }
-    echo '<br />';
-}
 if ($editing && has_capability('moodle/course:create', context_system::instance())) {
     echo $courserenderer->add_new_course_button();
 }
index e1b678b..b0e6493 100644 (file)
@@ -57,5 +57,8 @@ function xmldb_antivirus_clamav_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 1546d0b..e393580 100644 (file)
@@ -672,7 +672,7 @@ class behat_config_util {
     public function profile_guided_allocate($features, $nbuckets, $instance) {
 
         // No profile guided allocation is required in phpunit.
-        if (defined('PHPUNIT_TEST')) {
+        if (defined('PHPUNIT_TEST') && PHPUNIT_TEST) {
             return false;
         }
 
@@ -725,7 +725,8 @@ class behat_config_util {
             $totalweight += $weight;
         }
 
-        if ($totalweight && !defined('BEHAT_DISABLE_HISTOGRAM') && $instance == $nbuckets && !defined('PHPUNIT_TEST')) {
+        if ($totalweight && !defined('BEHAT_DISABLE_HISTOGRAM') && $instance == $nbuckets
+                && (!defined('PHPUNIT_TEST') || !PHPUNIT_TEST)) {
             echo "Bucket weightings:\n";
             foreach ($weights as $k => $weight) {
                 echo $k + 1 . ": " . str_repeat('*', 70 * $nbuckets * $weight / $totalweight) . PHP_EOL;
@@ -960,7 +961,7 @@ class behat_config_util {
                 unset($features[$key]);
             } else {
                 $featurestocheck = $this->get_components_features();
-                if (!isset($featurestocheck[$key]) && !defined('PHPUNIT_TEST')) {
+                if (!isset($featurestocheck[$key]) && (!defined('PHPUNIT_TEST') || !PHPUNIT_TEST)) {
                     behat_error(BEHAT_EXITCODE_REQUIREMENT, 'Blacklisted feature "' . $blacklistpath . '" not found.');
                 }
             }
index b10af6c..72d4e97 100644 (file)
@@ -349,7 +349,7 @@ class api {
      * @param \core\oauth2\issuer $issuer The desired OAuth issuer
      */
     protected static function guess_image($issuer) {
-        if (empty($issuer->get('image'))) {
+        if (empty($issuer->get('image')) && !empty($issuer->get('baseurl'))) {
             $baseurl = parse_url($issuer->get('baseurl'));
             $imageurl = $baseurl['scheme'] . '://' . $baseurl['host'] . '/favicon.ico';
             $issuer->set('image', $imageurl);
index 0650971..71d15a6 100644 (file)
@@ -360,6 +360,7 @@ class icon_system_fontawesome extends icon_system_font {
             'core:t/message' => 'fa-comment',
             'core:t/more' => 'fa-caret-down',
             'core:t/move' => 'fa-arrows-v',
+            'core:t/online' => 'fa-circle',
             'core:t/passwordunmask-edit' => 'fa-pencil',
             'core:t/passwordunmask-reveal' => 'fa-eye',
             'core:t/portfolioadd' => 'fa-plus',
index 55b0a23..cc7edbd 100644 (file)
@@ -2230,5 +2230,8 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint(true, 2018050900.01);
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 1933f69..e9f4418 100644 (file)
@@ -321,6 +321,27 @@ class mysql_sql_generator extends sql_generator {
         return $sqls;
     }
 
+    public function getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause = NULL, $skip_default_clause = NULL, $skip_notnull_clause = NULL)
+    {
+        $tablename = $xmldb_table->getName();
+        $dbcolumnsinfo = $this->mdb->get_columns($tablename);
+
+        if (($this->mdb->has_breaking_change_sqlmode()) &&
+            ($dbcolumnsinfo[$xmldb_field->getName()]->meta_type == 'X') &&
+            ($xmldb_field->getType() == XMLDB_TYPE_INTEGER)) {
+            // Ignore 1292 ER_TRUNCATED_WRONG_VALUE Truncated incorrect INTEGER value: '%s'.
+            $altercolumnsqlorig = $this->alter_column_sql;
+            $this->alter_column_sql = str_replace('ALTER TABLE', 'ALTER IGNORE TABLE', $this->alter_column_sql);
+            $result = parent::getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause, $skip_default_clause, $skip_notnull_clause);
+            // Restore the original ALTER SQL statement pattern.
+            $this->alter_column_sql = $altercolumnsqlorig;
+
+            return $result;
+        }
+
+        return parent::getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause, $skip_default_clause, $skip_notnull_clause);
+    }
+
     /**
      * Given one correct xmldb_table, returns the SQL statements
      * to create temporary table (inside one array).
index c333222..358a493 100644 (file)
@@ -94,6 +94,12 @@ class mariadb_native_moodle_database extends mysqli_native_moodle_database {
         return version_compare($version, '10.2.7', '>=');
     }
 
+    public function has_breaking_change_sqlmode() {
+        $version = $this->get_server_info()['version'];
+        // Breaking change since 10.2.4: https://mariadb.com/kb/en/the-mariadb-library/sql-mode/#setting-sql_mode.
+        return version_compare($version, '10.2.4', '>=');
+    }
+
     /**
      * It is time to require transactions everywhere.
      *
index 015d3a6..c3e2e66 100644 (file)
@@ -817,6 +817,14 @@ class mysqli_native_moodle_database extends moodle_database {
         return false;
     }
 
+    /**
+     * Indicates whether SQL_MODE default value has changed in a not backward compatible way.
+     * @return boolean True when SQL_MODE breaks BC; otherwise, false.
+     */
+    public function has_breaking_change_sqlmode() {
+        return false;
+    }
+
     /**
      * Returns moodle column info for raw column from information schema.
      * @param stdClass $rawcolumn
index c663679..1ae13a6 100644 (file)
@@ -97,5 +97,8 @@ function xmldb_editor_atto_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2018051401, 'editor', 'atto');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index efe6f10..e13eedb 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_atto_equation_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 6f8f80f..d0e949e 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_editor_tinymce_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a56ffb4..006a66f 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_tinymce_spellchecker_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 429c5d0..b209e7c 100644 (file)
@@ -16,9 +16,10 @@ Upgrade procedure:
 5/ execute cli/update_lang_files.php and review changes in lang/en/editor_tinymce.php
 
 Changes:
-lib/editor/tinymce/tiny_mce/3.5.11/plugins/fullscreen/editor_plugin_src.js:31-33 - Added checks to see if required functions exist.
-After these changes you need to use uglifier to compress the js into lib/editor/tinymce/tiny_mce/3.5.11/plugins/fullscreen/editor_plugin.js
-(I used "uglifyjs editor_plugin_src.js -c -m -v -o editor_plugin.js")
+- MDL-62381 - Icon sizing is being overwritten on images.
+- lib/editor/tinymce/tiny_mce/3.5.11/plugins/fullscreen/editor_plugin_src.js:31-33 - Added checks to see if required functions exist.
+  After these changes you need to use uglifier to compress the js into lib/editor/tinymce/tiny_mce/3.5.11/plugins/fullscreen/editor_plugin.js
+  (I used "uglifyjs editor_plugin_src.js -c -m -v -o editor_plugin.js")
 
 Copy the moodle skin to the new version:
 lib/editor/tinymce/tiny_mce/3.5.10/theme/advanced/skins/moodle/
index f7e0741..934ac45 100644 (file)
@@ -80,7 +80,7 @@
 .moodleSkin .mceToolbar .mceToolbarStart span, .moodleSkin .mceToolbar .mceToolbarEnd span {display:none;}
 .moodleSkin .mceToolbar .mceToolbarEndListBox span, .moodleSkin .mceToolbar .mceToolbarStartListBox span {display:none}
 .moodleSkin span.mceIcon {display:block;}
-.moodleSkin img.mceIcon {display:block; width:16px; height:16px; padding: 2px 0 0 2px;}
+.moodleSkin img.mceIcon:not(img) {display:block; width:16px; height:16px; padding: 2px 0 0 2px;}
 .moodleSkin td.mceCenter {text-align:center;}
 .moodleSkin td.mceCenter table {margin:0 auto; text-align:left;}
 .moodleSkin td.mceRight table {margin:0 0 0 auto;}
index d36fe17..9b3b1b8 100644 (file)
@@ -5,9 +5,11 @@ Some changes from the upstream version have been made:
 * Define consumer profile member variable for ToolConsumer class
 * Added context type property for Context class
 * Set context type if 'context_type' parameter was submitted through POST
-These changes can be reverted once the following pull requests have been integrated upstream:
+* Do not require tool_consumer_instance_guid
+These changes can be reverted once the following pull requests/issues have been integrated upstream:
 * https://github.com/IMSGlobal/LTI-Tool-Provider-Library-PHP/pull/10/commits/a9a1641f1a593eba4638133245c21d9ad47d8680
 * https://github.com/IMSGlobal/LTI-Tool-Provider-Library-PHP/pull/11/commits/0bae60389bd020a02be5554516b86336e651e237
+* https://github.com/IMSGlobal/LTI-Tool-Provider-Library-PHP/issues/19
 
 It is recommended by upstream to install depdencies via composer - but the composer installation is bundled
 with an autoloader so it's better to do it manually.
index 27cbd6e..8994eff 100644 (file)
@@ -808,11 +808,6 @@ EOD;
                         if (!$this->ok) {
                             $this->reason = 'Request is from an invalid tool consumer.';
                         }
-                    } else {
-                        $this->ok = isset($_POST['tool_consumer_instance_guid']);
-                        if (!$this->ok) {
-                            $this->reason = 'A tool consumer GUID must be included in the launch request.';
-                        }
                     }
                 }
                 if ($this->ok) {
index cb3ab99..446807e 100644 (file)
@@ -4749,32 +4749,38 @@ function get_complete_user_data($field, $value, $mnethostid = null) {
 function check_password_policy($password, &$errmsg) {
     global $CFG;
 
-    if (empty($CFG->passwordpolicy)) {
-        return true;
-    }
-
-    $errmsg = '';
-    if (core_text::strlen($password) < $CFG->minpasswordlength) {
-        $errmsg .= '<div>'. get_string('errorminpasswordlength', 'auth', $CFG->minpasswordlength) .'</div>';
-
-    }
-    if (preg_match_all('/[[:digit:]]/u', $password, $matches) < $CFG->minpassworddigits) {
-        $errmsg .= '<div>'. get_string('errorminpassworddigits', 'auth', $CFG->minpassworddigits) .'</div>';
-
-    }
-    if (preg_match_all('/[[:lower:]]/u', $password, $matches) < $CFG->minpasswordlower) {
-        $errmsg .= '<div>'. get_string('errorminpasswordlower', 'auth', $CFG->minpasswordlower) .'</div>';
-
+    if (!empty($CFG->passwordpolicy)) {
+        $errmsg = '';
+        if (core_text::strlen($password) < $CFG->minpasswordlength) {
+            $errmsg .= '<div>'. get_string('errorminpasswordlength', 'auth', $CFG->minpasswordlength) .'</div>';
+        }
+        if (preg_match_all('/[[:digit:]]/u', $password, $matches) < $CFG->minpassworddigits) {
+            $errmsg .= '<div>'. get_string('errorminpassworddigits', 'auth', $CFG->minpassworddigits) .'</div>';
+        }
+        if (preg_match_all('/[[:lower:]]/u', $password, $matches) < $CFG->minpasswordlower) {
+            $errmsg .= '<div>'. get_string('errorminpasswordlower', 'auth', $CFG->minpasswordlower) .'</div>';
+        }
+        if (preg_match_all('/[[:upper:]]/u', $password, $matches) < $CFG->minpasswordupper) {
+            $errmsg .= '<div>'. get_string('errorminpasswordupper', 'auth', $CFG->minpasswordupper) .'</div>';
+        }
+        if (preg_match_all('/[^[:upper:][:lower:][:digit:]]/u', $password, $matches) < $CFG->minpasswordnonalphanum) {
+            $errmsg .= '<div>'. get_string('errorminpasswordnonalphanum', 'auth', $CFG->minpasswordnonalphanum) .'</div>';
+        }
+        if (!check_consecutive_identical_characters($password, $CFG->maxconsecutiveidentchars)) {
+            $errmsg .= '<div>'. get_string('errormaxconsecutiveidentchars', 'auth', $CFG->maxconsecutiveidentchars) .'</div>';
+        }
     }
-    if (preg_match_all('/[[:upper:]]/u', $password, $matches) < $CFG->minpasswordupper) {
-        $errmsg .= '<div>'. get_string('errorminpasswordupper', 'auth', $CFG->minpasswordupper) .'</div>';
 
-    }
-    if (preg_match_all('/[^[:upper:][:lower:][:digit:]]/u', $password, $matches) < $CFG->minpasswordnonalphanum) {
-        $errmsg .= '<div>'. get_string('errorminpasswordnonalphanum', 'auth', $CFG->minpasswordnonalphanum) .'</div>';
-    }
-    if (!check_consecutive_identical_characters($password, $CFG->maxconsecutiveidentchars)) {
-        $errmsg .= '<div>'. get_string('errormaxconsecutiveidentchars', 'auth', $CFG->maxconsecutiveidentchars) .'</div>';
+    // Fire any additional password policy functions from plugins.
+    // Plugin functions should output an error message string or empty string for success.
+    $pluginsfunction = get_plugins_with_function('check_password_policy');
+    foreach ($pluginsfunction as $plugintype => $plugins) {
+        foreach ($plugins as $pluginfunction) {
+            $pluginerr = $pluginfunction($password);
+            if ($pluginerr) {
+                $errmsg .= '<div>'. $pluginerr .'</div>';
+            }
+        }
     }
 
     if ($errmsg == '') {
@@ -9145,6 +9151,9 @@ function get_performance_info() {
     $info['html'] .= '<li class="timeused col-sm-4">'.$info['realtime'].' secs</li> ';
     $info['txt'] .= 'time: '.$info['realtime'].'s ';
 
+    // GET/POST (or NULL if $_SERVER['REQUEST_METHOD'] is undefined) is useful for txt logged information.
+    $info['txt'] .= 'method: ' . ($_SERVER['REQUEST_METHOD'] ?? "NULL") . ' ';
+
     if (function_exists('memory_get_usage')) {
         $info['memory_total'] = memory_get_usage();
         $info['memory_growth'] = memory_get_usage() - $PERF->startmemory;
index 90e936a..3994c78 100644 (file)
             {{/options}}
         </select>
         <noscript>
-            <input type="submit" role="button" class="btn btn-secondary" value="{{#str}}go, core{{/str}}">
+            <input type="submit" class="btn btn-secondary" value="{{#str}}go, core{{/str}}">
         </noscript>
     </form>
 </div>
index 5315e50..9386106 100644 (file)
@@ -149,9 +149,10 @@ class media_videojs_plugin extends core_media_player_native {
         // which is BEFORE we have a chance to load any additional libraries (youtube).
         // The data-setup-lazy is just a tag name that video.js does not recognise so we can manually initialise
         // it when we are sure the dependencies are loaded.
+        static $playercounter = 1;
         $attributes = [
             'data-setup-lazy' => '{' . join(', ', $datasetup) . '}',
-            'id' => 'id_videojs_' . uniqid(),
+            'id' => 'id_videojs_' . uniqid() . '_' . $playercounter++,
             'class' => get_config('media_videojs', $isaudio ? 'audiocssclass' : 'videocssclass')
         ];
 
index cf94659..62ecec8 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_message_email_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 616e44d..b097f75 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_message_jabber_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 00e7537..4d099a4 100644 (file)
Binary files a/message/output/popup/amd/build/notification_popover_controller.min.js and b/message/output/popup/amd/build/notification_popover_controller.min.js differ
index 62af012..de45501 100644 (file)
@@ -237,6 +237,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str', 'core/url',
                 offset: offset,
             });
 
+            // Link to mark read page before loading the actual link.
+            notification.contexturl = URL.relativeUrl('message/output/popup/mark_notification_read.php', {
+                redirecturl: notification.contexturl,
+                notificationid: notification.id,
+            });
+
             var promise = Templates.render('message_popup/notification_content_item', notification)
             .then(function(html, js) {
                 return {html: html, js: js};
@@ -321,26 +327,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str', 'core/url',
             }.bind(this));
     };
 
-    /**
-     * Send a request to the server to mark a single notification as read and update
-     * the unread count and unread notification elements appropriately.
-     *
-     * @param {jQuery} element
-     * @return {Promise|boolean}
-     * @method markAllAsRead
-     */
-    NotificationPopoverController.prototype.markNotificationAsRead = function(element) {
-        if (!element.hasClass('unread')) {
-            return false;
-        }
-
-        return NotificationRepo.markAsRead(element.attr('data-id'))
-            .then(function() {
-                this.unreadCount--;
-                element.removeClass('unread');
-            }.bind(this));
-    };
-
     /**
      * Add all of the required event listeners for this notification popover.
      *
@@ -361,7 +347,12 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str', 'core/url',
         // Mark individual notification read if the user activates it.
         this.root.on(CustomEvents.events.activate, SELECTORS.NOTIFICATION_LINK, function(e) {
             var element = $(e.target).closest(SELECTORS.NOTIFICATION);
-            this.markNotificationAsRead(element);
+
+            if (element.hasClass('unread')) {
+                this.unreadCount--;
+                element.removeClass('unread');
+            }
+
             e.stopPropagation();
         }.bind(this));
 
index 3ae0a42..b5d1f7b 100644 (file)
@@ -104,5 +104,8 @@ function xmldb_message_popup_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2018032800, 'message', 'popup');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
diff --git a/message/output/popup/mark_notification_read.php b/message/output/popup/mark_notification_read.php
new file mode 100644 (file)
index 0000000..0d393f4
--- /dev/null
@@ -0,0 +1,43 @@
+<?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/>.
+
+/**
+ * Mark a notification read and redirect to the relevant content.
+ *
+ * @package    message_popup
+ * @copyright  2018 Michael Hawkins
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+require_once(__DIR__ . '/../../../config.php');
+
+require_login(null, false);
+
+if (isguestuser()) {
+    redirect($CFG->wwwroot);
+}
+
+$notificationid = required_param('notificationid', PARAM_INT);
+$redirecturl = optional_param('redirecturl', $CFG->wwwroot, PARAM_LOCALURL);
+$notification = $DB->get_record('notifications', array('id' => $notificationid));
+
+// Check notification belongs to this user.
+if ($USER->id != $notification->useridto) {
+    redirect($CFG->wwwroot);
+}
+
+\core_message\api::mark_notification_as_read($notification);
+redirect($redirecturl);
index f63e959..2ca50f2 100644 (file)
         <div class="name">
             {{fullname}}
             {{#showonlinestatus}}
-                <span {{^isonline}}class="hidden"{{/isonline}} data-region="contact-icon-online">
-                    {{#pix}} t/go, core, {{#str}} online, message {{/str}} {{/pix}}
+            <div {{#isonline}}class="d-inline status online"{{/isonline}}{{^isonline}}class="hidden"{{/isonline}}>
+                <span class="online-text" data-region="contact-icon-online">
+                    {{#pix}} t/online, core, {{#str}} online, message {{/str}} {{/pix}}
                 </span>
+            </div>
             {{/showonlinestatus}}
             <span {{^isblocked}}class="hidden"{{/isblocked}} data-region="contact-icon-blocked">
                 {{#pix}} t/block, core, {{#str}} contactblocked, message {{/str}} {{/pix}}
index 013eaa0..9908d99 100644 (file)
@@ -168,5 +168,8 @@ function xmldb_assign_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 0288554..1455b71 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_assignfeedback_comments_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 18d5c3b..995afce 100644 (file)
@@ -59,5 +59,8 @@ function xmldb_assignfeedback_editpdf_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 52e7536..b23aa66 100644 (file)
@@ -10,7 +10,6 @@
     position: relative;
     min-width: 817px;
     min-height: 400px;
-    cursor: crosshair;
     background-repeat: no-repeat;
     background-color: #ccc;
     margin-left: auto;
     position: inherit;
 }
 
-.assignfeedback_editpdf_widget .drawingregion[data-currenttool=drag] .drawingcanvas {
-    cursor: move;
-}
-
-.assignfeedback_editpdf_widget .drawingregion[data-currenttool=select] .drawingcanvas {
-    cursor: default;
-}
-
 .assignfeedback_editpdf_widget .drawingregion[data-currenttool=select] .commentdrawable textarea,
 .assignfeedback_editpdf_widget .drawingregion[data-currenttool=select] .commentdrawable svg {
     cursor: move;
index 5f704e2..dc22ae1 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-debug.js differ
index b3620af..827e3d2 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js differ
index 5f704e2..dc22ae1 100644 (file)
Binary files a/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js and b/mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor.js differ
index 20c5c10..6ba0d9b 100644 (file)
@@ -110,13 +110,13 @@ Y.extend(ANNOTATIONHIGHLIGHT, M.assignfeedback_editpdf.annotation, {
         shape = this.editor.graphic.addShape({
             type: Y.Rect,
             width: bounds.width,
-            height: 16,
+            height: 20,
             stroke: false,
             fill: {
                color: highlightcolour
             },
             x: bounds.x,
-            y: edit.start.y
+            y: edit.start.y - 10
         });
 
         drawable.shapes.push(shape);
@@ -139,9 +139,9 @@ Y.extend(ANNOTATIONHIGHLIGHT, M.assignfeedback_editpdf.annotation, {
         this.gradeid = this.editor.get('gradeid');
         this.pageno = this.editor.currentpage;
         this.x = bounds.x;
-        this.y = edit.start.y;
+        this.y = edit.start.y - 10;
         this.endx = bounds.x + bounds.width;
-        this.endy = edit.start.y + 16;
+        this.endy = edit.start.y + 10;
         this.colour = edit.annotationcolour;
         this.page = '';
 
index 6f94adc..4320b85 100644 (file)
@@ -266,7 +266,7 @@ EDITOR.prototype = {
      * @method refresh_button_state
      */
     refresh_button_state: function() {
-        var button, currenttoolnode, imgurl, drawingregion;
+        var button, currenttoolnode, imgurl, drawingregion, stampimgurl, drawingcanvas;
 
         // Initalise the colour buttons.
         button = this.get_dialogue_element(SELECTOR.COMMENTCOLOURBUTTON);
@@ -291,9 +291,28 @@ EDITOR.prototype = {
         drawingregion.setAttribute('data-currenttool', this.currentedit.tool);
 
         button = this.get_dialogue_element(SELECTOR.STAMPSBUTTON);
-        button.one('img').setAttrs({'src': this.get_stamp_image_url(this.currentedit.stamp),
+        stampimgurl = this.get_stamp_image_url(this.currentedit.stamp);
+        button.one('img').setAttrs({'src': stampimgurl,
                                     'height': '16',
                                     'width': '16'});
+
+        drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
+        switch (this.currentedit.tool) {
+            case 'drag':
+                drawingcanvas.setStyle('cursor', 'move');
+                break;
+            case 'highlight':
+                drawingcanvas.setStyle('cursor', 'text');
+                break;
+            case 'select':
+                drawingcanvas.setStyle('cursor', 'default');
+                break;
+            case 'stamp':
+                drawingcanvas.setStyle('cursor', 'url(' + stampimgurl + '), crosshair');
+                break;
+            default:
+                drawingcanvas.setStyle('cursor', 'crosshair');
+        }
     },
 
     /**
index 81c791f..e142217 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_assignfeedback_file_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 46dafbe..a8b584f 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_assignsubmission_comments_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 69b2dbb..38d416f 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_assignsubmission_file_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 4fddf2d..22b8420 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_assignsubmission_onlinetext_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 0e633a5..0555bbb 100644 (file)
@@ -33,5 +33,8 @@ function xmldb_assignment_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 6437d3e..9afd362 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_book_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 0d41bac..6db7f12 100644 (file)
@@ -65,5 +65,8 @@ function xmldb_chat_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2017111301, 'chat');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 82136fb..f539254 100644 (file)
@@ -33,5 +33,8 @@ function xmldb_choice_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 7287381..0453408 100644 (file)
@@ -65,5 +65,8 @@ function xmldb_data_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 46e9696..849d438 100644 (file)
@@ -78,5 +78,8 @@ function xmldb_feedback_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index aca1bb1..a9fc7b7 100644 (file)
@@ -58,5 +58,8 @@ function xmldb_folder_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index d8961fd..a0adbb8 100644 (file)
@@ -116,5 +116,8 @@ function xmldb_forum_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2018032900, 'forum');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index f360627..5b30243 100644 (file)
@@ -189,7 +189,7 @@ function forum_rss_feed_discussions_sql($forum, $cm, $newsince=0) {
               FROM {forum_discussions} d
                    JOIN {forum_posts} p ON p.discussion = d.id
                    JOIN {user} u ON p.userid = u.id
-             WHERE d.forum = {$forum->id} AND p.parent = 0 AND p.deleted <> 0
+             WHERE d.forum = {$forum->id} AND p.parent = 0 AND p.deleted <> 1
                    $timelimit $groupselect $newsince
           ORDER BY $forumsort";
     return array($sql, $params);
@@ -243,7 +243,7 @@ function forum_rss_feed_posts_sql($forum, $cm, $newsince=0) {
                {forum_posts} p,
                {user} u
             WHERE d.forum = {$forum->id} AND
-                p.discussion = d.id AND p.deleted <> 0 AND
+                p.discussion = d.id AND p.deleted <> 1 AND
                 u.id = p.userid $newsince
                 $groupselect
             ORDER BY p.created desc";
diff --git a/mod/forum/tests/rsslib_test.php b/mod/forum/tests/rsslib_test.php
new file mode 100644 (file)
index 0000000..8b0e362
--- /dev/null
@@ -0,0 +1,102 @@
+<?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/>.
+
+/**
+ * Tests for the forum implementation of the RSS component.
+ *
+ * @package    mod_forum
+ * @copyright  2018 Andrew Nicols <andrew@nicols.co.uk>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+defined('MOODLE_INTERNAL') || die();
+
+global $CFG;
+require_once(__DIR__ . '/helper.php');
+require_once("{$CFG->dirroot}/mod/forum/rsslib.php");
+
+/**
+ * Tests for the forum implementation of the RSS component.
+ *
+ * @copyright  2018 Andrew Nicols <andrew@nicols.co.uk>
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class mod_forum_rsslib_testcase extends advanced_testcase {
+    // Include the mod_forum test helpers.
+    // This includes functions to create forums, users, discussions, and posts.
+    use helper;
+
+    /**
+     * Ensure that deleted posts are not included.
+     */
+    public function test_forum_rss_feed_discussions_sql_respect_deleted() {
+        global $DB;
+
+        $this->resetAfterTest();
+
+        $course = $this->getDataGenerator()->create_course();
+        $forum = $this->getDataGenerator()->create_module('forum', ['course' => $course->id]);
+        $cm = get_coursemodule_from_instance('forum', $forum->id);
+
+        list($user, $otheruser) = $this->helper_create_users($course, 2);
+
+        // Post twice.
+        $this->helper_post_to_forum($forum, $otheruser);
+        list($discussion, $post) = $this->helper_post_to_forum($forum, $otheruser);
+
+        list($sql, $params) = forum_rss_feed_discussions_sql($forum, $cm);
+        $discussions = $DB->get_records_sql($sql, $params);
+        $this->assertCount(2, $discussions);
+
+        $post->deleted = 1;
+        $DB->update_record('forum_posts', $post);
+
+        list($sql, $params) = forum_rss_feed_discussions_sql($forum, $cm);
+        $discussions = $DB->get_records_sql($sql, $params);
+        $this->assertCount(1, $discussions);
+    }
+
+
+    /**
+     * Ensure that deleted posts are not included.
+     */
+    public function test_forum_rss_feed_posts_sql_respect_deleted() {
+        global $DB;
+
+        $this->resetAfterTest();
+
+        $course = $this->getDataGenerator()->create_course();
+        $forum = $this->getDataGenerator()->create_module('forum', ['course' => $course->id]);
+        $cm = get_coursemodule_from_instance('forum', $forum->id);
+
+        list($user, $otheruser) = $this->helper_create_users($course, 2);
+
+        // Post twice.
+        $this->helper_post_to_forum($forum, $otheruser);
+        list($discussion, $post) = $this->helper_post_to_forum($forum, $otheruser);
+
+        list($sql, $params) = forum_rss_feed_posts_sql($forum, $cm);
+        $posts = $DB->get_records_sql($sql, $params);
+        $this->assertCount(2, $posts);
+
+        $post->deleted = 1;
+        $DB->update_record('forum_posts', $post);
+
+        list($sql, $params) = forum_rss_feed_posts_sql($forum, $cm);
+        $posts = $DB->get_records_sql($sql, $params);
+        $this->assertCount(1, $posts);
+    }
+}
index e3b645c..cc92bda 100644 (file)
@@ -31,6 +31,9 @@ function xmldb_glossary_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     if ($oldversion < 2018051401) {
 
         // Fetch the module ID for the glossary module.
index ff169ec..6a8d756 100644 (file)
@@ -40,5 +40,8 @@ function xmldb_imscp_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index cb877fe..62a61ae 100644 (file)
@@ -67,5 +67,8 @@ function xmldb_label_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8ab0f02..86afb89 100644 (file)
@@ -107,5 +107,8 @@ function xmldb_lesson_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index b0e35c0..a5a03c2 100644 (file)
@@ -282,11 +282,10 @@ class mod_lesson_renderer extends plugin_renderer_base {
             $pagetable->cellspacing = 0;
             $pagetable->cellpadding = '5px';
             $pagetable->data = array();
-            $pagetable->id = 'lesson-' . $pageid;
 
             $pageheading = new html_table_cell();
 
-            $pageheading->text = format_string($page->title);
+            $pageheading->text = html_writer::tag('a', '', array('id' => 'lesson-' . $pageid)) . format_string($page->title);
             if ($canedit) {
                 $pageheading->text .= ' '.$this->page_action_links($page, $npages);
             }
@@ -309,7 +308,7 @@ class mod_lesson_renderer extends plugin_renderer_base {
 
             $pagetable = $page->display_answers($pagetable);
 
-            $content .= html_writer::start_tag('div', array('class' => 'no-overflow'));
+            $content .= html_writer::start_tag('div');
             $content .= html_writer::table($pagetable);
             $content .= html_writer::end_tag('div');
 
index 787529f..cafef68 100644 (file)
@@ -50,7 +50,7 @@ branch table contents
     And I follow "Expanded"
 
   Scenario: Edit lesson content page
-    Given I click on "//th[normalize-space(.)='First page name']/descendant::a[2]" "xpath_element"
+    Given I click on "//th[normalize-space(.)='First page name']/descendant::a[3]" "xpath_element"
     When I set the following fields to these values:
       | id_answer_editor_1 | |
     And I press "Save page"
@@ -73,7 +73,7 @@ branch table contents
     And I should see "Your score is 1 (out of 1)."
 
   Scenario: Edit lesson question page
-    Given I click on "//th[normalize-space(.)='Hardest question ever']/descendant::a[2]" "xpath_element"
+    Given I click on "//th[normalize-space(.)='Hardest question ever']/descendant::a[3]" "xpath_element"
     When I set the following fields to these values:
       | id_answer_editor_1 | |
     And I press "Save page"
index b687083..58c7209 100644 (file)
@@ -71,16 +71,16 @@ Feature: In a lesson activity, teacher can edit a cluster page
     And I press "Save page"
 
   Scenario: Edit lesson cluster page
-    Given I click on "//th[normalize-space(.)='Cluster']/descendant::a[2]" "xpath_element"
+    Given I click on "//th[normalize-space(.)='Cluster']/descendant::a[3]" "xpath_element"
     When I set the following fields to these values:
       | Page title | Modified name |
       | Page contents | Modified contents |
     And I press "Save page"
     Then I should see "Modified name"
-    And I click on "//th[normalize-space(.)='Modified name']/descendant::a[2]" "xpath_element"
+    And I click on "//th[normalize-space(.)='Modified name']/descendant::a[3]" "xpath_element"
     And I should see "Unseen question within a cluster"
     And I press "Cancel"
-    And I click on "//th[normalize-space(.)='End of cluster']/descendant::a[2]" "xpath_element"
+    And I click on "//th[normalize-space(.)='End of cluster']/descendant::a[3]" "xpath_element"
     And I set the following fields to these values:
       | Page title | Modified end |
       | Page contents | Modified end contents |
index 2026ec0..188a628 100644 (file)
@@ -56,7 +56,7 @@ Feature: In a lesson activity, teacher can edit lesson's pages
     And I press "Save page"
 
   Scenario: Edit lesson content page
-    Given I click on "//th[normalize-space(.)='Second page name']/descendant::a[2]" "xpath_element"
+    Given I click on "//th[normalize-space(.)='Second page name']/descendant::a[3]" "xpath_element"
     When I set the following fields to these values:
       | Page title | Modified second page |
       | Page contents | Modified contents |
@@ -91,7 +91,7 @@ Feature: In a lesson activity, teacher can edit lesson's pages
     And I should see "Your score is 1 (out of 1)."
 
   Scenario: Edit lesson question page
-    Given I click on "//th[normalize-space(.)='Hardest question ever']/descendant::a[2]" "xpath_element"
+    Given I click on "//th[normalize-space(.)='Hardest question ever']/descendant::a[3]" "xpath_element"
     When I set the following fields to these values:
       | Page title | New hardest question |
       | Page contents | 1 + 2? |
index 605b00c..76642f5 100644 (file)
@@ -137,6 +137,9 @@ function xmldb_lti_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2017111301, 'lti');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 
 }
index 67a0154..14e6345 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_page_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 89757ec..f3b19ee 100644 (file)
@@ -196,5 +196,8 @@ function xmldb_quiz_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2018040800, 'quiz');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 6a50540..81efd89 100644 (file)
@@ -55,5 +55,8 @@ function xmldb_quiz_overview_upgrade($oldversion) {
         upgrade_plugin_savepoint(true, 2018021800, 'quiz', 'overview');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 147f379..5906ffb 100644 (file)
@@ -46,5 +46,8 @@ function xmldb_quiz_statistics_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a662488..a181ea3 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_resource_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 59cb31c..1724c69 100644 (file)
@@ -75,5 +75,8 @@ function xmldb_scorm_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2018041100, 'scorm');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 347d90f..574dfce 100644 (file)
@@ -50,5 +50,8 @@ function xmldb_survey_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 26ab43d..e5edfeb 100644 (file)
@@ -56,5 +56,8 @@ function xmldb_url_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8537f2a..a6e0266 100644 (file)
@@ -49,5 +49,8 @@ function xmldb_wiki_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index fe384c1..6c6e2c3 100644 (file)
@@ -65,5 +65,8 @@ function xmldb_workshop_upgrade($oldversion) {
         upgrade_mod_savepoint(true, 2018042700, 'workshop');
     }
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 7aa5f18..1abb8c8 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_workshopform_accumulative_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index ed17780..52cce87 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_workshopform_comments_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8bbaa8c..6e4f960 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_workshopform_numerrors_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a342df1..26d7f9e 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_workshopform_rubric_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
diff --git a/pix/t/online.png b/pix/t/online.png
new file mode 100644 (file)
index 0000000..c449d4a
Binary files /dev/null and b/pix/t/online.png differ
diff --git a/pix/t/online.svg b/pix/t/online.svg
new file mode 100644 (file)
index 0000000..64f57e9
--- /dev/null
@@ -0,0 +1,3 @@
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [\r
+       <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">\r
+]><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" preserveAspectRatio="xMinYMid meet" overflow="visible"><circle cx="6" cy="6" r="6" fill="#7d7"/></svg>
\ No newline at end of file
index fbb1c33..f09a613 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_portfolio_boxnet_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 807eb41..181ddfe 100644 (file)
@@ -32,5 +32,8 @@ function xmldb_portfolio_googledocs_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 1f58cca..cd6ce31 100644 (file)
@@ -32,5 +32,8 @@ function xmldb_portfolio_picasa_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index aa14c01..a77394f 100644 (file)
@@ -39,5 +39,8 @@ function xmldb_qbehaviour_manualgraded_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
diff --git a/question/tests/behat/edit_questions_standard_tags.feature b/question/tests/behat/edit_questions_standard_tags.feature
new file mode 100644 (file)
index 0000000..beccac1
--- /dev/null
@@ -0,0 +1,32 @@
+@core @core_question @javascript
+Feature: The questions can be tagged
+  In order to tag questions
+  As  a teacher
+  I want to see the standard tags in the tags field
+
+  Background:
+    Given the following "users" exist:
+      | username | firstname | lastname | email            |
+      | teacher1 | Teacher   | 1        | teacher1@example.com |
+    And the following "courses" exist:
+      | fullname | shortname | format |
+      | Course 1 | C1        | weeks  |
+    And the following "course enrolments" exist:
+      | user     | course | role           |
+      | teacher1 | C1     | editingteacher |
+    And the following "tags" exist:
+      | name | isstandard |
+      | foo  | 1          |
+      | bar  | 1          |
+
+  Scenario: The tags autocomplete should include standard tags
+    When I log in as "teacher1"
+    And I am on "Course 1" course homepage
+    And I navigate to "Questions" node in "Course administration > Question bank"
+    And I press "Create a new question ..."
+    And I set the field "item_qtype_truefalse" to "1"
+    And I press "Add"
+    And I expand all fieldsets
+    And I open the autocomplete suggestions list
+    Then "foo" "autocomplete_suggestions" should exist
+    And "bar" "autocomplete_suggestions" should exist
\ No newline at end of file
index ca315ac..919accc 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_qtype_calculated_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index aeae12f..bdb1fbf 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_qtype_ddmarker_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a371764..44302ed 100644 (file)
@@ -316,6 +316,8 @@ abstract class question_edit_form extends question_wizard_form {
      * @param object $mform The form being built
      */
     protected function add_tag_fields($mform) {
+        global $CFG, $DB;
+
         $hastagcapability = question_has_capability_on($this->question, 'tag');
         // Is the question category in a course context?
         $qcontext = $this->categorycontext;
@@ -332,6 +334,18 @@ abstract class question_edit_form extends question_wizard_form {
         foreach ($tags as $tag) {
             $tagstrings[$tag->name] = $tag->name;
         }
+
+        $showstandard = core_tag_area::get_showstandard('core_question', 'question');
+        if ($showstandard != core_tag_tag::HIDE_STANDARD) {
+            $namefield = empty($CFG->keeptagnamecase) ? 'name' : 'rawname';
+            $standardtags = $DB->get_records('tag',
+                    array('isstandard' => 1, 'tagcollid' => core_tag_area::get_collection('core', 'question')),
+                    $namefield, 'id,' . $namefield);
+            foreach ($standardtags as $standardtag) {
+                $tagstrings[$standardtag->$namefield] = $standardtag->$namefield;
+            }
+        }
+
         $options = [
             'tags' => true,
             'multiple' => true,
index 2c29c45..426c890 100644 (file)
@@ -57,5 +57,9 @@ function xmldb_qtype_essay_upgrade($oldversion) {
         // Essay savepoint reached.
         upgrade_plugin_savepoint(true, 2018021800, 'qtype', 'essay');
     }
+
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 3f10940..9bf2fa7 100644 (file)
@@ -40,5 +40,8 @@ function xmldb_qtype_match_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 87c7b04..d618908 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_qtype_multianswer_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a60e40b..88d15e9 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_qtype_multichoice_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c4f6323..0f5b5eb 100644 (file)
@@ -55,5 +55,8 @@ function xmldb_qtype_numerical_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index a6e32fc..ca7f7a2 100644 (file)
@@ -40,5 +40,8 @@ function xmldb_qtype_random_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 4358252..0447cf7 100644 (file)
@@ -40,5 +40,8 @@ function xmldb_qtype_randomsamatch_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 3823dae..8bd0a70 100644 (file)
@@ -41,5 +41,8 @@ function xmldb_qtype_shortanswer_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 4d2e451..43443ef 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_repository_boxnet_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index c03d407..0ad961a 100644 (file)
@@ -36,5 +36,8 @@ function xmldb_repository_dropbox_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 8c3cc98..1bc5342 100644 (file)
@@ -47,5 +47,8 @@ function xmldb_repository_flickr_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 6d8ca5e..e7599ea 100644 (file)
@@ -64,5 +64,8 @@ function xmldb_repository_googledocs_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 40f2d0b..2591a6c 100644 (file)
@@ -34,5 +34,8 @@ function xmldb_repository_onedrive_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 668db4c..0c47a1c 100644 (file)
@@ -32,5 +32,8 @@ function xmldb_repository_picasa_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 0f00dbe..9f0d404 100644 (file)
@@ -416,9 +416,11 @@ class renderer extends \core_course_management_renderer {
      * @param course_in_list $course The currently selected course.
      * @param int $page The page being displayed.
      * @param int $perpage The number of courses to display per page.
+     * @param string|null $viewmode The view mode the page is in, one out of 'default', 'combined', 'courses' or 'categories'.
      * @return string
      */
-    public function course_listing(coursecat $category = null, course_in_list $course = null, $page = 0, $perpage = 20) {
+    public function course_listing(coursecat $category = null, course_in_list $course = null,
+            $page = 0, $perpage = 20, $viewmode = 'default') {
 
         if ($category === null) {
             $html = html_writer::start_div('select-a-category');
@@ -460,13 +462,13 @@ class renderer extends \core_course_management_renderer {
             array('id' => 'course-listing-title', 'tabindex' => '0', 'class' => 'card-header'));
         $html .= html_writer::start_div('card-body');
         $html .= $this->course_listing_actions($category, $course, $perpage);
-        $html .= $this->listing_pagination($category, $page, $perpage);
+        $html .= $this->listing_pagination($category, $page, $perpage, false, $viewmode);
         $html .= html_writer::start_tag('ul', array('class' => 'ml course-list', 'role' => 'group'));
         foreach ($category->get_courses($options) as $listitem) {
             $html .= $this->course_listitem($category, $listitem, $courseid);
         }
         $html .= html_writer::end_tag('ul');
-        $html .= $this->listing_pagination($category, $page, $perpage, true);
+        $html .= $this->listing_pagination($category, $page, $perpage, true, $viewmode);
         $html .= $this->course_bulk_actions($category);
         $html .= html_writer::end_div();
         $html .= html_writer::end_div();
index 8c7846d..11be4f6 100644 (file)
@@ -33,7 +33,7 @@
 
         &.online {
             .online-text {
-                display: block;
+                display: inherit;
             }
             .offline-text {
                 display: none;
index ef42132..70aa519 100644 (file)
@@ -29,7 +29,7 @@
 
         &.online {
             .online-text {
-                display: block;
+                display: inherit;
             }
             .offline-text {
                 display: none;
index 5826b25..5d099db 100644 (file)
@@ -8128,7 +8128,7 @@ a.ygtvspacer:hover {
   color: #ff6961;
 }
 .messaging-area-container .status.online .online-text {
-  display: block;
+  display: inherit;
 }
 .messaging-area-container .status.online .offline-text {
   display: none;
index 480e5e9..088c57a 100644 (file)
@@ -42,5 +42,8 @@ function xmldb_theme_more_upgrade($oldversion) {
     // Automatically generated Moodle v3.4.0 release upgrade line.
     // Put any upgrade step following this.
 
+    // Automatically generated Moodle v3.5.0 release upgrade line.
+    // Put any upgrade step following this.
+
     return true;
 }
index 4f79b5d..645a0ca 100644 (file)
@@ -367,7 +367,7 @@ class participants_table extends \table_sql {
         $canreviewenrol = has_capability('moodle/course:enrolreview', $this->context);
         if ($canreviewenrol) {
             $fullname = fullname($data);
-            $coursename = $this->course->fullname;
+            $coursename = format_string($this->course->fullname, true, array('context' => $this->context));
             require_once($CFG->dirroot . '/enrol/locallib.php');
             $manager = new \course_enrolment_manager($PAGE, $this->course);
             $userenrolments = $manager->get_user_enrolments($data->id);
index 9073043..f1c459b 100644 (file)
 
 defined('MOODLE_INTERNAL') || die();
 
-$version  = 2018051700.01;              // YYYYMMDD      = weekly release date of this DEV branch.
+$version  = 2018053100.00;              // YYYYMMDD      = weekly release date of this DEV branch.
                                         //         RR    = release increments - 00 in DEV branches.
                                         //           .XX = incremental changes.
 
-$release  = '3.6dev (Build: 20180524)'; // Human-friendly version name
+$release  = '3.6dev (Build: 20180531)'; // Human-friendly version name
 
 $branch   = '36';                       // This version's branch.
 $maturity = MATURITY_ALPHA;             // This version's maturity level.
index fb888d9..92203e7 100644 (file)
@@ -133,8 +133,9 @@ class webservice_xmlrpc_server extends webservice_base_server {
      * @param Exception $ex
      */
     protected function send_error($ex = null) {
+        $this->response = $this->generate_error($ex);
         $this->send_headers();
-        echo $this->generate_error($ex);
+        echo $this->response;
     }
 
     /**