mirror of
https://github.com/moodle/moodle.git
synced 2025-02-01 21:54:04 +01:00
197 lines
6.4 KiB
HTML
197 lines
6.4 KiB
HTML
<?PHP
|
|
global $CFG;
|
|
?>
|
|
<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 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 valign=top>
|
|
<td align=right><p><b><?php echo get_string("categories","glossary") ?>:</b></p></td>
|
|
<td>
|
|
<table border=0>
|
|
<tr>
|
|
<td>
|
|
<?php
|
|
$categories = get_records("glossary_categories","glossaryid",$glossary->id);
|
|
echo "<select size=\"8\" 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";
|
|
}
|
|
}
|
|
?>
|
|
</select>
|
|
<td>
|
|
<td width=100%>
|
|
<table border=0>
|
|
<tr>
|
|
<td align=center width=58%>
|
|
<?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) {
|
|
$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) {
|
|
$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
|
|
} // end-if !$usedynalink
|
|
?>
|
|
|
|
</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>
|
|
</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 ": ";
|
|
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") ?>) </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");
|
|
}
|
|
?>
|
|
|