mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
184 lines
6.6 KiB
HTML
184 lines
6.6 KiB
HTML
<?php
|
|
|
|
|
|
if (!isset($coursecontext)) {
|
|
// Has not yet been set by post.php.
|
|
$coursecontext = get_context_instance(CONTEXT_COURSE, $forum->course);
|
|
}
|
|
|
|
|
|
if (!isset($discussion->timestart)) {
|
|
$discussion->timestart = 0;
|
|
}
|
|
if (!isset($discussion->timeend)) {
|
|
$discussion->timeend = 0;
|
|
}
|
|
|
|
trusttext_prepare_edit($post->message, $post->format, $usehtmleditor, $modcontext);
|
|
|
|
?>
|
|
<form name="theform" method="post" action="post.php" enctype="multipart/form-data">
|
|
<table border="0" cellpadding="5">
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("subject", "forum"); ?>:</b></td>
|
|
<td>
|
|
<input type="text" name="subject" size="60" value="<?php p($post->subject) ?>" alt="<?php print_string("subject", "forum"); ?>" />
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("message", "forum"); ?>:</b>
|
|
<br /><br />
|
|
<?php
|
|
helpbutton("reading", get_string("helpreading"), "moodle", true, true);
|
|
echo "<br />";
|
|
helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
|
|
echo "<br />";
|
|
helpbutton("questions", get_string("helpquestions"), "moodle", true, true);
|
|
echo "<br />";
|
|
if ($usehtmleditor) {
|
|
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
|
|
} else {
|
|
emoticonhelpbutton("theform", "message");
|
|
}
|
|
echo "<br />";
|
|
?>
|
|
</td>
|
|
<td align="left">
|
|
<?php print_textarea($usehtmleditor, 25, 65, 630, 400, "message", $post->message); ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("formattexttype"); ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
if ($usehtmleditor) { /// Trying this out for a while
|
|
print_string('formathtml');
|
|
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
|
|
} else {
|
|
choose_from_menu(format_text_menu(), "format", $post->format, "");
|
|
}
|
|
helpbutton("textformat", get_string("helpformatting"));
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("subscription", "forum") ?>:</b></td>
|
|
<td>
|
|
<?php
|
|
if (forum_is_forcesubscribed($forum->id)) {
|
|
print_string("everyoneissubscribed", "forum");
|
|
} else if ($forum->forcesubscribe != FORUM_DISALLOWSUBSCRIBE ||
|
|
has_capability('moodle/course:manageactivities', $coursecontext)){
|
|
unset($options);
|
|
if (forum_is_subscribed($USER->id, $post->forum)) {
|
|
$options[0] = get_string("subscribestart", "forum");
|
|
$options[1] = get_string("subscribestop", "forum");
|
|
choose_from_menu($options, "unsubscribe", 0, "");
|
|
} else {
|
|
$default = 0;
|
|
if (!empty($USER->autosubscribe)) {
|
|
$default = 1;
|
|
}
|
|
$options[0] = get_string("subscribestop", "forum");
|
|
$options[1] = get_string("subscribestart", "forum");
|
|
choose_from_menu($options, "subscribe", $default, "");
|
|
}
|
|
} else if ($forum->forcesubscribe == FORUM_DISALLOWSUBSCRIBE) {
|
|
print_string('disallowsubscribe','forum');
|
|
}
|
|
helpbutton("subscription", get_string("subscription", "forum"), "forum");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<?php if ($forum->maxbytes != 1) { // 1 = No attachments at all
|
|
?>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("attachment", "forum") ?>:<br />(<?php print_string("optional") ?>) </b></td>
|
|
<td>
|
|
<?php $maxbytes = get_max_upload_file_size($CFG->maxbytes, $course->maxbytes, $forum->maxbytes); ?>
|
|
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $maxbytes ?>" />
|
|
<input type="file" name="attachment" size="40" alt="<?php print_string("attachment", "forum") ?>" />
|
|
<?php
|
|
helpbutton("attachment", get_string("attachment", "forum"), "forum");
|
|
echo ' ';
|
|
print_string("maxsize", "", display_size($maxbytes));
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
<?php
|
|
if (has_capability('moodle/course:manageactivities', $coursecontext)
|
|
&& empty($post->id)) {
|
|
?>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("mailnow", "forum") ?>:</b></td>
|
|
<td><?php print_checkbox('mailnow', '1', !empty($post->mailnow)); ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
<?php if (!empty($CFG->forum_enabletimedposts) && !$post->parent) {
|
|
// This is the first post of a discussion, and timed posts are enabled.
|
|
?>
|
|
<tr valign="top">
|
|
<td align="right"><b><?php print_string("displayperiod", "forum") ?>:<br />(<?php print_string("optional") ?>) </b></td>
|
|
<td>
|
|
<table cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td align="right"><?php print_string('displaystart', "forum") ?>: </td>
|
|
<td><?php
|
|
print_date_selector("timestartday", "timestartmonth", "timestartyear", $discussion->timestart);
|
|
print_string('disable');
|
|
echo ': ';
|
|
print_checkbox('timestartdisabled', 1, empty($discussion->timestart));
|
|
helpbutton("displayperiod", get_string("displayperiod", "forum"), "forum");
|
|
?></td>
|
|
</tr>
|
|
<tr>
|
|
<td height="18" colspan="2"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td align="right"><?php print_string('displayend', "forum") ?>: </td>
|
|
<td><?php
|
|
print_date_selector("timeendday", "timeendmonth", "timeendyear", $discussion->timeend);
|
|
print_string('disable');
|
|
echo ': ';
|
|
print_checkbox('timeenddisabled', 1, empty($discussion->timeend));
|
|
?></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php } else { ?>
|
|
<input type="hidden" name="timestartdisabled" value="1" />
|
|
<input type="hidden" name="timeenddisabled" value="1" />
|
|
<?php } ?>
|
|
<tr>
|
|
<td align="center" colspan="2">
|
|
<input type="hidden" name="course" value="<?php p($post->course) ?>" />
|
|
<input type="hidden" name="forum" value="<?php p($post->forum) ?>" />
|
|
<input type="hidden" name="discussion" value="<?php p($post->discussion) ?>" />
|
|
<input type="hidden" name="parent" value="<?php p($post->parent) ?>" />
|
|
<input type="hidden" name="userid" value="<?php p($post->userid) ?>" />
|
|
<input type="hidden" name="groupid" value="<?php p($post->groupid) ?>" />
|
|
<input type="hidden" name="edit" value="<?php p($post->edit) ?>" />
|
|
<input type="submit" value="<?php p(($post->edit) ? get_string('savechanges') : get_string('posttoforum', 'forum')); ?>" />
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
</form>
|