moodle/mod/glossary/mod.html

187 lines
5.6 KiB
HTML
Raw Normal View History

<!-- This page defines the form to create or edit an instance of this module -->
<!-- It is used from /course/mod.php. The whole instance is available as $form. -->
<FORM name="form" method="post" action="<?=$ME ?>">
<CENTER>
<TABLE cellpadding=5>
<TR valign=top>
<TD align=right><P><B><? print_string("name") ?>:</B></P></TD>
<TD>
<INPUT type="text" name="name" size=30 value="<? p($form->name) ?>">
</TD>
</TR>
<!-- More rows go in here... -->
<TR valign=top>
<TD align=right><P><B><? echo get_string("studentcanpost", "glossary") ?>:</B></P></TD>
<TD>
<select size="1" name="studentcanpost">
<option value="1" <?
if ( $form->studentcanpost ) {
echo "selected";
}
?>><? echo get_string("yes") ?></option>
<option value="0" <?
if ( !$form->studentcanpost ) {
echo "selected";
}
?>><? echo get_string("no") ?>
</option>
</select> <? helpbutton("studentcanpost", get_string("studentcanpost", "glossary"), "glossary") ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><? echo get_string("allowduplicatedentries", "glossary") ?>:</B></P></TD>
<TD>
<select size="1" name="allowduplicatedentries">
<option value="1" <?
if ( $form->allowduplicatedentries ) {
echo "selected";
}
?>
><? echo get_string("yes") ?></option>
<option value="0" <?
if ( !$form->allowduplicatedentries ) {
echo "selected";
}
?>><? echo get_string("no") ?>
</option>
</select> <? helpbutton("allowduplicatedentries", get_string("allowduplicatedentries", "glossary"), "glossary") ?>
</TD>
</TR>
<?
$mainglossary = get_record("glossary","mainglossary",1,"course",$form->course);
if (!$mainglossary or $mainglossary->id == $form->instance ) {
?>
<TR valign=top>
<TD align=right><P><B><? echo get_string("glossarytype", "glossary") ?>:</B></P></TD>
<TD>
<select size="1" name="mainglossary">
<option value="1" <?
if ( $form->mainglossary ) {
echo "selected";
}
?>><? echo get_string("mainglossary", "glossary") ?></option>
<option value="0" <?
if ( !$form->mainglossary ) {
echo "selected";
}
?>><? echo get_string("secundaryglossary", "glossary") ?>
</option>
</select> <? helpbutton("mainglossary", get_string("mainglossary", "glossary"), "glossary") ?>
</TD>
</TR>
<?
} else {
echo "<INPUT type=\"hidden\" name=mainglossary value=\"0\">";
}
?>
<TR valign=top>
<TD align=right><P><B><? echo get_string("displayformat", "glossary") ?>:</B></P></TD>
<TD>
<select size="1" name="displayformat">
<option value="0" <?
if ( $form->displayformat == 0) {
echo "selected";
}
?>><? echo get_string("displayformatdefault", "glossary") ?></option>
<?
global $CFG;
$basedir = opendir("$CFG->dirroot/mod/glossary/formats");
while ($dir = readdir($basedir)) {
$firstchar = substr($dir, 0, 1);
if ($firstchar == "." or $dir == "CVS" or $dir == "_vti_cnf") {
continue;
}
if (filetype("$CFG->dirroot/mod/glossary/formats/$dir") == "dir") {
continue;
}
if ( $pos = strpos($dir, ".") ) {
$dir = substr($dir, 0, $pos );
echo "<option value=\"$dir\" ";
if ( $form->displayformat == $dir) {
echo "selected ";
}
echo ">";
echo get_string("displayformat$dir", "glossary")."</option>";
}
}
?>
</select> <? helpbutton("displayformat", get_string("displayformat", "glossary"), "glossary") ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><? echo get_string("showspecial", "glossary") ?>:</B></P></TD>
<TD>
<select size="1" name="showspecial">
<option value="1" <?
if ( $form->showspecial ) {
echo "selected";
}
?>
><? echo get_string("yes") ?></option>
<option value="0" <?
if ( !$form->showspecial ) {
echo "selected";
}
?>><? echo get_string("no") ?>
</option>
</select> <? helpbutton("shows", get_string("showspecial", "glossary"), "glossary") ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><? echo get_string("showalphabet", "glossary") ?>:</B></P></TD>
<TD>
<select size="1" name="showalphabet">
<option value="1" <?
if ( $form->showalphabet ) {
echo "selected";
}
?>
><? echo get_string("yes") ?></option>
<option value="0" <?
if ( !$form->showalphabet ) {
echo "selected";
}
?>><? echo get_string("no") ?>
</option>
</select> <? helpbutton("shows", get_string("showalphabet", "glossary"), "glossary") ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><? echo get_string("showall", "glossary") ?>:</B></P></TD>
<TD>
<select size="1" name="showall">
<option value="1" <?
if ( $form->showall ) {
echo "selected";
}
?>
><? echo get_string("yes") ?></option>
<option value="0" <?
if ( !$form->showall ) {
echo "selected";
}
?>><? echo get_string("no") ?>
</option>
</select> <? helpbutton("shows", get_string("showall", "glossary"), "glossary") ?>
</TD>
</TR>
</TABLE>
<!-- These hidden variables are always the same -->
<INPUT type="hidden" name=course value="<? p($form->course) ?>">
<INPUT type="hidden" name=coursemodule value="<? p($form->coursemodule) ?>">
<INPUT type="hidden" name=section value="<? p($form->section) ?>">
<INPUT type="hidden" name=module value="<? p($form->module) ?>">
<INPUT type="hidden" name=modulename value="<? p($form->modulename) ?>">
<INPUT type="hidden" name=instance value="<? p($form->instance) ?>">
<INPUT type="hidden" name=mode value="<? p($form->mode) ?>">
<INPUT type="submit" value="<? print_string("savechanges") ?>">
</CENTER>
</FORM>