Skip to content

Commit

Permalink
MDL-31647 Glossary: Links to glossary entries from glossary main page…
Browse files Browse the repository at this point in the history
… should not be popups
  • Loading branch information
sammarshallou committed Feb 17, 2012
1 parent 0dde394 commit f5f19eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
7 changes: 3 additions & 4 deletions mod/glossary/formats/entrylist/entrylist_format.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode=''

$anchortagcontents = glossary_print_entry_concept($entry, true);

$link = "/mod/glossary/showentry.php?courseid={$course->id}&eid={$entry->id}&displayformat=dictionary";
$action = new popup_action('click', $link.'&popup=1', 'entry',array('title'=>'entry','width'=>600,'height'=>450));

$anchor = $OUTPUT->action_link($link, $anchortagcontents, $action);
$link = new moodle_url('/mod/glossary/showentry.php', array('courseid' => $course->id,
'eid' => $entry->id, 'displayformat' => 'dictionary'));
$anchor = html_writer::link($link, $anchortagcontents);

echo "<div class=\"concept\">$anchor</div> ";
echo '</td><td align="right" class="entrylowersection">';
Expand Down
15 changes: 2 additions & 13 deletions mod/glossary/showentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
$courseid = optional_param('courseid', 0, PARAM_INT);
$eid = optional_param('eid', 0, PARAM_INT); // glossary entry id
$displayformat = optional_param('displayformat',-1, PARAM_SAFEDIR);
$popup = optional_param('popup',0, PARAM_INT);

$url = new moodle_url('/mod/glossary/showentry.php');
$url->param('concept', $concept);
Expand Down Expand Up @@ -40,11 +39,7 @@
print_error('invalidelementid');
}

if ($popup) {
$PAGE->set_pagelayout('popup');
} else {
$PAGE->set_pagelayout('course');
}
$PAGE->set_pagelayout('course');

if ($entries) {
foreach ($entries as $key => $entry) {
Expand All @@ -65,9 +60,7 @@
continue;
}
}
if (!$popup) {
$entries[$key]->footer = "<p style=\"text-align:right\">&raquo;&nbsp;<a href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>";
}
$entries[$key]->footer = "<p style=\"text-align:right\">&raquo;&nbsp;<a href=\"$CFG->wwwroot/mod/glossary/view.php?g=$entry->glossaryid\">".format_string($entry->glossaryname,true)."</a></p>";
add_to_log($entry->courseid, 'glossary', 'view entry', "showentry.php?eid=$entry->id", $entry->id, $entry->cmid);
}
}
Expand All @@ -89,9 +82,5 @@
glossary_print_dynaentry($courseid, $entries, $displayformat);
}

if ($popup) {
echo $OUTPUT->close_window_button();
}

/// Show one reduced footer
echo $OUTPUT->footer();

0 comments on commit f5f19eb

Please sign in to comment.