Incorrect variable name used for parameter.
[moodle-linuxchix.git] / mod / wiki / mod.html
blob178a59a6f4fb55c944b877f3f22b7f5d128405d0
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. -->
4 <?php
5 require("$CFG->dirroot/mod/wiki/lib.php");
7 if (!isset($form->id)) {
8 $form->id = '';
10 if (!isset($form->name)) {
11 $form->name = '';
13 if (!isset($form->summary)) {
14 $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)) {
23 $form->htmlmode = 2 ;
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)) {
44 $form->pagename = '';
46 if (!isset($form->disablecamelcase)) {
47 $form->disablecamelcase = 0;
50 # Set other variables
51 if (!isset($id)) {
52 $id = '';
54 /// If updating an existing wiki, find out if it has entries.
55 if ($form->id) {
56 $wikihasentries = wiki_has_entries($form);
57 } else {
58 $wikihasentries=false;
62 <form name="form" method="post" action="mod.php">
63 <center>
64 <table cellpadding="5">
65 <tr valign="top">
66 <td align="right"><b><?php print_string('name') ?>:</b></td>
67 <td>
68 <input type="text" name="name" size="30" value="<?php p($form->name) ?>" alt="<?php print_string('name') ?>" />
69 </td>
70 </tr>
71 <tr valign="top">
72 <td align="right"><b><?php print_string('summary') ?>:</b></td>
73 <td>
74 <?php print_textarea($usehtmleditor, 5, 60, 680, 400, "summary", $form->summary); ?>
75 </td>
76 </tr>
78 <tr valign="top">
79 <td align="right">
80 <b><?php print_string('wikitype', "wiki") ?>:</b></td>
81 <td>
82 <?php
83 if ($wikihasentries) {
84 echo $WIKI_TYPES[$form->wtype];
86 else {
87 choose_from_menu($WIKI_TYPES, 'wtype', $form->wtype, "");
89 helpbutton('wikitype', get_string('wikitype', 'wiki'), 'wiki');
91 </td>
92 </tr>
93 <tr valign="top">
94 <td align="right"><b><?php print_string('ewikiprinttitle', 'wiki') ?>:</b></td>
95 <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>
99 </select>
100 </td>
101 </tr>
102 <tr valign="top">
103 <td align="right">
104 <b><?php print_string('htmlmode', 'wiki') ?>:</b></td>
105 <td>
106 <?php
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');
111 </td>
112 </tr>
113 <tr valign="top">
114 <td align="right">
115 <b><?php print_string('ewikiacceptbinary', 'wiki') ?>:</b></td>
116 <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>
120 </select>
121 <?php helpbutton('ewikiacceptbinary', get_string('ewikiacceptbinary', 'wiki'), 'wiki') ?>
122 </td>
123 </tr>
125 <tr valign="top">
126 <td align="right">
127 <b> <?php print_string('wikilinkoptions', 'wiki') ?>:</b></td>
128 <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') ?>
132 </td>
133 </tr>
135 <tr valign="top">
136 <td align="right">
137 <b> <?php print_string('studentadminoptions', 'wiki') ?>:</b></td>
138 <td>
139 <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>
140 <td width="50%">
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 />
145 </td>
146 <td width="50%">
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') ?>
150 <br />
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 />
153 </td>
154 </tr></table>
155 </td>
156 </tr>
158 <tr valign="top">
159 <td align="right"><b><?php print_string('optional', 'wiki') ?>:</b></td>
160 <td></td>
161 </tr>
163 <tr valign="top">
164 <td align="right">
165 <b><?php print_string('wikiname', 'wiki') ?>:</b></td>
166 <td>
167 <?php
168 if ($wikihasentries) {
169 echo format_string($form->pagename,true);
171 else {
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>
175 <?php
178 <?php helpbutton('wikiname', get_string('wikiname', 'wiki'), 'wiki'); ?>
179 </td>
180 </tr>
182 <tr valign="top">
183 <td align="right" nowrap="nowrap">
184 <b><?php echo get_string("initialcontent", "wiki") ?>:</b>
185 </td>
186 <td>
187 <?php
188 if ($wikihasentries) {
189 echo $form->initialcontent;
191 else {
192 $strchooseafile = get_string("chooseafile", "wiki");
193 echo "<input type=\"text\" name=\"initialcontent\" size=\"50\" value=\"$form->initialcontent\" alt=\"".get_string("initialcontent", "wiki")."\" />&nbsp;";
194 button_to_popup_window ("/files/index.php?choose=form.initialcontent&amp;id=$course->id",
195 "wikifiles", $strchooseafile, 500, 750, $strchooseafile);
198 <?php helpbutton('initialcontent', get_string('initialcontent', 'wiki'), 'wiki'); ?>
199 </td>
200 </tr>
201 <?php print_standard_coursemodule_settings($form); ?>
202 </table>
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') ?>" />
214 </center>
215 </form>