mirror of
https://github.com/moodle/moodle.git
synced 2025-02-06 08:10:11 +01:00
39fcb981b8
I've left out stuff that didn't seem necessary ... including a lot of the Wiki plugins which were quote large... I'm not sure if this is currently working ... I'm about to try it out.
159 lines
5.3 KiB
HTML
159 lines
5.3 KiB
HTML
<!-- 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. -->
|
|
|
|
<?php
|
|
require("$CFG->dirroot/mod/wiki/lib.php");
|
|
|
|
if (!isset($form->name)) {
|
|
$form->name = '';
|
|
}
|
|
if (!isset($form->summary)) {
|
|
$form->summary = '';
|
|
}
|
|
if (!isset($form->pagename)) {
|
|
$form->pagename = '';
|
|
}
|
|
if (!isset($form->pagename)) {
|
|
$form->pagename = '';
|
|
}
|
|
if (!isset($form->wtype)) {
|
|
$form->wtype = 'group';
|
|
}
|
|
if (!isset($form->ewikiprinttitle)) {
|
|
$form->ewikiprinttitle = 1;
|
|
}
|
|
if (!isset($form->htmlmode)) {
|
|
$form->htmlmode = 2 ;
|
|
}
|
|
if (!isset($form->ewikiacceptbinary)) {
|
|
$form->ewikiacceptbinary = 0;
|
|
}
|
|
if (!isset($form->initialcontent)) {
|
|
$form->initialcontent = '';
|
|
}
|
|
|
|
/// If updating an existing wiki, find out if it has entries.
|
|
if ($form->id) {
|
|
$wikihasentries = wiki_has_entries($form);
|
|
}
|
|
?>
|
|
|
|
<FORM name="form" method="post" action="<?php echo $ME ?>">
|
|
<CENTER>
|
|
<TABLE cellpadding=5>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><?php print_string('name') ?>:</B></P></TD>
|
|
<TD>
|
|
<INPUT type="text" name="name" size=30 value="<?php p($form->name) ?>">
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><?php print_string('summary') ?>:</B></P></TD>
|
|
<TD>
|
|
<?php print_textarea(false, 5, 60, 680, 400, "summary", $form->summary); ?>
|
|
</TD>
|
|
</TR>
|
|
|
|
<tr valign=top>
|
|
<TD align=right><P>
|
|
<?php helpbutton('wikitype', get_string('wikitype', 'wiki'), 'wiki'); ?>
|
|
<B><?php print_string('wikitype', "wiki") ?>:</B></P></TD>
|
|
<TD>
|
|
<?php
|
|
if ($wikihasentries) {
|
|
echo $WIKI_TYPES[$form->wtype];
|
|
}
|
|
else {
|
|
choose_from_menu($WIKI_TYPES, 'wtype', $form->wtype, "");
|
|
}
|
|
?>
|
|
</TD>
|
|
</tr>
|
|
<TR valign=top>
|
|
<TD align=right><P><B><?php print_string('ewikiprinttitle', 'wiki') ?>:</B></P></TD>
|
|
<TD>
|
|
<select size="1" name="ewikiprinttitle">
|
|
<option value="1" <?php if ( $form->ewikiprinttitle) { echo 'selected'; }?>><?php print_string('yes') ?></option>
|
|
<option value="0" <?php if ( !$form->ewikiprinttitle) { echo 'selected'; }?>><?php print_string('no') ?></option>
|
|
</select>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P>
|
|
<?php helpbutton('htmlmode', get_string('htmlmode', 'wiki'), 'wiki'); ?>
|
|
<B><?php print_string('htmlmode', 'wiki') ?>:</B></P></TD>
|
|
<TD>
|
|
<?php
|
|
$htmlmodes=array( "0" => get_string("nohtml","wiki") , "1" => get_string("safehtml","wiki"), "2" => get_string("htmlonly","wiki"));
|
|
choose_from_menu($htmlmodes, "htmlmode", $form->htmlmode, "");
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
<TR valign=top>
|
|
<TD align=right><P>
|
|
<?php helpbutton('ewikiacceptbinary', get_string('ewikiacceptbinary', 'wiki'), 'wiki') ?>
|
|
<B><?php print_string('ewikiacceptbinary', 'wiki') ?>:</B></P></TD>
|
|
<TD>
|
|
<select size="1" name="ewikiacceptbinary">
|
|
<option value="1" <?php if ( $form->ewikiacceptbinary) { echo 'selected'; }?>><?php print_string('yes') ?></option>
|
|
<option value="0" <?php if ( !$form->ewikiacceptbinary) { echo 'selected'; }?>><?php print_string('no') ?></option>
|
|
</select>
|
|
</TD>
|
|
</TR>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b> Optional: </b></td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<TR valign=top>
|
|
<TD align=right><P>
|
|
<?php helpbutton('wikiname', get_string('wikiname', 'wiki'), 'wiki'); ?>
|
|
<B><?php print_string('wikiname', 'wiki') ?>:</B></P></TD>
|
|
<TD>
|
|
<?php
|
|
if ($wikihasentries) {
|
|
echo $form->pagename;
|
|
}
|
|
else {
|
|
?>
|
|
<INPUT type="text" name="pagename" size=30 value="<?php p($form->pagename) ?>"><b> - or - </b>
|
|
<?php
|
|
}
|
|
?>
|
|
</TD>
|
|
</TR>
|
|
|
|
<tr valign="top">
|
|
<td align="right" nowrap>
|
|
<?php helpbutton('initialcontent', get_string('initialcontent', 'wiki'), 'wiki'); ?>
|
|
<B><?php echo get_string("initialcontent", "wiki") ?>:</B></P>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
if ($wikihasentries) {
|
|
echo $form->initialcontent;
|
|
}
|
|
else {
|
|
$strchooseafile = get_string("chooseafile", "wiki");
|
|
echo "<input name=\"initialcontent\" size=\"50\" value=\"$form->initialcontent\"> ";
|
|
button_to_popup_window ("/mod/wiki/wikifiles.php?id=$course->id",
|
|
"wikifiles", $strchooseafile, 500, 750, $strchooseafile);
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
</TABLE>
|
|
<!-- These hidden variables are always the same -->
|
|
<INPUT type="hidden" name=course value="<?php p($form->course) ?>">
|
|
<INPUT type="hidden" name=coursemodule value="<?php p($form->coursemodule) ?>">
|
|
<INPUT type="hidden" name=section value="<?php p($form->section) ?>">
|
|
<INPUT type="hidden" name=module value="<?php p($form->module) ?>">
|
|
<INPUT type="hidden" name=modulename value="<?php p($form->modulename) ?>">
|
|
<INPUT type="hidden" name=instance value="<?php p($form->instance) ?>">
|
|
<INPUT type="hidden" name=id value="<?php p($form->instance) ?>">
|
|
<INPUT type="hidden" name=mode value="<?php p($form->mode) ?>">
|
|
<INPUT type="submit" value="<?php print_string('savechanges') ?>">
|
|
</CENTER>
|
|
</FORM> |