mirror of
https://github.com/moodle/moodle.git
synced 2025-03-15 05:00:06 +01:00
Journal questions can now use HTML editor, plus new field 'introformat'
This commit is contained in:
parent
ecd7e49e87
commit
34a2293e08
@ -38,6 +38,7 @@
|
||||
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));
|
||||
|
@ -43,6 +43,10 @@ function journal_upgrade($oldversion) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2004011400) {
|
||||
table_column("journal", "", "introformat", "integer", "2", "", "1", "not null", "intro");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ CREATE TABLE prefix_journal (
|
||||
course int(10) unsigned NOT NULL default '0',
|
||||
name varchar(255) default NULL,
|
||||
intro text,
|
||||
introformat tinyint(2) NOT NULL default '0',
|
||||
days smallint(5) unsigned NOT NULL default '7',
|
||||
assessed int(10) NOT NULL default '0',
|
||||
timemodified int(10) unsigned NOT NULL default '0',
|
||||
|
@ -26,5 +26,9 @@ function journal_upgrade($oldversion) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($oldversion < 2004011400) {
|
||||
table_column("journal", "", "introformat", "integer", "2", "", "1", "not null", "intro");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ CREATE TABLE prefix_journal (
|
||||
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'
|
||||
|
@ -83,7 +83,7 @@
|
||||
|
||||
echo "<center>\n";
|
||||
|
||||
print_simple_box( format_text($journal->intro) , "center");
|
||||
print_simple_box( format_text($journal->intro, $journal->introformat) , "center");
|
||||
|
||||
echo "<br />";
|
||||
|
||||
|
@ -57,7 +57,7 @@ function journal_user_complete_index($course, $user, $journal, $journalopen, $he
|
||||
}
|
||||
|
||||
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 />";
|
||||
|
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
if ($usehtmleditor = can_use_richtext_editor()) {
|
||||
$defaultformat = FORMAT_HTML;
|
||||
} else {
|
||||
$defaultformat = FORMAT_MOODLE;
|
||||
}
|
||||
|
||||
if (!isset($form->name)) {
|
||||
$form->name = "";
|
||||
}
|
||||
@ -25,24 +31,42 @@
|
||||
<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 />";
|
||||
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>
|
||||
@ -83,3 +107,11 @@
|
||||
<input type="submit" name=cancel value="<?php print_string("cancel") ?>">
|
||||
</form>
|
||||
</center>
|
||||
|
||||
|
||||
<?php
|
||||
if ($usehtmleditor) {
|
||||
print_richedit_javascript("form", "intro", "yes");
|
||||
}
|
||||
?>
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
$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']['#']);
|
||||
|
@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2003081705;
|
||||
$module->version = 2004011400;
|
||||
$module->cron = 60;
|
||||
|
||||
?>
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
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 \>";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user