Permalink
Browse files

MDL-30899 moodle-core-notification Adding close button title for acce…

…ssibility
  • Loading branch information...
1 parent 0409483 commit 520a601f1484241216ed8e9ab0eea32e1f1b6637 @dmonllao dmonllao committed Sep 21, 2012
@@ -322,6 +322,7 @@ public function display() {
$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',
@@ -228,10 +228,10 @@
}
}
$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));
@@ -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'
+ }
}
});
@@ -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'
+ }
}
});
View
@@ -4547,7 +4547,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',
@@ -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'
}
}
});
@@ -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

0 comments on commit 520a601

Please sign in to comment.