MDL-74808 question: only add title attr if tooltip is set
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
{{/params}}
|
||||
<button type="submit" class="btn {{#primary}}btn-primary{{/primary}}{{^primary}}btn-secondary{{/primary}}"
|
||||
id="{{id}}"
|
||||
title="{{tooltip}}"
|
||||
{{#tooltip}}title="{{tooltip}}"{{/tooltip}}
|
||||
{{#disabled}}disabled{{/disabled}}
|
||||
{{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{label}}</button>
|
||||
</form>
|
||||
|
||||
@@ -78,9 +78,13 @@ class editquestion_helper {
|
||||
if ($canadd) {
|
||||
$params['category'] = $categoryid;
|
||||
$url = new \moodle_url('/question/bank/editquestion/addquestion.php', $params);
|
||||
$buttonparams = ['disabled' => $disabled];
|
||||
if (!empty($tooltip)) {
|
||||
$buttonparams['title'] = $tooltip;
|
||||
}
|
||||
$addquestiondisplay['buttonhtml'] = $OUTPUT->single_button($url,
|
||||
get_string('createnewquestion', 'question'),
|
||||
'get', array('disabled' => $disabled, 'title' => $tooltip));
|
||||
'get', $buttonparams);
|
||||
$addquestiondisplay['qtypeform'] = self::print_choose_qtype_to_add_form(array());
|
||||
}
|
||||
return $PAGE->get_renderer('qbank_editquestion')->render_create_new_question_button($addquestiondisplay);
|
||||
|
||||
Reference in New Issue
Block a user