MDL-65298 core_course: Remove unused function parameters
authorMathew May <mathewm@hotmail.co.nz>
Mon, 24 Feb 2020 02:21:51 +0000 (10:21 +0800)
committerMathew May <mathewm@hotmail.co.nz>
Thu, 5 Mar 2020 02:36:41 +0000 (10:36 +0800)
course/amd/build/actions.min.js
course/amd/build/actions.min.js.map
course/amd/src/actions.js

index 1afa46c..fa3aa00 100644 (file)
Binary files a/course/amd/build/actions.min.js and b/course/amd/build/actions.min.js differ
index d16a62f..d15fd1a 100644 (file)
Binary files a/course/amd/build/actions.min.js.map and b/course/amd/build/actions.min.js.map differ
index 1caedcb..c1446ef 100644 (file)
@@ -23,8 +23,8 @@
  * @since      3.3
  */
 define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str', 'core/url', 'core/yui',
-        'core/modal_factory', 'core/modal_events', 'core/key_codes'],
-    function($, ajax, templates, notification, str, url, Y, ModalFactory, ModalEvents, KeyCodes) {
+        'core/modal_factory', 'core/modal_events', 'core/key_codes', 'core/log'],
+    function($, ajax, templates, notification, str, url, Y, ModalFactory, ModalEvents, KeyCodes, log) {
         var CSS = {
             EDITINPROGRESS: 'editinprogress',
             SECTIONDRAGGABLE: 'sectiondraggable',
@@ -341,13 +341,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
          * @param {String} image new image name ("i/show", "i/hide", etc.)
          * @param {String} stringname new string for the action menu item
          * @param {String} stringcomponent
-         * @param {String} titlestr not used
-         * @param {String} titlecomponent not used
          * @param {String} newaction new value for data-action attribute of the link
          * @return {Promise} promise which is resolved when the replacement has completed
          */
         var replaceActionItem = function(actionitem, image, stringname,
-                                           stringcomponent, titlestr, titlecomponent, newaction) {
+                                           stringcomponent, newaction) {
 
             var stringRequests = [{key: stringname, component: stringcomponent}];
             // Do not provide an icon with duplicate, different text to the menu item.
@@ -387,11 +385,11 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
                 if (action === 'hide') {
                     sectionElement.addClass('hidden');
                     replaceActionItem(actionItem, 'i/show',
-                        'showfromothers', 'format_' + courseformat, null, null, 'show');
+                        'showfromothers', 'format_' + courseformat, 'show');
                 } else {
                     sectionElement.removeClass('hidden');
                     replaceActionItem(actionItem, 'i/hide',
-                        'hidefromothers', 'format_' + courseformat, null, null, 'hide');
+                        'hidefromothers', 'format_' + courseformat, 'hide');
                 }
                 // Replace the modules with new html (that indicates that they are now hidden or not hidden).
                 if (data.modules !== undefined) {
@@ -408,14 +406,14 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
                     oldActionItem = oldmarker.find(SELECTOR.SECTIONACTIONMENU + ' ' + 'a[data-action=removemarker]');
                 oldmarker.removeClass('current');
                 replaceActionItem(oldActionItem, 'i/marker',
-                    'highlight', 'core', 'markthistopic', 'core', 'setmarker');
+                    'highlight', 'core', 'setmarker');
                 sectionElement.addClass('current');
                 replaceActionItem(actionItem, 'i/marked',
-                    'highlightoff', 'core', 'markedthistopic', 'core', 'removemarker');
+                    'highlightoff', 'core', 'removemarker');
             } else if (action === 'removemarker') {
                 sectionElement.removeClass('current');
                 replaceActionItem(actionItem, 'i/marker',
-                    'highlight', 'core', 'markthistopic', 'core', 'setmarker');
+                    'highlight', 'core', 'setmarker');
             }
         };
 
@@ -610,19 +608,19 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
              *
              * This method can be used by course formats in their listener to the coursesectionedited event
              *
+             * @deprecated since Moodle 3.9
              * @param {JQuery} sectionelement
              * @param {String} selector CSS selector inside the section element, for example "a[data-action=show]"
              * @param {String} image new image name ("i/show", "i/hide", etc.)
              * @param {String} stringname new string for the action menu item
              * @param {String} stringcomponent
-             * @param {String} titlestr string for "title" attribute (if different from stringname)
-             * @param {String} titlecomponent
              * @param {String} newaction new value for data-action attribute of the link
              */
             replaceSectionActionItem: function(sectionelement, selector, image, stringname,
-                                                    stringcomponent, titlestr, titlecomponent, newaction) {
+                                                    stringcomponent, newaction) {
+                log.debug('replaceSectionActionItem() is deprecated and will be removed.');
                 var actionitem = sectionelement.find(SELECTOR.SECTIONACTIONMENU + ' ' + selector);
-                replaceActionItem(actionitem, image, stringname, stringcomponent, titlestr, titlecomponent, newaction);
+                replaceActionItem(actionitem, image, stringname, stringcomponent, newaction);
             }
         };
     });