Merge branch 'MDL-70173-310' of git://github.com/rezaies/moodle into MOODLE_310_STABLE

This commit is contained in:
Sara Arjona 2021-02-09 08:29:26 +01:00
commit 8f66f8807d
13 changed files with 45 additions and 43 deletions

View file

@ -126,7 +126,8 @@ class block_online_users extends block_base {
} else { // Not a guest user.
$this->content->text .= '<div class="user">';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->page->course->id.'" title="'.$timeago.'">';
$this->content->text .= $OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false, 'link'=>false)) .$user->fullname.'</a></div>';
$avataroptions = ['size' => 16, 'visibletoscreenreaders' => false, 'link' => false];
$this->content->text .= $OUTPUT->user_picture($user, $avataroptions) . $user->fullname . '</a></div>';
if ($USER->id == $user->id) {
if ($CFG->block_online_users_onlinestatushiding) {

View file

@ -45,8 +45,7 @@
<div class="hidden text-xs-center text-center mt-3" data-region="empty-message">
<img class="empty-placeholder-image-lg mt-1"
src="{{nocoursesimgurl}}"
alt="{{#str}} nocourses, block_recentlyaccessedcourses {{/str}}"
role="presentation">
alt="">
<p class="text-muted mt-3">{{#str}} nocourses, block_recentlyaccessedcourses {{/str}}</p>
</div>
</div>

View file

@ -46,8 +46,7 @@
<div class="hidden text-xs-center text-center mt-3" data-region="empty-message">
<img
src="{{urls.noevents}}"
alt="{{#str}} noevents, block_timeline {{/str}}"
role="presentation"
alt=""
style="height: 70px; width: 70px"
>
<p class="text-muted mt-1">{{#str}} noevents, block_timeline {{/str}}</p>

View file

@ -41,8 +41,7 @@
<div class="hidden text-xs-center text-center mt-3" data-region="no-courses-empty-message">
<img
src="{{urls.noevents}}"
alt="{{#str}} nocoursesinprogress, block_timeline {{/str}}"
role="presentation"
alt=""
style="height: 70px; width: 70px"
>
<p class="text-muted mt-1">{{#str}} nocoursesinprogress, block_timeline {{/str}}</p>

View file

@ -2516,8 +2516,6 @@ class core_renderer extends renderer_base {
* @return string
*/
protected function render_user_picture(user_picture $userpicture) {
global $CFG, $DB;
$user = $userpicture->user;
$canviewfullnames = has_capability('moodle/site:viewfullnames', $this->page->context);
@ -2550,11 +2548,10 @@ class core_renderer extends renderer_base {
$attributes = array('src' => $src, 'class' => $class, 'width' => $size, 'height' => $size);
if (!$userpicture->visibletoscreenreaders) {
$alt = '';
$attributes['aria-hidden'] = 'true';
}
$attributes['alt'] = $alt;
if (!empty($alt)) {
$attributes['alt'] = $alt;
$attributes['title'] = $alt;
}
@ -4134,6 +4131,8 @@ EOD;
// Make sure to use the heading if it has been set.
if (isset($headerinfo['heading'])) {
$heading = $headerinfo['heading'];
} else {
$heading = $this->page->heading;
}
// The user context currently has images and buttons. Other contexts may follow.
@ -4158,7 +4157,7 @@ EOD;
if (user_can_view_profile($user, $course)) {
// Use the user's full name if the heading isn't set.
if (!isset($heading)) {
if (empty($heading)) {
$heading = fullname($user);
}
@ -4232,9 +4231,17 @@ EOD;
*/
protected function render_context_header(context_header $contextheader) {
// Generate the heading first and before everything else as we might have to do an early return.
if (!isset($contextheader->heading)) {
$heading = $this->heading($this->page->heading, $contextheader->headinglevel);
} else {
$heading = $this->heading($contextheader->heading, $contextheader->headinglevel);
}
$showheader = empty($this->page->layout_options['nocontextheader']);
if (!$showheader) {
return '';
// Return the heading wrapped in an sr-only element so it is only visible to screen-readers.
return html_writer::div($heading, 'sr-only');
}
// All the html stuff goes here.
@ -4247,13 +4254,7 @@ EOD;
}
// Headings.
if (!isset($contextheader->heading)) {
$headings = $this->heading($this->page->heading, $contextheader->headinglevel);
} else {
$headings = $this->heading($contextheader->heading, $contextheader->headinglevel);
}
$html .= html_writer::tag('div', $headings, array('class' => 'page-header-headings'));
$html .= html_writer::tag('div', $heading, array('class' => 'page-header-headings'));
// Buttons.
if (isset($contextheader->additionalbuttons)) {

View file

@ -37,8 +37,10 @@
{{$drawercontent}}
<div id="message-drawer-{{uniqid}}" class="message-app" data-region="message-drawer" role="region">
<div class="closewidget bg-light border-bottom text-right">
<a class="text-dark" data-action="closedrawer" href="#">
{{#pix}} i/window_close, core, {{#str}} closebuttontitle {{/str}} {{/pix}}
<a class="text-dark" data-action="closedrawer" href="#"
title="{{#str}} closebuttontitle {{/str}}" aria-label="{{#str}} closebuttontitle {{/str}}"
>
{{#pix}} i/window_close, core {{/pix}}
</a>
</div>
<div class="header-container position-relative" data-region="header-container">

View file

@ -77,7 +77,7 @@ Feature: Edit quiz page - adding things
When I press "Repaginate"
Then I should see "Repaginate with"
And I set the field "menuquestionsperpage" to "2"
When I press "Go"
When I click on "Go" "button" in the "Repaginate" "dialogue"
And I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "2"
@ -231,7 +231,7 @@ Feature: Edit quiz page - adding things
When I press "Repaginate"
Then I should see "Repaginate with"
And I set the field "menuquestionsperpage" to "1"
When I press "Go"
When I click on "Go" "button" in the "Repaginate" "dialogue"
And I should see "Essay 03" on quiz page "1"
And I should see "Essay 01" on quiz page "2"
And I should see "Essay 02" on quiz page "3"

View file

@ -107,7 +107,7 @@ Feature: Edit quiz page - pagination
# Repaginate one question per page.
When I press "Repaginate"
And I set the field "menuquestionsperpage" to "1"
And I press "Go"
And I click on "Go" "button" in the "Repaginate" "dialogue"
Then I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "2"
And I should see "Essay 03 new" on quiz page "3"
@ -136,7 +136,7 @@ Feature: Edit quiz page - pagination
# Repaginate with 2 questions per page.
When I press "Repaginate"
And I set the field "menuquestionsperpage" to "2"
And I press "Go"
And I click on "Go" "button" in the "Repaginate" "dialogue"
Then I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "2"
@ -145,7 +145,7 @@ Feature: Edit quiz page - pagination
# Repaginate with unlimited questions per page (All questions on Page 1).
When I press "Repaginate"
And I set the field "menuquestionsperpage" to "Unlimited"
And I press "Go"
And I click on "Go" "button" in the "Repaginate" "dialogue"
Then I should see "Essay 01 new" on quiz page "1"
And I should see "Essay 02 new" on quiz page "1"
And I should see "Essay 03 new" on quiz page "1"

View file

@ -62,14 +62,15 @@ if (isguestuser()) { // Force them to see system default, no editing allowed
$USER->editing = $edit = 0; // Just in case
$context = context_system::instance();
$PAGE->set_blocks_editing_capability('moodle/my:configsyspages'); // unlikely :)
$header = "$SITE->shortname: $strmymoodle (GUEST)";
$strguest = get_string('guest');
$header = "$SITE->shortname: $strmymoodle ($strguest)";
$pagetitle = $header;
} else { // We are trying to view or edit our own My Moodle page
$userid = $USER->id; // Owner of the page
$context = context_user::instance($USER->id);
$PAGE->set_blocks_editing_capability('moodle/my:manageblocks');
$header = fullname($USER);
$header = "$SITE->shortname: $strmymoodle";
$pagetitle = $strmymoodle;
}

View file

@ -73,8 +73,8 @@ $content-header-footer-height: $region-header-height + $region-footer-height;
border-radius: 2px;
background-color: red;
color: white;
font-size: 10px;
line-height: 10px;
font-size: 11px;
line-height: 11px;
position: absolute;
top: 5px;
right: 0;
@ -191,8 +191,8 @@ $content-header-footer-height: $region-header-height + $region-footer-height;
border-radius: 2px;
background-color: red;
color: white;
font-size: 10px;
line-height: 10px;
font-size: 11px;
line-height: 11px;
position: absolute;
top: 5px;
right: 0;

View file

@ -18862,8 +18862,8 @@ body {
border-radius: 2px;
background-color: red;
color: white;
font-size: 10px;
line-height: 10px;
font-size: 11px;
line-height: 11px;
position: absolute;
top: 5px;
right: 0; }
@ -18950,8 +18950,8 @@ body {
border-radius: 2px;
background-color: red;
color: white;
font-size: 10px;
line-height: 10px;
font-size: 11px;
line-height: 11px;
position: absolute;
top: 5px;
right: 0; }

View file

@ -19,8 +19,8 @@
}}
<div id="goto-top-link">
{{! go to top is sticky to footer so needs to be sibling }}
<a class="btn btn-light" role="button" href="#">
{{#pix}} i/up, core, {{#str}} totop, theme_boost {{/str}}{{/pix}}
<a class="btn btn-light" role="button" href="#" aria-label="{{#str}} totop, theme_boost {{/str}}">
{{#pix}} i/up, core{{/pix}}
</a>
</div>
<footer id="page-footer" class="py-3 bg-dark text-light">

View file

@ -19043,8 +19043,8 @@ body {
border-radius: 2px;
background-color: red;
color: white;
font-size: 10px;
line-height: 10px;
font-size: 11px;
line-height: 11px;
position: absolute;
top: 5px;
right: 0; }
@ -19131,8 +19131,8 @@ body {
border-radius: 2px;
background-color: red;
color: white;
font-size: 10px;
line-height: 10px;
font-size: 11px;
line-height: 11px;
position: absolute;
top: 5px;
right: 0; }