diff --git a/backup/util/ui/base_moodleform.class.php b/backup/util/ui/base_moodleform.class.php index ce95e7a81d6..fb0e975acfd 100644 --- a/backup/util/ui/base_moodleform.class.php +++ b/backup/util/ui/base_moodleform.class.php @@ -322,6 +322,7 @@ abstract class base_moodleform extends moodleform { $config->question = get_string('confirmcancelquestion', 'backup'); $config->yesLabel = get_string('confirmcancelyes', 'backup'); $config->noLabel = get_string('confirmcancelno', 'backup'); + $config->closeButtonTitle = get_string('close', 'editor'); $PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_cancel_buttons', array($config)); $PAGE->requires->yui_module('moodle-backup-backupselectall', 'M.core_backup.select_all_init', diff --git a/blocks/community/communitycourse.php b/blocks/community/communitycourse.php index 3e6497f1161..045e72dea88 100644 --- a/blocks/community/communitycourse.php +++ b/blocks/community/communitycourse.php @@ -228,10 +228,10 @@ if (!empty($courses)) { } } $PAGE->requires->yui_module('moodle-block_community-comments', 'M.blocks_community.init_comments', - array(array('commentids' => $commentedcourseids))); + array(array('commentids' => $commentedcourseids, 'closeButtonTitle' => get_string('close', 'editor')))); $PAGE->requires->yui_module('moodle-block_community-imagegallery', 'M.blocks_community.init_imagegallery', array(array('imageids' => $courseids, 'imagenumbers' => $courseimagenumbers, - 'huburl' => $huburl))); + 'huburl' => $huburl, 'closeButtonTitle' => get_string('close', 'editor')))); echo highlight($search, $renderer->course_list($courses, $huburl, $courseid)); diff --git a/blocks/community/yui/comments/comments.js b/blocks/community/yui/comments/comments.js index 0fa8601e23c..a591ad993c0 100644 --- a/blocks/community/yui/comments/comments.js +++ b/blocks/community/yui/comments/comments.js @@ -24,7 +24,8 @@ YUI.add('moodle-block_community-comments', function(Y) { bodyContent:Y.one('#commentoverlay-'+commentid).get('innerHTML'), visible: false, //by default it is not displayed lightbox : false, - zIndex:100 + zIndex:100, + closeButtonTitle: this.get('closeButtonTitle') }); this.panels[commentid].get('contentBox').one('.commenttitle').remove(); @@ -78,7 +79,11 @@ YUI.add('moodle-block_community-comments', function(Y) { }, { NAME : COMMENTSNAME, ATTRS : { - commentids: {} + commentids: {}, + closeButtonTitle : { + validator : Y.Lang.isString, + value : 'Close' + } } }); diff --git a/blocks/community/yui/imagegallery/imagegallery.js b/blocks/community/yui/imagegallery/imagegallery.js index a4cb4570577..7696f201844 100644 --- a/blocks/community/yui/imagegallery/imagegallery.js +++ b/blocks/community/yui/imagegallery/imagegallery.js @@ -102,7 +102,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) { bodyContent:Y.one('#imageoverlay').get('innerHTML'), visible: false, //by default it is not displayed lightbox : false, - zIndex:100 + zIndex:100, + closeButtonTitle: this.get('closeButtonTitle') }); this.panel.render(); this.panel.hide(); //show the panel @@ -187,7 +188,11 @@ YUI.add('moodle-block_community-imagegallery', function(Y) { ATTRS : { imageids: {}, imagenumbers: {}, - huburl: {} + huburl: {}, + closeButtonTitle : { + validator : Y.Lang.isString, + value : 'Close' + } } }); diff --git a/course/lib.php b/course/lib.php index 9f5fce1317b..765fecbbdcd 100644 --- a/course/lib.php +++ b/course/lib.php @@ -4528,7 +4528,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules = // Add the module chooser $PAGE->requires->yui_module('moodle-course-modchooser', 'M.course.init_chooser', - array(array('courseid' => $course->id)) + array(array('courseid' => $course->id, 'closeButtonTitle' => get_string('close', 'editor'))) ); $PAGE->requires->strings_for_js(array( 'addresourceoractivity', diff --git a/lib/yui/chooserdialogue/chooserdialogue.js b/lib/yui/chooserdialogue/chooserdialogue.js index 7d819827fc1..fbbb1ce754a 100644 --- a/lib/yui/chooserdialogue/chooserdialogue.js +++ b/lib/yui/chooserdialogue/chooserdialogue.js @@ -43,7 +43,9 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { draggable : true, visible : false, // Hide by default zindex : 100, // Display in front of other items - lightbox : true // This dialogue should be modal + lightbox : true, // This dialogue should be modal + shim : true, + closeButtonTitle : this.get('closeButtonTitle') }; // Override with additional options @@ -314,6 +316,10 @@ YUI.add('moodle-core-chooserdialogue', function(Y) { }, maxheight : { value : 660 + }, + closeButtonTitle : { + validator : Y.Lang.isString, + value : 'Close' } } }); diff --git a/lib/yui/notification/notification.js b/lib/yui/notification/notification.js index 8cc168f2a51..9bd15438148 100644 --- a/lib/yui/notification/notification.js +++ b/lib/yui/notification/notification.js @@ -61,6 +61,11 @@ var DIALOGUE = function(config) { ]; } DIALOGUE.superclass.constructor.apply(this, [config]); + + if (config.closeButton !== false) { + // The buttons constructor does not allow custom attributes + this.get('buttons').header[0].setAttribute('title', this.get('closeButtonTitle')); + } }; Y.extend(DIALOGUE, Y.Panel, { initializer : function(config) { @@ -111,6 +116,10 @@ Y.extend(DIALOGUE, Y.Panel, { validator : Y.Lang.isBoolean, value : true }, + closeButtonTitle : { + validator : Y.Lang.isString, + value : 'Close' + }, center : { validator : Y.Lang.isBoolean, value : true