1 <!-- This page defines the form to create or edit an instance of this module -->
2 <!-- It is used from /course/mod.php. The whole instance is available as $form. -->
5 require("$CFG->dirroot/mod/wiki/lib.php");
7 if (!isset($form->id
)) {
10 if (!isset($form->name
)) {
13 if (!isset($form->summary
)) {
16 if (!isset($form->wtype
)) {
17 $form->wtype
= 'group';
19 if (!isset($form->ewikiprinttitle
)) {
20 $form->ewikiprinttitle
= 1;
22 if (!isset($form->htmlmode
)) {
25 if (!isset($form->ewikiacceptbinary
)) {
26 $form->ewikiacceptbinary
= 0;
28 if (!isset($form->setpageflags
)) {
29 $form->setpageflags
= 0;
31 if (!isset($form->strippages
)) {
32 $form->strippages
= 0;
34 if (!isset($form->removepages
)) {
35 $form->removepages
= 0;
37 if (!isset($form->revertchanges
)) {
38 $form->revertchanges
= 0;
40 if (!isset($form->initialcontent
)) {
41 $form->initialcontent
= '';
43 if (!isset($form->pagename
)) {
46 if (!isset($form->disablecamelcase
)) {
47 $form->disablecamelcase
= 0;
54 /// If updating an existing wiki, find out if it has entries.
56 $wikihasentries = wiki_has_entries($form);
58 $wikihasentries=false;
62 <form name=
"form" method=
"post" action=
"mod.php">
64 <table cellpadding=
"5">
66 <td align=
"right"><b><?php print_string('name') ?>:
</b></td>
68 <input type=
"text" name=
"name" size=
"30" value=
"<?php p($form->name) ?>" alt
="<?php print_string('name') ?>" />
72 <td align
="right"><b
><?php
print_string('summary') ?>:
</b></td>
74 <?php print_textarea($usehtmleditor, 5, 60, 680, 400, "summary", $form->summary
); ?>
80 <b><?php print_string('wikitype', "wiki") ?>:
</b></td>
83 if ($wikihasentries) {
84 echo $WIKI_TYPES[$form->wtype
];
87 choose_from_menu($WIKI_TYPES, 'wtype', $form->wtype
, "");
89 helpbutton('wikitype', get_string('wikitype', 'wiki'), 'wiki');
94 <td align=
"right"><b><?php print_string('ewikiprinttitle', 'wiki') ?>:
</b></td>
96 <select size=
"1" name=
"ewikiprinttitle">
97 <option value=
"1" <?php if ( $form->ewikiprinttitle
) { echo 'selected="selected"'; }?>><?php print_string('yes')
?></option>
98 <option value=
"0" <?php if ( !$form->ewikiprinttitle
) { echo 'selected="selected"'; }?>><?php print_string('no')
?></option>
104 <b><?php print_string('htmlmode', 'wiki') ?>:
</b></td>
107 $htmlmodes=array( 0 => get_string("nohtml","wiki") , 1 => get_string("safehtml","wiki"), 2 => get_string("htmlonly","wiki"));
108 choose_from_menu($htmlmodes, "htmlmode", $form->htmlmode
, "");
109 helpbutton('htmlmode', get_string('htmlmode', 'wiki'), 'wiki');
115 <b><?php print_string('ewikiacceptbinary', 'wiki') ?>:
</b></td>
117 <select size=
"1" name=
"ewikiacceptbinary">
118 <option value=
"1" <?php if ( $form->ewikiacceptbinary
) { echo 'selected="selected"'; }?>><?php print_string('yes')
?></option>
119 <option value=
"0" <?php if ( !$form->ewikiacceptbinary
) { echo 'selected="selected"'; }?>><?php print_string('no')
?></option>
121 <?php helpbutton('ewikiacceptbinary', get_string('ewikiacceptbinary', 'wiki'), 'wiki') ?>
127 <b> <?php print_string('wikilinkoptions', 'wiki') ?>:
</b></td>
129 <input type=
"checkbox" name=
"disablecamelcase" value=
"1" <?php echo $form->disablecamelcase?
"CHECKED":""; ?> alt=
"<?php print_string('disablecamel', 'wiki') ?>" />
130 <?php print_string('disablecamel', 'wiki') ?><br />
131 <?php helpbutton('wikilinkoptions', get_string('wikilinkoptions', 'wiki'), 'wiki') ?>
137 <b> <?php print_string('studentadminoptions', 'wiki') ?>:
</b></td>
139 <table cellpadding=
"0" cellspacing=
"0" border=
"0" width=
"100%"><tr>
141 <input type=
"checkbox" name=
"setpageflags" value=
"1" <?php echo $form->setpageflags?
"CHECKED":""; ?> alt=
"<?php print_string('allowsetpage', 'wiki') ?>" />
142 <?php print_string('allowsetpage', 'wiki') ?><br />
143 <input type=
"checkbox" name=
"strippages" value=
"1" <?php echo $form->strippages?
"CHECKED":""; ?> alt=
"<?php print_string('allowstrippages', 'wiki') ?>" />
144 <?php print_string('allowstrippages', 'wiki') ?><br />
147 <input type=
"checkbox" name=
"removepages" value=
"1" <?php echo $form->removepages?
"CHECKED":""; ?> alt=
"<?php print_string('allowremovepages', 'wiki') ?>" />
148 <?php print_string('allowremovepages', 'wiki') ?>
149 <?php helpbutton('studentadminoptions', get_string('studentadminoptions', 'wiki'), 'wiki') ?>
151 <input type=
"checkbox" name=
"revertchanges" value=
"1" <?php echo $form->revertchanges?
"CHECKED":""; ?> alt=
"<?php print_string('allowrevertchanges', 'wiki') ?>" />
152 <?php print_string('allowrevertchanges', 'wiki') ?><br />
159 <td align=
"right"><b><?php print_string('optional', 'wiki') ?>:
</b></td>
165 <b><?php print_string('wikiname', 'wiki') ?>:
</b></td>
168 if ($wikihasentries) {
169 echo format_string($form->pagename
,true);
173 <input type=
"text" name=
"pagename" size=
"30" value=
"<?php p($form->pagename) ?>" alt
="<?php print_string('wikiname', 'wiki') ?>" /><b
>
174 <?php
print_string('pagenamechoice', 'wiki'); ?></b>
178 <?php helpbutton('wikiname', get_string('wikiname', 'wiki'), 'wiki'); ?>
183 <td align=
"right" nowrap=
"nowrap">
184 <b><?php echo get_string("initialcontent", "wiki") ?>:
</b>
188 if ($wikihasentries) {
189 echo $form->initialcontent
;
192 $strchooseafile = get_string("chooseafile", "wiki");
193 echo "<input type=\"text\" name=\"initialcontent\" size=\"50\" value=\"$form->initialcontent\" alt=\"".get_string("initialcontent", "wiki")."\" /> ";
194 button_to_popup_window ("/files/index.php?choose=form.initialcontent&id=$course->id",
195 "wikifiles", $strchooseafile, 500, 750, $strchooseafile);
198 <?php helpbutton('initialcontent', get_string('initialcontent', 'wiki'), 'wiki'); ?>
201 <?php print_standard_coursemodule_settings($form); ?>
203 <!-- These hidden variables are always the same -->
204 <input type=
"hidden" name=
"course" value=
"<?php p($form->course) ?>" />
205 <input type
="hidden" name
="sesskey" value
="<?php p($form->sesskey) ?>" />
206 <input type
="hidden" name
="coursemodule" value
="<?php p($form->coursemodule) ?>" />
207 <input type
="hidden" name
="section" value
="<?php p($form->section) ?>" />
208 <input type
="hidden" name
="module" value
="<?php p($form->module) ?>" />
209 <input type
="hidden" name
="modulename" value
="<?php p($form->modulename) ?>" />
210 <input type
="hidden" name
="instance" value
="<?php p($form->instance) ?>" />
211 <input type
="hidden" name
="id" value
="<?php p($form->instance) ?>" />
212 <input type
="hidden" name
="mode" value
="<?php p($form->mode) ?>" />
213 <input type
="submit" value
="<?php print_string('savechanges') ?>" />