Bug #6170 - Glossary bug: it displays nothing when autolinking to non-ascii text and other minor cleanup

This commit is contained in:
skodak
2006-07-30 22:23:43 +00:00
parent d2b00aae1d
commit 9a0d8fd2b3
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -31,9 +31,9 @@ if (! $glossary = get_record("glossary", "id", $cm->instance)) {
}
if ($CFG->dbtype == 'postgres7' ) {
$ucase = 'lower';
$lcase = 'lower';
} else {
$ucase = 'lcase';
$lcase = 'lcase';
}
if (!$glossary->studentcanpost && !isteacher($glossary->course)) {
@@ -132,7 +132,7 @@ if ( $confirm ) {
$permissiongranted = 1;
if ( !$glossary->allowduplicatedentries ) {
if ($dupentries = get_records("glossary_entries","$ucase(concept)", moodle_strtolower($newentry->concept))) {
if ($dupentries = get_records("glossary_entries","$lcase(concept)", moodle_strtolower($newentry->concept))) {
foreach ($dupentries as $curentry) {
if ( $glossary->id == $curentry->glossaryid ) {
if ( $curentry->id != $e ) {
@@ -172,7 +172,7 @@ if ( $confirm ) {
$permissiongranted = 1;
if ( !$glossary->allowduplicatedentries ) {
if ($dupentries = get_record("glossary_entries","$ucase(concept)", moodle_strtolower($newentry->concept), "glossaryid", $glossary->id)) {
if ($dupentries = get_record("glossary_entries","$lcase(concept)", moodle_strtolower($newentry->concept), "glossaryid", $glossary->id)) {
$permissiongranted = 0;
}
}
+3 -3
View File
@@ -24,9 +24,9 @@
}
if ($CFG->dbtype == 'postgres7' ) {
$ucase = 'lower';
$lcase = 'lower';
} else {
$ucase = 'lcase';
$lcase = 'lcase';
}
if ( !isteacher($cm->course) ) {
@@ -63,7 +63,7 @@
} else {
if ( ! $mainglossary->allowduplicatedentries ) {
$dupentry = get_record('glossary_entries','glossaryid', $mainglossary->id, $ucase.'(concept)',moodle_strtolower(addslashes($entry->concept)));
$dupentry = get_record('glossary_entries','glossaryid', $mainglossary->id, $lcase.'(concept)',moodle_strtolower(addslashes($entry->concept)));
if ( $dupentry ) {
$PermissionGranted = 0;
}