Skip to content

Commit

Permalink
Fixing Bug #1765 (mystery fix).
Browse files Browse the repository at this point in the history
  • Loading branch information
julmis committed Aug 22, 2004
1 parent 66991ec commit 5985f9d
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions mod/glossary/edit.php
Expand Up @@ -52,7 +52,7 @@
$newentry->usedynalink = $form->usedynalink;
$newentry->casesensitive = $form->casesensitive;
$newentry->fullmatch = $form->fullmatch;
$newentry->timemodified = $timenow;
$newentry->timemodified = $timenow;
$newentry->approved = 0;
if ( $glossary->defaultapproval or isteacher($course->id) ) {
$newentry->approved = 1;
Expand All @@ -73,8 +73,8 @@
}

print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"index.php?id=$course->id\">$strglossaries</A> ->
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"index.php?id=$course->id\">$strglossaries</A> ->
<A HREF=\"view.php?id=$cm->id\">$glossary->name</A> -> $stredit", "form.text",
"", true, "", navmenu($course, $cm));

Expand All @@ -88,7 +88,7 @@

if ($e) {
$newentry->id = $e;

$permissiongranted = 1;
if ( !$glossary->allowduplicatedentries ) {
if ($dupentries = get_records("glossary_entries","UCASE(concept)", strtoupper($newentry->concept))) {
Expand All @@ -102,7 +102,7 @@
}
}
}

if ( $permissiongranted ) {
$newentry->attachment = $_FILES["attachment"];
if ($newfilename = glossary_add_attachment($newentry, $newentry->attachment)) {
Expand All @@ -115,7 +115,7 @@
error("Could not update your glossary");
} else {
add_to_log($course->id, "glossary", "update entry", "view.php?id=$cm->id&mode=entry&hook=$newentry->id", $newentry->id,$cm->id);
}
}
} else {
error("Could not update this glossary entry because this concept already exist.");
}
Expand All @@ -125,7 +125,7 @@
$newentry->timecreated = $timenow;
$newentry->sourceglossaryid = 0;
$newentry->teacherentry = isteacher($course->id);

$permissiongranted = 1;
if ( !$glossary->allowduplicatedentries ) {
if ($dupentries = get_record("glossary_entries","UCASE(concept)", strtoupper($newentry->concept), "glossaryid", $glossary->id)) {
Expand Down Expand Up @@ -203,7 +203,7 @@
}
}
}
//Fill and print the form.
//Fill and print the form.
//We check every field has a default values here!!
if (!isset($newentry->concept)) {
$newentry->concept = "";
Expand All @@ -223,14 +223,14 @@
$newentry->casesensitive = $CFG->glossary_casesensitive;
} else {
$newentry->casesensitive = 0;
}
}
}
if (!isset($newentry->fullmatch)) {
if (isset($CFG->glossary_fullmatch)) {
$newentry->fullmatch = $CFG->glossary_fullmatch;
} else {
$newentry->fullmatch = 0;
}
}
}
if (!isset($newentry->definition)) {
$newentry->definition = "";
Expand All @@ -248,8 +248,8 @@
}

print_header(strip_tags("$course->shortname: $glossary->name"), "$course->fullname",
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"index.php?id=$course->id\">$strglossaries</A> ->
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> ->
<A HREF=\"index.php?id=$course->id\">$strglossaries</A> ->
<A HREF=\"view.php?id=$cm->id\">$glossary->name</A> -> $stredit", "",
"", true, "", navmenu($course, $cm));

Expand All @@ -273,6 +273,12 @@
echo '</center>';
glossary_print_tabbed_table_end();

// Lets give IE more time to load the whole page
// before trying to load the editor.
if ($usehtmleditor) {
use_html_editor("text");
}

print_footer($course);

?>

0 comments on commit 5985f9d

Please sign in to comment.