moodle/mod/glossary/showentry.php

30 lines
1.1 KiB
PHP
Raw Normal View History

<?PHP
require_once("../../config.php");
require_once("lib.php");
optional_variable($concept);
optional_variable($courseid,0);
optional_variable($eid,0);
print_header();
if ( $eid ) {
$entries = get_records_sql("select e.* from {$CFG->prefix}glossary_entries e, {$CFG->prefix}glossary g".
" where (e.id = $eid)");
} elseif ( $concept ) {
$entries = get_records_sql("select e.* from {$CFG->prefix}glossary_entries e, {$CFG->prefix}glossary g".
" where e.glossaryid = g.id and".
" (e.casesensitive != 0 and ucase(concept) = '" . strtoupper(trim($concept)). "' or".
" e.casesensitive = 0 and concept = '$concept') and".
" (g.course = $courseid or g.globalglossary) and".
" e.usedynalink != 0 and g.usedynalink != 0");
}
if ( $entries ) {
glossary_print_dynaentry($courseid, $entries);
}
close_window_button();
?>
</body>
</html>