2003-05-20 08:03:12 +00:00
|
|
|
<?php
|
2003-06-09 05:34:24 +00:00
|
|
|
if (!isset($form->name)) {
|
2003-01-01 13:17:27 +00:00
|
|
|
$form->name = "";
|
|
|
|
}
|
2003-06-09 05:34:24 +00:00
|
|
|
if (!isset($form->type)) {
|
2003-01-01 13:17:27 +00:00
|
|
|
$form->type = "";
|
|
|
|
}
|
2003-06-09 05:34:24 +00:00
|
|
|
if (!isset($form->intro)) {
|
2003-01-01 13:17:27 +00:00
|
|
|
$form->intro = "";
|
|
|
|
}
|
2003-06-09 05:34:24 +00:00
|
|
|
if (!isset($form->open)) {
|
2003-04-24 08:45:27 +00:00
|
|
|
$form->open = 2;
|
2003-01-01 13:17:27 +00:00
|
|
|
}
|
2003-06-09 05:34:24 +00:00
|
|
|
if (!isset($form->assessed)) {
|
2003-01-01 13:17:27 +00:00
|
|
|
$form->assessed = "";
|
|
|
|
}
|
2003-06-09 05:34:24 +00:00
|
|
|
if (!isset($form->forcesubscribe)) {
|
2003-01-01 13:17:27 +00:00
|
|
|
$form->forcesubscribe = "";
|
|
|
|
}
|
|
|
|
?>
|
2003-06-16 14:40:51 +00:00
|
|
|
<form name="form" method="post" <?php echo $onsubmit ?> action="mod.php">
|
2002-06-20 15:15:22 +00:00
|
|
|
<table cellpadding=5>
|
|
|
|
<tr>
|
|
|
|
<tr valign=top>
|
2003-05-20 08:03:12 +00:00
|
|
|
<td align=right><p><b><?php print_string("forumname", "forum")?>:</b></p></td>
|
2002-06-20 15:15:22 +00:00
|
|
|
<td>
|
2003-05-20 08:03:12 +00:00
|
|
|
<input type="text" name="name" size=30 value="<?php p($form->name) ?>">
|
2002-06-20 15:15:22 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign=top>
|
2003-05-20 08:03:12 +00:00
|
|
|
<td align=right><p><b><?php print_string("forumtype", "forum")?>:</b></p></td>
|
2002-06-20 15:15:22 +00:00
|
|
|
<td>
|
2003-05-20 08:03:12 +00:00
|
|
|
<?php
|
2002-06-20 15:15:22 +00:00
|
|
|
$student = strtolower($course->student);
|
|
|
|
require("$CFG->dirroot/mod/forum/lib.php");
|
2002-08-02 09:50:53 +00:00
|
|
|
asort($FORUM_TYPES);
|
2002-08-26 10:01:46 +00:00
|
|
|
if (! $form->type) {
|
|
|
|
$form->type = "general";
|
|
|
|
}
|
2002-10-25 08:47:53 +00:00
|
|
|
if ($form->type == "news") {
|
|
|
|
print_string("namenews", "forum");
|
2003-01-02 10:46:52 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"type\" value=\"news\">";
|
2002-10-25 08:47:53 +00:00
|
|
|
} else if ($form->type == "social") {
|
|
|
|
print_string("namesocial", "forum");
|
2003-01-02 10:46:52 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"type\" value=\"social\">";
|
2002-10-25 08:47:53 +00:00
|
|
|
} else {
|
|
|
|
choose_from_menu($FORUM_TYPES, "type", $form->type, "");
|
|
|
|
helpbutton("forumtype", get_string("forumtype", "forum"), "forum");
|
|
|
|
}
|
2002-06-20 15:15:22 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr valign=top>
|
2003-05-20 08:03:12 +00:00
|
|
|
<td align=right><p><b><?php print_string("forumintro", "forum")?>:</b></p>
|
|
|
|
<font size="1">
|
|
|
|
<?php
|
|
|
|
helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
|
|
|
|
echo "<br />";
|
|
|
|
helpbutton("questions", get_string("helpquestions"), "moodle", true, true);
|
|
|
|
echo "<br />";
|
|
|
|
emoticonhelpbutton("form", "intro");
|
|
|
|
echo " <br />";
|
|
|
|
?>
|
|
|
|
</font>
|
2002-12-13 09:06:30 +00:00
|
|
|
</td>
|
2002-06-20 15:15:22 +00:00
|
|
|
<td>
|
2003-05-20 08:03:12 +00:00
|
|
|
<textarea name="intro" rows=4 cols=50 wrap="virtual"><?php p($form->intro) ?></textarea>
|
2002-06-20 15:15:22 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr valign=top>
|
2003-05-20 08:03:12 +00:00
|
|
|
<td align=right><p><b><?php print_string("allowdiscussions", "forum", strtolower("$course->student")) ?>:</b></p></td>
|
2002-06-20 15:15:22 +00:00
|
|
|
<td>
|
2003-05-20 08:03:12 +00:00
|
|
|
<?php
|
|
|
|
choose_from_menu($FORUM_OPEN_MODES, "open", $form->open, "");
|
|
|
|
helpbutton("allowdiscussions", get_string("allowdiscussions",
|
2003-08-15 13:59:24 +00:00
|
|
|
"forum", moodle_strtolower("$course->student")), "forum");
|
2003-05-20 08:03:12 +00:00
|
|
|
?>
|
2002-06-20 15:15:22 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2002-10-03 11:15:50 +00:00
|
|
|
|
2002-06-20 15:15:22 +00:00
|
|
|
<tr>
|
2003-08-15 13:59:24 +00:00
|
|
|
<td align=right valign=top><p><b><?php print_string("allowratings", "forum") ?>:</b></p></td>
|
2002-06-20 15:15:22 +00:00
|
|
|
<td>
|
2003-05-20 08:03:12 +00:00
|
|
|
<?php
|
2003-08-25 08:04:39 +00:00
|
|
|
echo "<script>";
|
|
|
|
echo " var subitemstime = ['startday','startmonth','startyear','starthour', 'startminute',".
|
|
|
|
"'finishday','finishmonth','finishyear','finishhour','finishminute'];";
|
|
|
|
echo " var subitemsall = ['assessed', 'ratingtime', 'scale', 'startday','startmonth','startyear','starthour', 'startminute',".
|
|
|
|
"'finishday','finishmonth','finishyear','finishhour','finishminute'];";
|
|
|
|
echo "</script>";
|
|
|
|
|
|
|
|
echo "<input name=\"userating\" type=checkbox value=1 ";
|
|
|
|
echo " onclick=\"return lockoptions('form','userating', subitemsall)\" ";
|
|
|
|
if ($form->assessed) {
|
|
|
|
echo " checked ";
|
|
|
|
}
|
|
|
|
echo ">";
|
|
|
|
echo get_string("ratingsuse", "forum").":";
|
|
|
|
echo "<br />";
|
|
|
|
|
2003-08-15 13:59:24 +00:00
|
|
|
// The odd order below was to maintain backward compatibility
|
|
|
|
unset($options);
|
|
|
|
$options[2] = get_string("ratingonlyteachers", "forum", moodle_strtolower($course->teachers));
|
|
|
|
$options[1] = get_string("ratingeveryone", "forum");
|
2003-08-25 08:04:39 +00:00
|
|
|
echo get_string("users").":";
|
2003-05-20 08:03:12 +00:00
|
|
|
choose_from_menu($options, "assessed", $form->assessed, "");
|
2003-08-18 05:28:30 +00:00
|
|
|
echo "<br />";
|
2003-08-25 08:04:39 +00:00
|
|
|
|
2003-08-25 12:47:36 +00:00
|
|
|
echo get_string("grade").":";
|
|
|
|
print_grade_menu($course->id, "scale", $form->scale, false);
|
2003-08-25 07:39:06 +00:00
|
|
|
echo "<br />";
|
2003-08-25 08:04:39 +00:00
|
|
|
|
2003-08-25 07:39:06 +00:00
|
|
|
echo "<input name=\"ratingtime\" type=checkbox value=1 ";
|
2003-08-25 08:04:39 +00:00
|
|
|
echo " onclick=\"return lockoptions('form','ratingtime', subitemstime)\" ";
|
2003-08-25 07:39:06 +00:00
|
|
|
if ($form->assesstimestart and $form->assesstimefinish and $form->assessed) {
|
|
|
|
$form->ratingtime = 1;
|
|
|
|
echo " checked ";
|
|
|
|
}
|
|
|
|
echo ">";
|
2003-08-25 08:04:39 +00:00
|
|
|
|
2003-08-25 07:39:06 +00:00
|
|
|
print_string("ratingtime", "forum");
|
|
|
|
echo "<table align=left><tr><td align=right nowrap>";
|
|
|
|
echo get_string("from").":";
|
|
|
|
print_date_selector("startday", "startmonth", "startyear", $form->assesstimestart);
|
|
|
|
print_time_selector("starthour", "startminute", $form->assesstimestart);
|
|
|
|
echo "<br />";
|
|
|
|
echo get_string("to").":";
|
|
|
|
print_date_selector("finishday", "finishmonth", "finishyear", $form->assesstimefinish);
|
|
|
|
print_time_selector("finishhour", "finishminute", $form->assesstimefinish);
|
|
|
|
echo "<br />";
|
|
|
|
echo "</td></tr></table>";
|
2003-08-25 08:04:39 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"hratingtime\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hassessed\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hscale\" value=0>";
|
2003-08-25 07:39:06 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"hstartday\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hstartmonth\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hstartyear\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hstarthour\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hstartminute\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hfinishday\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hfinishmonth\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hfinishyear\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hfinishhour\" value=0>";
|
|
|
|
echo "<input type=\"hidden\" name=\"hfinishminute\" value=0>";
|
|
|
|
|
2003-08-25 08:04:39 +00:00
|
|
|
echo "<script>";
|
|
|
|
echo "lockoptions('form','userating', subitemsall);";
|
|
|
|
echo "</script>";
|
|
|
|
|
2003-08-25 07:39:06 +00:00
|
|
|
if (empty($form->ratingtime)) {
|
|
|
|
echo "<script>";
|
2003-08-25 08:04:39 +00:00
|
|
|
echo "lockoptions('form','ratingtime', subitemstime);";
|
2003-08-25 07:39:06 +00:00
|
|
|
echo "</script>";
|
|
|
|
}
|
2003-05-20 08:03:12 +00:00
|
|
|
?>
|
2002-06-20 15:15:22 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2002-07-31 14:19:35 +00:00
|
|
|
<tr>
|
2003-05-20 08:03:12 +00:00
|
|
|
<td align=right><p><b><?php print_string("forcesubscribeq", "forum") ?>:</b></p></td>
|
2002-07-31 14:19:35 +00:00
|
|
|
<td>
|
2003-05-20 08:03:12 +00:00
|
|
|
<?php
|
2003-08-15 13:59:24 +00:00
|
|
|
unset($options);
|
|
|
|
$options[0] = get_string("no");
|
|
|
|
$options[1] = get_string("yes");
|
2003-05-20 08:03:12 +00:00
|
|
|
choose_from_menu($options, "forcesubscribe", $form->forcesubscribe, "");
|
|
|
|
helpbutton("subscription", get_string("forcesubscribeq", "forum"), "forum");
|
|
|
|
?>
|
2002-07-31 14:19:35 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2002-06-20 15:15:22 +00:00
|
|
|
</table>
|
2003-05-20 08:03:12 +00:00
|
|
|
<center>
|
2002-06-20 15:15:22 +00:00
|
|
|
<input type="hidden" name=course value="<? p($form->course) ?>">
|
|
|
|
<input type="hidden" name=coursemodule value="<? p($form->coursemodule) ?>">
|
2002-06-25 11:49:06 +00:00
|
|
|
<input type="hidden" name=section value="<? p($form->section) ?>">
|
2002-06-20 15:15:22 +00:00
|
|
|
<input type="hidden" name=module value="<? p($form->module) ?>">
|
|
|
|
<input type="hidden" name=modulename value="<? p($form->modulename) ?>">
|
|
|
|
<input type="hidden" name=instance value="<? p($form->instance) ?>">
|
|
|
|
<input type="hidden" name=mode value="<? p($form->mode) ?>">
|
2002-08-15 17:41:24 +00:00
|
|
|
<input type="submit" value="<? print_string("savechanges") ?>">
|
2002-10-16 04:51:55 +00:00
|
|
|
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
|
2003-05-20 08:03:12 +00:00
|
|
|
</center>
|
|
|
|
</form>
|