mirror of
https://github.com/moodle/moodle.git
synced 2025-01-21 07:28:31 +01:00
48e535bc35
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().
109 lines
3.5 KiB
HTML
109 lines
3.5 KiB
HTML
<?php
|
|
if (!isset($form->name)) {
|
|
$form->name = "";
|
|
}
|
|
if (!isset($form->intro)) {
|
|
$form->intro = "";
|
|
}
|
|
if (!isset($form->assessed)) {
|
|
$form->assessed = "0";
|
|
}
|
|
if (!isset($form->days)) {
|
|
if ($course->format == "weeks") {
|
|
$form->days = "7";
|
|
} else {
|
|
$form->days = "0";
|
|
}
|
|
}
|
|
?>
|
|
|
|
<form name="form" method="post" action="mod.php">
|
|
<table cellpadding="5">
|
|
<tr valign="top">
|
|
<td align="right"><p><b><?php print_string("journalname", "journal") ?>:</b></p></td>
|
|
<td>
|
|
<input type="text" name="name" size="30" value="<?php p($form->name) ?>" />
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign="top">
|
|
<td align="right"><p><b><?php print_string("journalquestion", "journal") ?>:</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 />";
|
|
if ($usehtmleditor) {
|
|
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
|
|
} else {
|
|
emoticonhelpbutton("form", "intro");
|
|
}
|
|
?>
|
|
<br />
|
|
</font>
|
|
</td>
|
|
<td>
|
|
<?php
|
|
print_textarea($usehtmleditor, 20, 60, 680, 400, "intro", $form->intro);
|
|
|
|
if ($usehtmleditor) {
|
|
echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
|
|
} else {
|
|
echo "<p align=\"right\">";
|
|
helpbutton("textformat", get_string("formattexttype"));
|
|
print_string("formattexttype");
|
|
echo ": ";
|
|
if (!$form->introformat) {
|
|
$form->introformat = $defaultformat;
|
|
}
|
|
choose_from_menu(format_text_menu(), "introformat", $form->introformat, "");
|
|
echo "</p>";
|
|
}
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr valign="top">
|
|
<td align="right"><p><b><?php print_string("grade") ?>:</b></p></td>
|
|
<td>
|
|
<?php
|
|
print_grade_menu($course->id, "assessed", "$form->assessed");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td align="right"><p><b><?php print_string("daysavailable", "journal") ?>:</b></p></td>
|
|
<td>
|
|
<?php
|
|
$options = array();
|
|
$options[0] = get_string("alwaysopen", "journal");
|
|
for ($i=1;$i<=13;$i++) {
|
|
$options[$i] = get_string("numdays", "", $i);
|
|
}
|
|
for ($i=2;$i<=16;$i++) {
|
|
$days = $i * 7;
|
|
$options[$days] = get_string("numweeks", "", $i);
|
|
}
|
|
$options[365] = get_string("numweeks", "", 52);
|
|
choose_from_menu($options, "days", "$form->days");
|
|
?>
|
|
</td>
|
|
</tr>
|
|
<?php print_standard_coursemodule_settings($form); ?>
|
|
</table>
|
|
<center>
|
|
<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="mode" value="<?php p($form->mode) ?>" />
|
|
<input type="submit" value="<?php print_string("savechanges") ?>" />
|
|
<input type="submit" name="cancel" value="<?php print_string("cancel") ?>" />
|
|
</form>
|
|
</center>
|