1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
<!-- 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_once("$CFG->dirroot/mod/wiki/lib.php");
if (!isset($form->id)) {
$form->id = '';
}
if (!isset($form->name)) {
$form->name = '';
}
if (!isset($form->summary)) {
$form->summary = '';
}
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->setpageflags)) {
$form->setpageflags = 0;
}
if (!isset($form->strippages)) {
$form->strippages = 0;
}
if (!isset($form->removepages)) {
$form->removepages = 0;
}
if (!isset($form->revertchanges)) {
$form->revertchanges = 0;
}
if (!isset($form->initialcontent)) {
$form->initialcontent = '';
}
if (!isset($form->pagename)) {
$form->pagename = '';
}
if (!isset($form->disablecamelcase)) {
$form->disablecamelcase = 0;
}
# Set other variables
if (!isset($id)) {
$id = '';
}
/// If updating an existing wiki, find out if it has entries.
if ($form->id) {
$wikihasentries = wiki_has_entries($form);
} else {
$wikihasentries=false;
}
?>
<form name="form" method="post" action="mod.php">
<center>
<table cellpadding="5">
<tr valign="top">
<td align="right"><b><?php print_string('name') ?>:</b></td>
<td>
<input type="text" name="name" size="30" value="<?php p($form->name) ?>" alt="<?php print_string('name') ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('summary') ?>:</b></td>
<td>
<?php print_textarea($usehtmleditor, 5, 60, 680, 400, "summary", $form->summary); ?>
</td>
</tr>
<tr valign="top">
<td align="right">
<b><?php print_string('wikitype', "wiki") ?>:</b></td>
<td>
<?php
if ($wikihasentries) {
echo $WIKI_TYPES[$form->wtype];
}
else {
choose_from_menu($WIKI_TYPES, 'wtype', $form->wtype, "");
}
helpbutton('wikitype', get_string('wikitype', 'wiki'), 'wiki');
?>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('ewikiprinttitle', 'wiki') ?>:</b></td>
<td>
<select size="1" name="ewikiprinttitle">
<option value="1" <?php if ( $form->ewikiprinttitle) { echo 'selected="selected"'; }?>><?php print_string('yes') ?></option>
<option value="0" <?php if ( !$form->ewikiprinttitle) { echo 'selected="selected"'; }?>><?php print_string('no') ?></option>
</select>
</td>
</tr>
<tr valign="top">
<td align="right">
<b><?php print_string('htmlmode', 'wiki') ?>:</b></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, "");
helpbutton('htmlmode', get_string('htmlmode', 'wiki'), 'wiki');
?>
</td>
</tr>
<tr valign="top">
<td align="right">
<b><?php print_string('ewikiacceptbinary', 'wiki') ?>:</b></td>
<td>
<select size="1" name="ewikiacceptbinary">
<option value="1" <?php if ( $form->ewikiacceptbinary) { echo 'selected="selected"'; }?>><?php print_string('yes') ?></option>
<option value="0" <?php if ( !$form->ewikiacceptbinary) { echo 'selected="selected"'; }?>><?php print_string('no') ?></option>
</select>
<?php helpbutton('ewikiacceptbinary', get_string('ewikiacceptbinary', 'wiki'), 'wiki') ?>
</td>
</tr>
<tr valign="top">
<td align="right">
<b> <?php print_string('wikilinkoptions', 'wiki') ?>:</b></td>
<td>
<input type="checkbox" name="disablecamelcase" value="1" <?php echo $form->disablecamelcase?"CHECKED":""; ?> alt="<?php print_string('disablecamel', 'wiki') ?>" />
<?php print_string('disablecamel', 'wiki') ?><br />
<?php helpbutton('wikilinkoptions', get_string('wikilinkoptions', 'wiki'), 'wiki') ?>
</td>
</tr>
<tr valign="top">
<td align="right">
<b> <?php print_string('studentadminoptions', 'wiki') ?>:</b></td>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>
<td width="50%">
<input type="checkbox" name="setpageflags" value="1" <?php echo $form->setpageflags?"CHECKED":""; ?> alt="<?php print_string('allowsetpage', 'wiki') ?>" />
<?php print_string('allowsetpage', 'wiki') ?><br />
<input type="checkbox" name="strippages" value="1" <?php echo $form->strippages?"CHECKED":""; ?> alt="<?php print_string('allowstrippages', 'wiki') ?>" />
<?php print_string('allowstrippages', 'wiki') ?><br />
</td>
<td width="50%">
<input type="checkbox" name="removepages" value="1" <?php echo $form->removepages?"CHECKED":""; ?> alt="<?php print_string('allowremovepages', 'wiki') ?>" />
<?php print_string('allowremovepages', 'wiki') ?>
<?php helpbutton('studentadminoptions', get_string('studentadminoptions', 'wiki'), 'wiki') ?>
<br />
<input type="checkbox" name="revertchanges" value="1" <?php echo $form->revertchanges?"CHECKED":""; ?> alt="<?php print_string('allowrevertchanges', 'wiki') ?>" />
<?php print_string('allowrevertchanges', 'wiki') ?><br />
</td>
</tr></table>
</td>
</tr>
<tr valign="top">
<td align="right"><b><?php print_string('optional', 'wiki') ?>:</b></td>
<td></td>
</tr>
<tr valign="top">
<td align="right">
<b><?php print_string('wikiname', 'wiki') ?>:</b></td>
<td>
<?php
if ($wikihasentries) {
echo format_string($form->pagename,true);
}
else {
?>
<input type="text" name="pagename" size="30" value="<?php p($form->pagename) ?>" alt="<?php print_string('wikiname', 'wiki') ?>" /><b>
<?php print_string('pagenamechoice', 'wiki'); ?></b>
<?php
}
?>
<?php helpbutton('wikiname', get_string('wikiname', 'wiki'), 'wiki'); ?>
</td>
</tr>
<tr valign="top">
<td align="right" nowrap="nowrap">
<b><?php echo get_string("initialcontent", "wiki") ?>:</b>
</td>
<td>
<?php
if ($wikihasentries) {
echo $form->initialcontent;
}
else {
$strchooseafile = get_string("chooseafile", "wiki");
echo "<input type=\"text\" name=\"initialcontent\" size=\"50\" value=\"$form->initialcontent\" alt=\"".get_string("initialcontent", "wiki")."\" /> ";
button_to_popup_window ("/files/index.php?choose=form.initialcontent&id=$course->id",
"wikifiles", $strchooseafile, 500, 750, $strchooseafile);
}
?>
<?php helpbutton('initialcontent', get_string('initialcontent', 'wiki'), 'wiki'); ?>
</td>
</tr>
<?php print_standard_coursemodule_settings($form); ?>
</table>
<!-- These hidden variables are always the same -->
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
<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>
|