031dd5f017
I finally was able to see the HTML Editor bug in IE/XP that everyone was talking about, and it's a very serious bug as it makes Moodle 1.3 almost unusable for these people. :-( :-( So, I eventually found out that the problem is that the Javascript that attaches the editor has troubles when it is embedded within the table that course/mod.php puts around the mod.html forms in each module. (Only in IE and only sometimes, mind you). While testing I also had a good look at a long standing issue which is the inconsistency of the mod.html forms when using the editor. So, to fix both I decided to put the HTML editor calls OUTSIDE the mod.html in the mod.php file. This means that all modules get the HTML editor by default on all text areas during activity module setup by default. I've been running through this for the past few hours and it seems pretty stable now and a lot more consistent, so I'm checking it in as big fix towards the Moodle 1.3.1 we have to have. Unfortunately it also means the API has changed a bit ... I had to update all the module dependencies to this exact version (or later). Please test this "stable" version hard using the standard modules only and I'll merge these changes over to the trunk in a day or so and update all known third-party modules.
66 lines
1.7 KiB
PHP
66 lines
1.7 KiB
PHP
<?PHP // $Id$
|
|
// Edit the introduction of a section
|
|
|
|
require_once("../config.php");
|
|
require_once("lib.php");
|
|
|
|
require_variable($id); // Week ID
|
|
|
|
require_login();
|
|
|
|
if (! $section = get_record("course_sections", "id", $id)) {
|
|
error("Course section is incorrect");
|
|
}
|
|
|
|
if (! $course = get_record("course", "id", $section->course)) {
|
|
error("Could not find the course!");
|
|
}
|
|
|
|
if (!isteacher($course->id)) {
|
|
error("Only teachers can edit this!");
|
|
}
|
|
|
|
|
|
/// If data submitted, then process and store.
|
|
|
|
if ($form = data_submitted()) {
|
|
|
|
$timenow = time();
|
|
|
|
if (! set_field("course_sections", "summary", $form->summary, "id", $section->id)) {
|
|
error("Could not update the summary!");
|
|
}
|
|
|
|
add_to_log($course->id, "course", "editsection", "editsection.php?id=$section->id", "$section->section");
|
|
|
|
redirect("view.php?id=$course->id");
|
|
exit;
|
|
}
|
|
|
|
/// Otherwise fill and print the form.
|
|
|
|
if (empty($form)) {
|
|
$form = $section;
|
|
}
|
|
|
|
$usehtmleditor = can_use_html_editor();
|
|
|
|
$sectionname = get_string("name$course->format");
|
|
$stredit = get_string("edit", "", " $sectionname $section->section");
|
|
|
|
print_header("$course->shortname: $stredit", "$course->fullname",
|
|
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A>
|
|
-> $stredit");
|
|
|
|
print_heading(get_string("summaryof", "", "$sectionname $form->section"));
|
|
print_simple_box_start("center", "", "$THEME->cellheading");
|
|
include("editsection.html");
|
|
print_simple_box_end();
|
|
|
|
if ($usehtmleditor) {
|
|
use_html_editor("summary");
|
|
}
|
|
print_footer($course);
|
|
|
|
?>
|