Files
moodle/mod/wiki/mod.html
T
gustav_delius 48e535bc35 Activities can now be hidden/shown from the activity editing page. Also for modules that know about groups the groupmode can be set from there. See bug 2533. This required adding to the mod.html files calls to new functions print_visible_setting() and print_groupmode_setting() which are combined in print_standard_coursemodule_settings().
The visibility of coursemodules is now always set through the function set_coursemodule_visible() in order to make sure that the associated events get updated in the calendar appropriately.

If moving a coursemodule to a hidden section then the module is set to hidden as well and its events are hidden in the calendar.

If deleting a coursemodule its events are deleted from the calendar.

The function choose_from_menu() has an extra optional argument $disabled which, when set to true, will disable the menu.

For the sake of consistency the function set_groupmode_for_module has been renamed to set_coursemodule_groupmode and the functions show_course_module() and hide_course_module() have been combined to set_coursemodule_visible().
2005-02-12 21:41:22 +00:00

221 lines
8.1 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->id)) {
$form->id = '';
}
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->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="<?php echo $ME ?>">
<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">
<?php helpbutton('wikitype', get_string('wikitype', 'wiki'), 'wiki'); ?>
<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, "");
}
?>
</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">
<?php helpbutton('htmlmode', get_string('htmlmode', 'wiki'), 'wiki'); ?>
<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, "");
?>
</td>
</tr>
<tr valign="top">
<td align="right">
<?php helpbutton('ewikiacceptbinary', get_string('ewikiacceptbinary', 'wiki'), 'wiki') ?>
<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>
</td>
</tr>
<tr valign="top">
<td align="right">
<?php helpbutton('wikilinkoptions', get_string('wikilinkoptions', 'wiki'), 'wiki') ?>
<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 />
</td>
</tr>
<tr valign="top">
<td align="right">
<?php helpbutton('studentadminoptions', get_string('studentadminoptions', 'wiki'), 'wiki') ?>
<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') ?><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">
<?php helpbutton('wikiname', get_string('wikiname', 'wiki'), 'wiki'); ?>
<b><?php print_string('wikiname', 'wiki') ?>:</b></td>
<td>
<?php
if ($wikihasentries) {
echo $form->pagename;
}
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
}
?>
</td>
</tr>
<tr valign="top">
<td align="right" nowrap="nowrap">
<?php helpbutton('initialcontent', get_string('initialcontent', 'wiki'), 'wiki'); ?>
<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")."\" />&nbsp;";
button_to_popup_window ("/files/index.php?choose=form.initialcontent&amp;id=$course->id",
"wikifiles", $strchooseafile, 500, 750, $strchooseafile);
}
?>
</td>
</tr>
<?php print_visible_setting($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>