fwrite ($bf,full_tag("MODTYPE",4,false,"journal"));
fwrite ($bf,full_tag("NAME",4,false,$journal->name));
fwrite ($bf,full_tag("INTRO",4,false,$journal->intro));
+ fwrite ($bf,full_tag("INTROFORMAT",4,false,$journal->introformat));
fwrite ($bf,full_tag("DAYS",4,false,$journal->days));
fwrite ($bf,full_tag("ASSESSED",4,false,$journal->assessed));
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$journal->timemodified));
$result = false;
}
}
+
+ if ($oldversion < 2004011400) {
+ table_column("journal", "", "introformat", "integer", "2", "", "1", "not null", "intro");
+ }
return $result;
}
course int(10) unsigned NOT NULL default '0',\r
name varchar(255) default NULL,\r
intro text,\r
+ introformat tinyint(2) NOT NULL default '0',\r
days smallint(5) unsigned NOT NULL default '7',\r
assessed int(10) NOT NULL default '0',\r
timemodified int(10) unsigned NOT NULL default '0',\r
}
}
+ if ($oldversion < 2004011400) {
+ table_column("journal", "", "introformat", "integer", "2", "", "1", "not null", "intro");
+ }
+
return $result;
}
course integer NOT NULL default '0',
name varchar(255) default NULL,
intro text,
+ introformat integer NOT NULL default '0',
days integer NOT NULL default '7',
assessed integer NOT NULL default '0',
timemodified integer NOT NULL default '0'
echo "<center>\n";
- print_simple_box( format_text($journal->intro) , "center");
+ print_simple_box( format_text($journal->intro, $journal->introformat) , "center");
echo "<br />";
}
print_simple_box_start("left", "90%");
- echo format_text($journal->intro);
+ echo format_text($journal->intro, $journal->introformat);
print_simple_box_end();
echo "<br clear=all />";
echo "<br />";
<?php
+ if ($usehtmleditor = can_use_richtext_editor()) {
+ $defaultformat = FORMAT_HTML;
+ } else {
+ $defaultformat = FORMAT_MOODLE;
+ }
+
if (!isset($form->name)) {
$form->name = "";
}
<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">
+ <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");
+ if ($usehtmleditor) {
+ helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
+ } else {
+ emoticonhelpbutton("form", "intro");
+ }
?>
<br />
</font>
-
- </TD>
+ </td>
<td>
- <textarea name="intro" rows=15 cols=30 wrap="virtual"><?php p($form->intro) ?></textarea>
+ <?php
+ print_textarea($usehtmleditor, 20, 60, 680, 400, "intro", $form->intro);
+
+ 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>
<input type="submit" name=cancel value="<?php print_string("cancel") ?>">
</form>
</center>
+
+
+<?php
+ if ($usehtmleditor) {
+ print_richedit_javascript("form", "intro", "yes");
+ }
+?>
+
$journal->course = $restore->course_id;
$journal->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
$journal->intro = backup_todb($info['MOD']['#']['INTRO']['0']['#']);
+ $journal->introformat = backup_todb($info['MOD']['#']['INTROFORMAT']['0']['#']);
$journal->days = backup_todb($info['MOD']['#']['DAYS']['0']['#']);
$journal->assessed = backup_todb($info['MOD']['#']['ASSESSED']['0']['#']);
$journal->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']);
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
-$module->version = 2003081705;
+$module->version = 2004011400;
$module->cron = 60;
?>
echo "<center>\n";
- print_simple_box( text_to_html($journal->intro) , "center");
+ print_simple_box( text_to_html($journal->intro, $journal->introformat) , "center");
echo "<br \>";