mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-72673 mod_glossary: Generate unique ID for Keywords select element
This commit is contained in:
parent
214adb7984
commit
8c180760eb
@ -1195,18 +1195,9 @@ function glossary_print_entry_aliases($course, $cm, $glossary, $entry,$mode='',
|
||||
global $DB;
|
||||
|
||||
$return = '';
|
||||
if ( $aliases = $DB->get_records('glossary_alias', array('entryid'=>$entry->id))) {
|
||||
foreach ($aliases as $alias) {
|
||||
if (trim($alias->alias)) {
|
||||
if ($return == '') {
|
||||
$return = '<select id="keyword" class="custom-select">';
|
||||
}
|
||||
$return .= "<option>$alias->alias</option>";
|
||||
}
|
||||
}
|
||||
if ($return != '') {
|
||||
$return .= '</select>';
|
||||
}
|
||||
if ($aliases = $DB->get_fieldset_select('glossary_alias', 'alias', 'entryid = :entryid', ['entryid' => $entry->id])) {
|
||||
$id = "keyword-{$entry->id}";
|
||||
$return = html_writer::select($aliases, $id, '', false, ['id' => $id]);
|
||||
}
|
||||
if ($type == 'print') {
|
||||
echo $return;
|
||||
@ -1376,9 +1367,10 @@ function glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $m
|
||||
if ($aliases || $icons || !empty($entry->rating)) {
|
||||
echo '<table>';
|
||||
if ( $aliases ) {
|
||||
$id = "keyword-{$entry->id}";
|
||||
echo '<tr valign="top"><td class="aliases">' .
|
||||
'<label for="keyword">' . get_string('aliases','glossary').': </label>' .
|
||||
$aliases . '</td></tr>';
|
||||
'<label for="' . $id . '">' . get_string('aliases', 'glossary') . ': </label>' .
|
||||
$aliases . '</td></tr>';
|
||||
}
|
||||
if ($icons) {
|
||||
echo '<tr valign="top"><td class="icons">'.$icons.'</td></tr>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user