moodle/mod/glossary/edit.html
2004-01-25 20:34:54 +00:00

191 lines
6.4 KiB
HTML

<center>
<form name="form" method="post" <?=$onsubmit ?> action="edit.php" enctype="multipart/form-data">
<table class=generalbox cellpadding=5 bgcolor="<?php p($THEME->cellheading)?>">
<?PHP
if (isset($errors)) {
?>
<tr valign=top>
<td colspan=2 align=center><strong><font color=red><?PHP p($errors) ?></font></strong>
</td>
</tr>
<?PHP
}
?>
<tr valign=top>
<td colspan=2>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="150" 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) ?>"></td>
</tr>
<tr>
<td align="right"><p><b><?php echo get_string("categories","glossary") ?>:</b></p></td>
<td valign="top">
<?php
$categories = get_records("glossary_categories","glossaryid",$glossary->id);
echo "<select size=\"5\" name=\"categories[]\" multiple=\"yes\">";
echo "<option value=\"0\">" . get_string("notcategorised","glossary") . "</optioon>";
if ( $categories ) {
foreach ( $categories as $category ) {
echo " <option ";
if (isset($newentry->id)) {
if ( record_exists("glossary_entries_categories","entryid",$newentry->id,"categoryid",$category->id) ) {
echo "selected " ;
}
}
echo "value=\"$category->id\">$category->name</option>\n";
}
}
?>
</td>
</tr>
</table></td>
<td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td valign="top" align=right><p><b>
<?php
echo get_string("aliases","glossary");
echo ':<br />';
helpbutton("aliases", strip_tags(get_string("aliases", "glossary")), "glossary");
?></b></p></td>
</td>
<td valign="top">
<textarea rows="2" name="aliases" cols="20"><?php p($newentry->aliases) ?></textarea>
</td>
</tr>
<tr>
<td colspan="2">
<?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 '<script>var items = [\'casesensitive\',\'fullmatch\'];</script>';
if (!empty($newentry->usedynalink) or ($CFG->glossary_linkentries and !isset($newentry->id) ) ) {
$selected = "checked";
} else {
$selected = "";
}
echo '<input type="checkbox" name="usedynalink" value=1 ' . $selected . ' onclick="return lockoptions(\'form\',\'usedynalink\', items)"> ';
echo '<font size="-1">';
print_string("entryusedynalink","glossary");
echo '</font>';
echo helpbutton("usedynalink", strip_tags(get_string("usedynalink", "glossary")), "glossary");
echo '<br />';
if (!empty($newentry->casesensitive) or ($CFG->glossary_casesensitive and !isset($newentry->id)) ) {
$selected = "checked";
} else {
$selected = "";
}
echo '<input type="checkbox" name="casesensitive" value=1 ' . $selected . '> ';
echo '<font size="-1">';
print_string("casesensitive","glossary");
echo '</font>';
echo helpbutton("casesensitive", strip_tags(get_string("casesensitive", "glossary")), "glossary");
echo '<br />';
if (!empty($newentry->fullmatch) or ($CFG->glossary_fullmatch and !isset($newentry->id)) ) {
$selected = "checked";
} else {
$selected = "";
}
echo '<input type="checkbox" name="fullmatch" value=1 ' . $selected . '> ';
echo '<font size="-1">';
print_string("fullmatch","glossary");
echo '</font>';
echo helpbutton("fullmatch", strip_tags(get_string("fullmatch", "glossary")), "glossary");
echo '<br />';
}
?>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php echo get_string("definition","glossary") ?>:</b></p>
<font size="1">
<?php
helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
echo "<br />";
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
} else {
emoticonhelpbutton("form", "description");
}
?>
<br />
</font>
</td>
<td>
<?php
print_textarea($usehtmleditor, 20, 60, 680, 400, "text", $newentry->definition);
echo "<p align=right>";
helpbutton("textformat", get_string("helpformatting"));
print_string("formattexttype");
echo ":&nbsp;";
if (!isset($newentry->format)) {
$newentry->format = $defaultformat;
}
choose_from_menu(format_text_menu(), "format", $newentry->format, "");
echo "</p>";
?>
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php print_string("attachment", "glossary") ?>:<br />(<?php print_string("optional") ?>)&nbsp;</b></p></td>
<td>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_max_upload_file_size() ?>">
<input type="file" name="attachment" size=40>
<?php
helpbutton("attachment", get_string("attachment", "glossary"), "glossary");
print_string("maxsize", "", display_size(get_max_upload_file_size()));
?>
</td>
</tr>
<tr>
<td colspan=2>
<p align=center>
<?php if (isset($newentry->id)) {
echo "<input type=\"hidden\" name=e value=\"$newentry->id\">";
}
?>
<input type="hidden" name=husedynalink value="1">
<input type="hidden" name=hcasesensitive value="0">
<input type="hidden" name=hfullmatch value="1">
<input type="hidden" name=id value="<?=$cm->id ?>">
<input type="hidden" name=mode value="<?=$mode ?>">
<input type="hidden" name=hook value="<?=$hook ?>">
<input type="hidden" name=confirm value="1">
<input type="submit" value="<?php print_string("savechanges") ?>">
<input type="reset" value="<?php print_string("revert") ?>">
</P>
</td>
</tr>
</table>
</center>
</form>
<?PHP
if ($usehtmleditor) {
print_richedit_javascript("form", "text", "yes");
}
?>