Merge branch 'MDL-69021-master' of git://github.com/bmbrands/moodle
authorJake Dallimore <jake@moodle.com>
Tue, 23 Jun 2020 03:31:08 +0000 (11:31 +0800)
committerJake Dallimore <jake@moodle.com>
Tue, 23 Jun 2020 03:31:08 +0000 (11:31 +0800)
16 files changed:
admin/tool/task/renderer.php
admin/tool/task/tests/behat/manage_tasks.feature
contentbank/amd/build/actions.min.js
contentbank/amd/build/actions.min.js.map
contentbank/amd/src/actions.js
contentbank/index.php
contentbank/view.php
lang/en/moodle.php
lib/questionlib.php
lib/templates/paged_content.mustache
lib/templates/paged_content_paging_bar.mustache
lib/templates/paged_content_paging_bar_item.mustache
lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-debug.js
lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-min.js
lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue.js
lib/yui/src/chooserdialogue/js/chooserdialogue.js

index a003eab..ec0bb0c 100644 (file)
@@ -48,6 +48,7 @@ class tool_task_renderer extends plugin_renderer_base {
         $showloglink = \core\task\logmanager::has_log_report();
 
         $table = new html_table();
+        $table->caption = get_string('scheduledtasks', 'tool_task');
         $table->head = [
             get_string('name'),
             get_string('component', 'tool_task'),
@@ -180,7 +181,7 @@ class tool_task_renderer extends plugin_renderer_base {
         $plugininfo->init_display_name();
 
         $componentname = $plugininfo->displayname;
-        if (!$plugininfo->is_enabled()) {
+        if ($plugininfo->is_enabled() === false) {
             $componentname .= ' ' . html_writer::span(
                             get_string('disabled', 'tool_task'), 'badge badge-secondary');
         }
index 160451d..dd27d85 100644 (file)
@@ -65,3 +65,9 @@ Feature: Manage scheduled tasks
       | Name               | Component    | Minute | Hour | Day | Day of week | Month |
       | Log table cleanup  | Standard log | */5    | 1    | 2   | 4           | 3     |
     And I should see "Log table cleanup" in the "tr.table-primary" "css_element"
+
+  Scenario: Disabled plugin's tasks are labelled as disabled too
+    When "CAS users sync job \auth_cas\task\sync_task" row "Next run" column of "Scheduled tasks" table should contain "Plugin disabled"
+    Then "CAS users sync job \auth_cas\task\sync_task" row "Component" column of "Scheduled tasks" table should contain "Disabled"
+    And "Background processing for scheduled allocation \workshopallocation_scheduled\task\cron_task" row "Next run" column of "Scheduled tasks" table should not contain "Plugin disabled"
+    And "Background processing for scheduled allocation \workshopallocation_scheduled\task\cron_task" row "Component" column of "Scheduled tasks" table should not contain "Disabled"
index 4d78f53..237c664 100644 (file)
Binary files a/contentbank/amd/build/actions.min.js and b/contentbank/amd/build/actions.min.js differ
index 6e5344e..79956ea 100644 (file)
Binary files a/contentbank/amd/build/actions.min.js.map and b/contentbank/amd/build/actions.min.js.map differ
index 561cb99..1776292 100644 (file)
@@ -176,10 +176,10 @@ function($, Ajax, Notification, Str, Templates, Url, ModalFactory, ModalEvents)
         var requestType = 'success';
         Ajax.call([request])[0].then(function(data) {
             if (data.result) {
-                return Str.get_string('contentdeleted', 'core_contentbank');
+                return 'contentdeleted';
             }
             requestType = 'error';
-            return Str.get_string('contentnotdeleted', 'core_contentbank');
+            return 'contentnotdeleted';
 
         }).done(function(message) {
             var params = {
@@ -212,10 +212,10 @@ function($, Ajax, Notification, Str, Templates, Url, ModalFactory, ModalEvents)
         var requestType = 'success';
         Ajax.call([request])[0].then(function(data) {
             if (data) {
-                return Str.get_string('contentrenamed', 'core_contentbank');
+                return 'contentrenamed';
             }
             requestType = 'error';
-            return Str.get_string('contentnotrenamed', 'core_contentbank');
+            return 'contentnotrenamed';
 
         }).then(function(message) {
             var params = null;
index bf8de2b..33eff29 100644 (file)
@@ -32,8 +32,8 @@ $context = context::instance_by_id($contextid, MUST_EXIST);
 
 require_capability('moodle/contentbank:access', $context);
 
-$statusmsg = optional_param('statusmsg', '', PARAM_RAW);
-$errormsg = optional_param('errormsg', '', PARAM_RAW);
+$statusmsg = optional_param('statusmsg', '', PARAM_ALPHANUMEXT);
+$errormsg = optional_param('errormsg', '', PARAM_ALPHANUMEXT);
 
 $title = get_string('contentbank');
 \core_contentbank\helper::get_page_ready($context, $title);
@@ -98,9 +98,11 @@ echo $OUTPUT->header();
 echo $OUTPUT->box_start('generalbox');
 
 // If needed, display notifications.
-if ($errormsg !== '') {
+if ($errormsg !== '' && get_string_manager()->string_exists($errormsg, 'core_contentbank')) {
+    $errormsg = get_string($errormsg, 'core_contentbank');
     echo $OUTPUT->notification($errormsg);
-} else if ($statusmsg !== '') {
+} else if ($statusmsg !== '' && get_string_manager()->string_exists($statusmsg, 'core_contentbank')) {
+    $statusmsg = get_string($statusmsg, 'core_contentbank');
     echo $OUTPUT->notification($statusmsg, 'notifysuccess');
 }
 
index 9f2a8d1..5fd66d1 100644 (file)
@@ -35,8 +35,8 @@ $record = $DB->get_record('contentbank_content', ['id' => $id], '*', MUST_EXIST)
 $context = context::instance_by_id($record->contextid, MUST_EXIST);
 require_capability('moodle/contentbank:access', $context);
 
-$statusmsg = optional_param('statusmsg', '', PARAM_RAW);
-$errormsg = optional_param('errormsg', '', PARAM_RAW);
+$statusmsg = optional_param('statusmsg', '', PARAM_ALPHANUMEXT);
+$errormsg = optional_param('errormsg', '', PARAM_ALPHANUMEXT);
 
 $returnurl = new \moodle_url('/contentbank/index.php', ['contextid' => $context->id]);
 $plugin = core_plugin_manager::instance()->get_plugin_info($record->contenttype);
@@ -111,9 +111,11 @@ $PAGE->add_header_action(html_writer::div(
 echo $OUTPUT->header();
 
 // If needed, display notifications.
-if ($errormsg !== '') {
+if ($errormsg !== '' && get_string_manager()->string_exists($errormsg, 'core_contentbank')) {
+    $errormsg = get_string($errormsg, 'core_contentbank');
     echo $OUTPUT->notification($errormsg);
-} else if ($statusmsg !== '') {
+} else if ($statusmsg !== '' && get_string_manager()->string_exists($statusmsg, 'core_contentbank')) {
+    $statusmsg = get_string($statusmsg, 'core_contentbank');
     echo $OUTPUT->notification($statusmsg, 'notifysuccess');
 }
 if ($contenttype->can_access()) {
index 7672db6..24d2c03 100644 (file)
@@ -854,6 +854,7 @@ $string['first'] = 'First';
 $string['firstaccess'] = 'First access';
 $string['firstname'] = 'First name';
 $string['firstnamephonetic'] = 'First name - phonetic';
+$string['firstpage'] = 'First page';
 $string['firstsiteaccess'] = 'First access to site';
 $string['firsttime'] = 'Is this your first time here?';
 $string['folder'] = 'Folder';
@@ -1133,6 +1134,7 @@ $string['lastlogin'] = 'Last login';
 $string['lastmodified'] = 'Last modified';
 $string['lastname'] = 'Surname';
 $string['lastnamephonetic'] = 'Surname - phonetic';
+$string['lastpage'] = 'Last page';
 $string['lastsiteaccess'] = 'Last access to site';
 $string['lastyear'] = 'Last year';
 $string['latestlanguagepack'] = 'Check for latest language pack on moodle.org';
@@ -1417,6 +1419,7 @@ Cheers from the \'{$a->sitename}\' administrator,
 $string['newusers'] = 'New users';
 $string['newwindow'] = 'New window';
 $string['next'] = 'Next';
+$string['nextpage'] = 'Next page';
 $string['nextsection'] = 'Next section';
 $string['no'] = 'No';
 $string['noblockstoaddhere'] = 'There are no blocks that you can add to this page.';
@@ -1600,6 +1603,7 @@ $string['preview'] = 'Preview';
 $string['previeworchoose'] = 'Preview or choose a theme';
 $string['previous'] = 'Previous';
 $string['previouslyselectedusers'] = 'Previously selected users not matching \'{$a}\'';
+$string['previouspage'] = 'Previous page';
 $string['previoussection'] = 'Previous section';
 $string['primaryadminsetup'] = 'Setup administrator account';
 $string['privacy:metadata:config_log'] = 'The log of configuration changes.';
index 470b3be..8c89e04 100644 (file)
@@ -1813,6 +1813,8 @@ function question_get_question_capabilities() {
         'moodle/question:useall',
         'moodle/question:movemine',
         'moodle/question:moveall',
+        'moodle/question:tagmine',
+        'moodle/question:tagall',
     );
 }
 
index c1b7202..4111ea8 100644 (file)
     Example context (json):
     {
         "pagingbar": {
-            "itemsperpage": 1,
+            "showitemsperpageselector": true,
+            "itemsperpage": [
+                { "value": 5, "active": false },
+                { "value": 10, "active": true },
+                { "value": 15, "active": false }
+            ],
             "previous": true,
             "next": true,
             "first": true,
             "last": true,
+            "barsize": 5,
             "pages": [
                 {
                     "page": "1",
                 {
                     "url": "#",
                     "page": "2"
+                },
+                {
+                    "url": "#",
+                    "page": "3"
+                },
+                {
+                    "url": "#",
+                    "page": "4"
+                },
+                {
+                    "url": "#",
+                    "page": "5"
+                },
+                {
+                    "url": "#",
+                    "page": "6"
+                },
+                {
+                    "url": "#",
+                    "page": "7"
                 }
             ]
         },
             {
                 "page": 2,
                 "content": "<p>Some page 2 content</p>"
+            },
+            {
+                "page": 3,
+                "content": "<p>Some page 3 content</p>"
+            },
+            {
+                "page": 4,
+                "content": "<p>Some page 4 content</p>"
+            },
+            {
+                "page": 5,
+                "content": "<p>Some page 5 content</p>"
+            },
+            {
+                "page": 6,
+                "content": "<p>Some page 6 content</p>"
+            },
+            {
+                "page": 7,
+                "content": "<p>Some page 7 content</p>"
             }
         ]
     }
index b0b84f1..f8af357 100644 (file)
 
     Example context (json):
     {
-        "itemsperpage": 2,
+        "showitemsperpageselector": true,
+        "itemsperpage": [
+            { "value": 5, "active": false },
+            { "value": 10, "active": true },
+            { "value": 15, "active": false }
+        ],
         "previous": true,
         "next": true,
         "first": true,
@@ -89,7 +94,8 @@
                         <a
                             class="dropdown-item {{#active}}active{{/active}}"
                             href="#"
-                            data-limit={{value}}
+                            data-limit="{{value}}"
+                            role="menuitem"
                             {{#active}}aria-current="true"{{/active}}
                         >
                             {{#value}}{{.}}{{/value}}
         <ul class="pagination mb-0">
             {{#previous}}
                 {{< core/paged_content_paging_bar_item }}
+                    {{$linkattributes}}aria-label="{{#str}}previouspage{{/str}}"{{/linkattributes}}
                     {{$item-content}}
                         <span class="icon-no-margin dir-rtl-hide" aria-hidden="true">{{#pix}} i/previous, core {{/pix}}</span>
                         <span class="icon-no-margin dir-ltr-hide" aria-hidden="true">{{#pix}} i/next, core {{/pix}}</span>
             {{/previous}}
             {{#first}}
                 {{< core/paged_content_paging_bar_item }}
+                    {{$linkattributes}}aria-label="{{#str}}firstpage{{/str}}"{{/linkattributes}}
                     {{$item-content}}
-                        <span aria-hidden="true">{{#str}}first{{/str}}</span>
+                        {{#str}}first{{/str}}
                     {{/item-content}}
                     {{$attributes}}data-control="first"{{/attributes}}
                 {{/ core/paged_content_paging_bar_item }}
             {{/first}}
             {{#barsize}}
                 {{< core/paged_content_paging_bar_item }}
+                    {{$linkattributes}}aria-hidden="true"{{/linkattributes}}
                     {{$item-content}}
-                        <span aria-hidden="true">&hellip;</span>
+                        &hellip;
                     {{/item-content}}
                     {{$attributes}}data-dots="beginning"{{/attributes}}
                 {{/ core/paged_content_paging_bar_item }}
             {{/pages}}
             {{#barsize}}
                 {{< core/paged_content_paging_bar_item }}
+                    {{$linkattributes}}aria-hidden="true"{{/linkattributes}}
                     {{$item-content}}
-                        <span aria-hidden="true">&hellip;</span>
+                        &hellip;
                     {{/item-content}}
                     {{$attributes}}data-dots="ending"{{/attributes}}
                 {{/ core/paged_content_paging_bar_item }}
             {{/barsize}}
             {{#last}}
                 {{< core/paged_content_paging_bar_item }}
+                    {{$linkattributes}}aria-label="{{#str}}lastpage{{/str}}"{{/linkattributes}}
                     {{$item-content}}
-                        <span aria-hidden="true">{{#str}}last{{/str}}</span>
+                        {{#str}}last{{/str}}
                     {{/item-content}}
                     {{$attributes}}data-control="last"{{/attributes}}
                 {{/ core/paged_content_paging_bar_item }}
             {{/last}}
             {{#next}}
                 {{< core/paged_content_paging_bar_item }}
+                    {{$linkattributes}}aria-label="{{#str}}nextpage{{/str}}"{{/linkattributes}}
                     {{$item-content}}
                         <span class="icon-no-margin dir-rtl-hide" aria-hidden="true">{{#pix}} i/next, core {{/pix}}</span>
                         <span class="icon-no-margin dir-ltr-hide" aria-hidden="true">{{#pix}} i/previous, core {{/pix}}</span>
index e3ef1a2..ed50b10 100644 (file)
@@ -33,7 +33,7 @@
 
     <a href="{{#url}}{{.}}{{/url}}{{^url}}#{{/url}}"
        class="page-link"
-       data-region="page-link">
+       data-region="page-link" {{$linkattributes}}aria-label="{{#str}}pagea, moodle, {{page}}{{/str}}"{{/linkattributes}}>
         {{$item-content}}
             {{{page}}}
         {{/item-content}}
index 4ccb899..9d72b87 100644 (file)
Binary files a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-debug.js and b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-debug.js differ
index 90a6b75..9af91ef 100644 (file)
Binary files a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-min.js and b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-min.js differ
index 4ccb899..9d72b87 100644 (file)
Binary files a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue.js and b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue.js differ
index a2df1f7..ddefaa5 100644 (file)
@@ -214,7 +214,9 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, {
             newheight, totalheight;
 
         if (this.panel.shouldResizeFullscreen()) {
-            // No custom sizing required for a fullscreen dialog.
+            dialogue.setStyle('maxHeight', '100%');
+            dialogue.setStyle('height', 'auto');
+            this.panel.makeResponsive();
             return;
         }