Merge branch 'MDL-67970-master' of git://github.com/rezaies/moodle

This commit is contained in:
Adrian Greeve 2020-03-17 15:23:49 +08:00
commit cc00258669
16 changed files with 32 additions and 27 deletions

View File

@ -170,7 +170,7 @@ class behat_completion extends behat_base {
}
$iconxpath = "//li[contains(concat(' ', @class, ' '), ' modtype_" . strtolower($activitytype) . " ')]";
$iconxpath .= "[descendant::*[contains(text(), '" . $activityname . "')]]";
$iconxpath .= "/descendant::span[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";
$iconxpath .= "/descendant::div[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";
$this->execute("behat_general::the_attribute_of_should_contain",
array("src", $iconxpath, "xpath_element", $imgname)
@ -193,7 +193,7 @@ class behat_completion extends behat_base {
}
$iconxpath = "//li[contains(concat(' ', @class, ' '), ' modtype_" . strtolower($activitytype) . " ')]";
$iconxpath .= "[descendant::*[contains(text(), '" . $activityname . "')]]";
$iconxpath .= "/descendant::span[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";
$iconxpath .= "/descendant::div[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";
$this->execute("behat_general::the_attribute_of_should_contain",
array("src", $iconxpath, "xpath_element", $imgname)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -567,7 +567,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
str.get_string('numberweeks').done(function(strNumberSections) {
var trigger = $(SELECTOR.ADDSECTIONS),
modalTitle = trigger.attr('data-add-sections'),
newSections = trigger.attr('new-sections');
newSections = trigger.attr('data-new-sections');
var modalBody = $('<div><label for="add_section_numsections"></label> ' +
'<input id="add_section_numsections" type="number" min="1" max="' + newSections + '" value="1"></div>');
modalBody.find('label').html(strNumberSections);

View File

@ -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.
$link = get_string('modulename_link', $modname);
$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;

View File

@ -978,7 +978,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$icon = $this->output->pix_icon('t/add', '');
$newsections = $maxsections - $lastsection;
echo html_writer::link($url, $icon . $straddsections,
array('class' => 'add-sections', 'data-add-sections' => $straddsections, 'new-sections' => $newsections));
array('class' => 'add-sections', 'data-add-sections' => $straddsections, 'data-new-sections' => $newsections));
echo html_writer::end_tag('div');
}
}

View File

@ -927,7 +927,7 @@ class core_course_renderer extends plugin_renderer_base {
$modicons .= $this->course_section_cm_completion($course, $completioninfo, $mod, $displayoptions);
if (!empty($modicons)) {
$output .= html_writer::span($modicons, 'actions');
$output .= html_writer::div($modicons, 'actions');
}
// Show availability info (if module is not available).

View File

@ -1291,6 +1291,7 @@ $string['moodleversion'] = 'Moodle version';
$string['moodlerelease'] = 'Moodle release';
$string['more'] = 'more';
$string['morehelp'] = 'More help';
$string['morehelpaboutmodule'] = 'More help about the {$a} module';
$string['moreinfo'] = 'More info';
$string['moreinformation'] = 'More information about this error';
$string['moreprofileinfoneeded'] = 'Please tell us more about yourself';

View File

@ -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 $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 array $attributes htm attributes
* @return string
*/
public function doc_link($path, $text = '', $forcepopup = false) {
public function doc_link($path, $text = '', $forcepopup = false, array $attributes = []) {
global $CFG;
$icon = $this->pix_icon('docs', '', 'moodle', array('class'=>'iconhelp icon-pre', 'role'=>'presentation'));
$url = new moodle_url(get_docs_url($path));
$attributes = array('href'=>$url);
$attributes['href'] = new moodle_url(get_docs_url($path));
if (!empty($CFG->doctonewwindow) || $forcepopup) {
$attributes['class'] = 'helplinkpopup';
}
@ -2161,7 +2160,7 @@ class core_renderer extends renderer_base {
* @param string $pix short pix name
* @param string $alt mandatory alt attribute
* @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
*/
public function image_icon($pix, $alt, $component='moodle', array $attributes = null) {
@ -3217,7 +3216,7 @@ EOD;
'size' => 13, 'tabindex' => -1, 'id' => 'id_q_' . $id, 'class' => 'form-control');
$contents = html_writer::tag('label', get_string('enteryoursearchquery', 'search'),
array('for' => 'id_q_' . $id, 'class' => 'accesshide')) . html_writer::tag('input', '', $inputattrs);
array('for' => 'id_q_' . $id, 'class' => 'accesshide')) . html_writer::empty_tag('input', $inputattrs);
if ($this->page->context && $this->page->context->contextlevel !== CONTEXT_SYSTEM) {
$contents .= html_writer::empty_tag('input', ['type' => 'hidden',
'name' => 'context', 'value' => $this->page->context->id]);

View File

@ -92,7 +92,7 @@
{{/menutrigger}}
</a>
{{#secondary}}
<div class="dropdown-menu dropdown-menu-right {{classes}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}} id="dropdown-menu-{{instance}}">
<div class="dropdown-menu dropdown-menu-right {{classes}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
{{#items}}
{{#actionmenulink}}
<a href="{{url}}" class="dropdown-item {{classes}}" {{#attributes}}{{name}}={{#quote}}{{value}}{{/quote}} {{/attributes}}{{#showtext}}aria-labelledby="actionmenuaction-{{instance}}"{{/showtext}}>

View File

@ -57,14 +57,12 @@
</div>
<div class="alloptions">
{{#sections}}
<div class="moduletypetitle">
<label for="item_{{id}}">
<span class="typename">{{label}}</span>
</label>
</div>
{{#items}}
{{>core/chooser_item}}
{{/items}}
<fieldset>
<legend class="moduletypetitle">{{label}}</legend>
{{#items}}
{{>core/chooser_item}}
{{/items}}
</fieldset>
{{/sections}}
</div>
</div>

View File

@ -63,7 +63,7 @@
]
}
}}
<nav role="navigation" aria-label="{{#str}}breadcrumb, access{{/str}}">
<nav aria-label="{{#str}}breadcrumb, access{{/str}}">
<ol class="breadcrumb">
{{#get_items}}
{{#has_action}}

View File

@ -53,7 +53,6 @@
data-auto-rows
data-min-rows="3"
data-max-rows="5"
role="textbox"
aria-label="{{#str}} writeamessage, core_message {{/str}}"
placeholder="{{#str}} writeamessage, core_message {{/str}}"
style="resize: none"

View File

@ -1419,6 +1419,8 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
text-transform: uppercase;
padding-top: 1.2em;
padding-bottom: 0.4em;
margin-bottom: 0.5rem;
font-size: 100%;
}
.choosercontainer #chooseform .option .typename,

View File

@ -10576,7 +10576,9 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
.choosercontainer #chooseform .moduletypetitle {
text-transform: uppercase;
padding-top: 1.2em;
padding-bottom: 0.4em; }
padding-bottom: 0.4em;
margin-bottom: 0.5rem;
font-size: 100%; }
.choosercontainer #chooseform .option .typename,
.choosercontainer #chooseform .nonoption .typename {

View File

@ -10783,7 +10783,9 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
.choosercontainer #chooseform .moduletypetitle {
text-transform: uppercase;
padding-top: 1.2em;
padding-bottom: 0.4em; }
padding-bottom: 0.4em;
margin-bottom: 0.5rem;
font-size: 100%; }
.choosercontainer #chooseform .option .typename,
.choosercontainer #chooseform .nonoption .typename {