<tr valign=top>
<td align=right><p><b><?php echo get_string("concept","glossary") ?>:</b></p></td>
<td>
- <INPUT type="text" name="concept" size=30 value="<?php p($newentry->concept) ?>">
+ <table boder="0" width="100%">
+ <tr>
+ <td>
+ <INPUT type="text" name="concept" size=30 value="<?php p($newentry->concept) ?>"></td>
+ <td align="right">
+<?PHP
+ if ( !$glossary->usedynalink ) {
+ echo '<input type="hidden" name=usedynalink value="0">';
+ echo '<input type="hidden" name=casesensitive value="0">';
+ echo '<input type="hidden" name=fullmatch value="0">';
+ } else {
+ echo '<small>' . get_string("entryusedynalink","glossary") . ':</small>';
+ echo '<script>var items = [\'casesensitive\',\'fullmatch\'];</script>';
+ $selected = "";
+ if ( isset($newentry->usedynalink) ) {
+ if ($newentry->usedynalink) {
+ $selected = "checked";
+ }
+ } elseif ( $CFG->glossary_linkentries ) {
+ $selected = "checked";
+ }
+ echo '<input type="checkbox" name="usedynalink" value=1 ' . $selected . ' onclick="return lockoptions(\'form\',\'usedynalink\', items)"> ' . helpbutton("usedynalink", strip_tags(get_string("usedynalink", "glossary")), "glossary");
+ }
+?>
+ </td></tr></table>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php echo get_string("categories","glossary") ?>:</b></p></td>
- <td>
+ <td valign="top">
<table border=0>
<tr>
- <td>
+ <td valign="top">
<?php
$categories = get_records("glossary_categories","glossaryid",$glossary->id);
- echo "<select size=\"8\" name=\"categories[]\" multiple=\"yes\">";
+ echo "<select size=\"5\" name=\"categories[]\" multiple=\"yes\">";
echo "<option value=\"0\">" . get_string("notcategorised","glossary") . "</optioon>";
if ( $categories ) {
}
?>
</select>
- <td>
- <td width=100%>
- <table border=0>
+ </td>
+ <td width="100%" valign="top">
+ <table border="0">
<tr>
- <td align=center width=58%>
+ <td align="center" width="58%" valign="top">
<?PHP
- if ( !$glossary->usedynalink ) {
- echo '<input type="hidden" name=usedynalink value="0">';
- echo '<input type="hidden" name=casesensitive value="0">';
- echo '<input type="hidden" name=fullmatch value="0">';
- } else {
-?>
- <table border=0 width=100%>
- <tr><td align=right width=80%><small><?php echo get_string("entryusedynalink","glossary") ?>:</small></td><td width=20%>
- <script>
- var items = ['casesensitive','fullmatch'];
- </script>
-<?php
- $selected = "";
- if ( isset($newentry->usedynalink) ) {
- if ($newentry->usedynalink) {
- $selected = "checked";
- }
- } elseif ( $CFG->glossary_linkentries ) {
- $selected = "checked";
- }
-?>
- <input type="checkbox" name="usedynalink" value=1 <?php p($selected) ?> onclick="return lockoptions('form','usedynalink', items)"> <?php helpbutton("usedynalink", strip_tags(get_string("usedynalink", "glossary")), "glossary") ?>
- </td></tr>
- <tr><td align=right width=80%><small><?php echo get_string("casesensitive","glossary") ?>:</small></td><td width=20%>
-<?php
- $selected = "";
- if ( isset($newentry->casesensitive) ) {
- if ($newentry->casesensitive) {
+ if ( $glossary->usedynalink ) {
+
+ echo '<table border="0" width="100%">';
+ echo '<tr><td colspan="2" align="right"><small><strong> ' . get_string("aliases","glossary") . ' ';
+ helpbutton("aliases", strip_tags(get_string("aliases", "glossary")), "glossary");
+ echo '</strong><p></td></tr>';
+ echo '<tr><td align="right" width="80%" valign="top"><small> ' . get_string("casesensitive","glossary") . ':</small></td><td width=20%>';
+
+ $selected = "";
+ if ( isset($newentry->casesensitive) ) {
+ if ($newentry->casesensitive) {
+ $selected = "checked";
+ }
+ } elseif ( $CFG->glossary_casesensitive ) {
$selected = "checked";
}
- } elseif ( $CFG->glossary_casesensitive ) {
- $selected = "checked";
- }
-?>
- <input type="checkbox" name="casesensitive" value=1 <?php p($selected) ?>> <?php helpbutton("casesensitive", strip_tags(get_string("casesensitive", "glossary")), "glossary") ?>
- </td></tr>
- <tr><td align=right width=80%><small><?php echo get_string("fullmatch","glossary") ?>:</small></td><td width=20%>
-<?php
- $selected = "";
- if ( isset($newentry->fullmatch) ) {
- if ($newentry->fullmatch) {
+ echo '<input type="checkbox" name="casesensitive" value=1 ' . $selected . '> ' . helpbutton("casesensitive", strip_tags(get_string("casesensitive", "glossary")), "glossary");
+ echo '</td></tr>';
+ echo '<tr><td align="right" width="80%" valign="top"><small>' . get_string("fullmatch","glossary") . ':</small></td><td width=20%>';
+
+ $selected = "";
+ if ( isset($newentry->fullmatch) ) {
+ if ($newentry->fullmatch) {
+ $selected = "checked";
+ }
+ } elseif ( $CFG->glossary_fullmatch ) {
$selected = "checked";
}
- } elseif ( $CFG->glossary_fullmatch ) {
- $selected = "checked";
- }
-?>
- <input type="checkbox" name="fullmatch" value=1 <?php p($selected) ?>> <?php helpbutton("fullmatch", strip_tags(get_string("fullmatch", "glossary")), "glossary") ?>
- </td></tr>
- </table>
-<?PHP
+ echo '<input type="checkbox" name="fullmatch" value=1 ' . $selected . ' ' . helpbutton("fullmatch", strip_tags(get_string("fullmatch", "glossary")), "glossary");
+ echo '</td></tr>';
+ echo '</table>';
+
+ echo '</td>';
+ echo '<td align="center" width="42%" valign="top">';
+ echo '<textarea rows="5" name="aliases" cols="20">' . $newentry->aliases . '</textarea>';
+ echo '</td>';
+ echo '</tr>';
} // end-if !$usedynalink
+ echo '</td></tr></table>';
?>
- </td>
- <td align=center width=42% valign=top>
- <small><strong><?PHP p(get_string("aliases","glossary")) ?> <?php helpbutton("aliases", strip_tags(get_string("aliases", "glossary")), "glossary") ?></strong><small><br>
- <font size=1><?PHP p(get_string("onebyline","glossary")) ?></font><br>
- <textarea rows="5" name="aliases" cols="20"><?PHP p($newentry->aliases) ?></textarea>
- </td>
- </tr>
- </table>
-
</td>
</tr>
</table>
if ( $entries = get_records("glossary_entries", "glossaryid", $glossary->id) ) {
$ents = "";
foreach ( $entries as $entry ) {
- $ents .= "$entry->id,";
+ if ( $entry->sourceglossaryid ) {
+ $entry->glossaryid = $entry->sourceglossaryid;
+ $entry->sourceglossaryid = 0;
+ update_record("glossary_entries",$entry);
+ } else {
+ $ents .= "$entry->id,";
+ }
}
$ents = substr($ents,0,-1);
if ($ents) {
delete_records_select("glossary_ratings", "entryid in ($ents)");
}
}
- glossary_delete_glossary_attachments($glossary);
+ glossary_delete_attachments($glossary);
delete_records("glossary_entries", "glossaryid", "$glossary->id");
}
}
}
}
-function glossary_delete_glossary_attachments($glossary) {
+function glossary_delete_attachments($glossary) {
// Deletes all the user files in the attachments area for the glossary
if ( $entries = get_records("glossary_entries","glossaryid",$glossary->id) ) {
$deleted = 0;
$user = get_record("user", "id", $comment->userid);
$strby = get_string("writtenby","glossary");
- echo "<table class=\"generalbox\" BORDER=1 CELLSPACING=0 valign=top cellpadding=0 width=70% border=0><tr><td>";
+ echo '<table border="0" width="70%" cellpadding="3" cellspacing="0" class="forumpost">';
+ echo "<tr>";
- echo "\n<TABLE width=\"100%\" BORDER=0 CELLSPACING=0 valign=top cellpadding=5><tr>";
-
- echo "\n<TD BGCOLOR=\"$THEME->cellheading\" WIDTH=25% VALIGN=TOP align=right >";
+ $fullname = fullname($user, isteacher($course->id));
+
+ echo "<td bgcolor=\"$THEME->cellheading\" class=\"forumpostheader\" width=\"100%\">";
+ echo "<p>";
print_user_picture($user->id, $course->id, $user->picture);
- echo "<br><FONT SIZE=2>$strby $user->firstname $user->lastname</font>";
- echo "<br><FONT SIZE=1>(".get_string("lastedited").": ".userdate($comment->timemodified).")</FONT></small><br>";
- echo "</TD>";
+ echo "<font size=3> <b>$fullname</b></font><br \>";
+ echo "<FONT SIZE=1> (".get_string("lastedited").": ".userdate($comment->timemodified).")</FONT></small>";
+ echo "<font size=2>";
- echo "<TD valign=top WIDTH=75% BGCOLOR=\"$THEME->cellcontent\">";
- if ($comment) {
- echo format_text($comment->comment, $comment->format);
- } else {
- echo "<center>";
- print_string("nocomment", "glossary");
- echo "</center>";
- }
- echo "<p align=right>";
+ echo "</font></p></td></tr>";
+ echo "<tr><td bgcolor=\"$THEME->cellcontent\" class=\"forumpostmessage\">\n";
+
+ echo format_text($comment->comment, $comment->format);
+
+ echo "<p align=right><font size=-1>";
+
+ echo "</p>";
+
+ echo "<div align=right><p align=right>";
if ( (time() - $comment->timemodified < $CFG->maxeditingtime and $USER->id == $comment->userid) or isteacher($course->id) ) {
echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id&cid=$comment->id&action=edit\"><img alt=\"" . get_string("edit") . "\" src=\"../../pix/t/edit.gif\" height=11 width=11 border=0></a> ";
}
if ( $USER->id == $comment->userid or isteacher($course->id) ) {
echo "<a href=\"comment.php?id=$cm->id&eid=$entry->id&cid=$comment->id&action=delete\"><img alt=\"" . get_string("delete") . "\" src=\"../../pix/t/delete.gif\" height=11 width=11 border=0></a>";
}
- echo "</td>";
- echo "</tr></TABLE>\n";
+ echo "</p>";
+ echo "</div>";
+ echo "</td></tr>\n</table>\n\n";
- echo "</td></tr></table>";
}
function glossary_print_entry_ratings($course, $entry, $ratings = NULL) {