Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-60441 mod_glossary: Add a link to glossary entries
  • Loading branch information
juancs committed Oct 15, 2017
1 parent 9a316f3 commit 6e4e60e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions mod/glossary/lang/en/glossary.php
Expand Up @@ -151,6 +151,7 @@
$string['entryexported'] = 'Entry successfully exported';
$string['entryishidden'] = '(this entry is currently hidden)';
$string['entryleveldefaultsettings'] = 'Entry level default settings';
$string['entrylink'] = 'Entry link: {$a}';
$string['entrysaved'] = 'This entry has been saved';
$string['entryupdated'] = 'This entry has been updated';
$string['entryusedynalink'] = 'This entry should be automatically linked';
Expand Down
8 changes: 6 additions & 2 deletions mod/glossary/lib.php
Expand Up @@ -1226,11 +1226,10 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h

$context = context_module::instance($cm->id);

$output = false; //To decide if we must really return text in "return". Activate when needed only!
$output = false; // To decide if we must really return text in "return". Activate when needed only!
$importedentry = ($entry->sourceglossaryid == $glossary->id);
$ismainglossary = $glossary->mainglossary;


$return = '<span class="commands">';
// Differentiate links for each entry.
$altsuffix = strip_tags(format_text($entry->concept));
Expand All @@ -1241,6 +1240,11 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
array('class' => 'glossary-hidden-note'));
}

// Entry link.
$return .= '<a class="icon" title="' . get_string('entrylink', 'glossary', $altsuffix) . '" ' .
' href="showentry.php?eid=' . $entry->id . '">' .
$OUTPUT->pix_icon('e/insert_edit_link', get_string('entrylink', 'glossary', $altsuffix)) . '</a>';

if (has_capability('mod/glossary:approve', $context) && !$glossary->defaultapproval && $entry->approved) {
$output = true;
$return .= '<a class="icon" title="' . get_string('disapprove', 'glossary').
Expand Down

0 comments on commit 6e4e60e

Please sign in to comment.