moodle/mod/glossary/edit.html

105 lines
3.1 KiB
HTML
Raw Normal View History

<?php
global $CFG, $THEME;
require_once("../../config.php");
?>
<FORM name="theform" method="post" <?=$onsubmit ?> action="edit.php" enctype="multipart/form-data">
<table class=generalbox cellpadding=5 bgcolor="<?php p($THEME->cellheading)?>">
<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($form->concept) ?>">
</td>
</tr>
<tr valign=top>
<td align=right><p><b><?php echo get_string("categories","glossary") ?>:</b></p></td>
<td>
<?php
$categories = get_records("glossary_categories","glossaryid",$glossary->id);
echo "<select size=\"6\" name=\"categories[]\" multiple=\"yes\">";
echo "<option value=0>" . get_string("nocategorized","glossary") . "</optioon>";
if ( $categories ) {
foreach ( $categories as $category ) {
echo " <option ";
if ( record_exists("glossary_entries_categories","entryid",$entry->id,"categoryid",$category->id) ) {
echo "selected " ;
}
echo "value=\"$category->id\">$category->name</option>\n";
}
}
?>
</select>
</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", $entry->text);
echo "<p align=right>";
helpbutton("textformat", get_string("helpformatting"));
print_string("formattexttype");
echo ":&nbsp;";
if (!$form->format) {
$form->format = $defaultformat;
}
choose_from_menu(format_text_menu(), "format", $entry->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 ($entry->id) {
echo "<input type=\"hidden\" name=entry value=\"$entry->id\">";
}
?>
<input type="hidden" name=id value="<?=$cm->id ?>">
<input type="hidden" name=currentview value="<?=$currentview ?>">
<input type="hidden" name=cat value="<?=$cat ?>">
<input type="submit" value="<?php print_string("savechanges") ?>">
<input type="reset" value="<?php print_string("revert") ?>">
</P>
</td>
</tr>
</table>
</p>
</form>
<?PHP
if ($usehtmleditor) {
print_richedit_javascript("theform", "text", "no");
}
?>