Skip to content

Commit

Permalink
MDL-47962 filter_glossary: Fix lang string concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Sep 20, 2018
1 parent c633345 commit b0a3b52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 5 additions & 6 deletions filter/glossary/filter.php
Expand Up @@ -85,15 +85,13 @@ protected function get_all_concepts() {
return $this->cacheconceptlist;
}

$strcategory = get_string('category', 'glossary');

$conceptlist = array();

foreach ($allconcepts as $concepts) {
foreach ($concepts as $concept) {
if ($concept->category) { // Link to a category.
// TODO: Fix this string usage.
$title = $glossaries[$concept->glossaryid] . ': ' . $strcategory . ' ' . $concept->concept;
$title = get_string('glossarycategory', 'filter_glossary',
['glossary' => $glossaries[$concept->glossaryid], 'category' => $concept->concept]);
$link = new moodle_url('/mod/glossary/view.php', array('g' => $concept->glossaryid, 'mode' => 'cat', 'hook' => $concept->id));
$attributes = array(
'href' => $link,
Expand All @@ -102,7 +100,8 @@ protected function get_all_concepts() {
$conceptid = 0;

} else { // Link to entry or alias
$title = $glossaries[$concept->glossaryid] . ': ' . $concept->concept;
$title = get_string('glossaryconcept', 'filter_glossary',
['glossary' => $glossaries[$concept->glossaryid], 'concept' => $concept->concept]);
// Hardcoding dictionary format in the URL rather than defaulting
// to the current glossary format which may not work in a popup.
// for example "entry list" means the popup would only contain
Expand All @@ -122,7 +121,7 @@ protected function get_all_concepts() {
$href_tag_begin = html_writer::start_tag('a', $attributes);

$filterobj = new filterobject($concept->concept, $href_tag_begin, '</a>',
$concept->casesensitive, $concept->fullmatch);;
$concept->casesensitive, $concept->fullmatch);
$filterobj->conceptid = $conceptid;
$conceptlist[] = $filterobj;
}
Expand Down
2 changes: 2 additions & 0 deletions filter/glossary/lang/en/filter_glossary.php
Expand Up @@ -25,5 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$string['glossarycategory'] = '{$a->glossary}: Category {$a->category}';
$string['glossaryconcept'] = '{$a->glossary}: {$a->concept}';
$string['filtername'] = 'Glossary auto-linking';
$string['privacy:metadata'] = 'The Glossary auto-linking plugin does not store any personal data.';

0 comments on commit b0a3b52

Please sign in to comment.