MDL-65298 core_course: Remove unused function parameters

This commit is contained in:
Mathew May
2020-03-05 10:36:41 +08:00
parent d7374522ed
commit f3c47c9ca8
3 changed files with 14 additions and 16 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+12 -14
View 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);
}
};
});