mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-67970 course: More informative aria-label for 'more help'
This commit is contained in:
parent
99cac46162
commit
f064e11579
3 changed files with 8 additions and 6 deletions
|
@ -53,7 +53,9 @@ class content_item_readonly_repository implements content_item_readonly_reposito
|
||||||
if ($sm->string_exists('modulename_link', $modname)) { // Link to further info in Moodle docs.
|
if ($sm->string_exists('modulename_link', $modname)) { // Link to further info in Moodle docs.
|
||||||
$link = get_string('modulename_link', $modname);
|
$link = get_string('modulename_link', $modname);
|
||||||
$linktext = get_string('morehelp');
|
$linktext = get_string('morehelp');
|
||||||
$help .= \html_writer::tag('div', $OUTPUT->doc_link($link, $linktext, true), ['class' => 'helpdoclink']);
|
$arialabel = get_string('morehelpaboutmodule', '', get_string('modulename', $modname));
|
||||||
|
$doclink = $OUTPUT->doc_link($link, $linktext, true, ['aria-label' => $arialabel]);
|
||||||
|
$help .= \html_writer::tag('div', $doclink, ['class' => 'helpdoclink']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $help;
|
return $help;
|
||||||
|
|
|
@ -1291,6 +1291,7 @@ $string['moodleversion'] = 'Moodle version';
|
||||||
$string['moodlerelease'] = 'Moodle release';
|
$string['moodlerelease'] = 'Moodle release';
|
||||||
$string['more'] = 'more';
|
$string['more'] = 'more';
|
||||||
$string['morehelp'] = 'More help';
|
$string['morehelp'] = 'More help';
|
||||||
|
$string['morehelpaboutmodule'] = 'More help about the {$a} module';
|
||||||
$string['moreinfo'] = 'More info';
|
$string['moreinfo'] = 'More info';
|
||||||
$string['moreinformation'] = 'More information about this error';
|
$string['moreinformation'] = 'More information about this error';
|
||||||
$string['moreprofileinfoneeded'] = 'Please tell us more about yourself';
|
$string['moreprofileinfoneeded'] = 'Please tell us more about yourself';
|
||||||
|
|
|
@ -2135,16 +2135,15 @@ class core_renderer extends renderer_base {
|
||||||
* @param string $path The page link after doc root and language, no leading slash.
|
* @param string $path The page link after doc root and language, no leading slash.
|
||||||
* @param string $text The text to be displayed for the link
|
* @param string $text The text to be displayed for the link
|
||||||
* @param boolean $forcepopup Whether to force a popup regardless of the value of $CFG->doctonewwindow
|
* @param boolean $forcepopup Whether to force a popup regardless of the value of $CFG->doctonewwindow
|
||||||
|
* @param array $attributes htm attributes
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function doc_link($path, $text = '', $forcepopup = false) {
|
public function doc_link($path, $text = '', $forcepopup = false, array $attributes = []) {
|
||||||
global $CFG;
|
global $CFG;
|
||||||
|
|
||||||
$icon = $this->pix_icon('docs', '', 'moodle', array('class'=>'iconhelp icon-pre', 'role'=>'presentation'));
|
$icon = $this->pix_icon('docs', '', 'moodle', array('class'=>'iconhelp icon-pre', 'role'=>'presentation'));
|
||||||
|
|
||||||
$url = new moodle_url(get_docs_url($path));
|
$attributes['href'] = new moodle_url(get_docs_url($path));
|
||||||
|
|
||||||
$attributes = array('href'=>$url);
|
|
||||||
if (!empty($CFG->doctonewwindow) || $forcepopup) {
|
if (!empty($CFG->doctonewwindow) || $forcepopup) {
|
||||||
$attributes['class'] = 'helplinkpopup';
|
$attributes['class'] = 'helplinkpopup';
|
||||||
}
|
}
|
||||||
|
@ -2161,7 +2160,7 @@ class core_renderer extends renderer_base {
|
||||||
* @param string $pix short pix name
|
* @param string $pix short pix name
|
||||||
* @param string $alt mandatory alt attribute
|
* @param string $alt mandatory alt attribute
|
||||||
* @param string $component standard compoennt name like 'moodle', 'mod_forum', etc.
|
* @param string $component standard compoennt name like 'moodle', 'mod_forum', etc.
|
||||||
* @param array $attributes htm lattributes
|
* @param array $attributes htm attributes
|
||||||
* @return string HTML fragment
|
* @return string HTML fragment
|
||||||
*/
|
*/
|
||||||
public function image_icon($pix, $alt, $component='moodle', array $attributes = null) {
|
public function image_icon($pix, $alt, $component='moodle', array $attributes = null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue