MAJOR CHANGES:

--------------

Brand-new pagelib.php at your disposal! It slices, it dices, it makes your coffee.
It still doesn't understand women... Read the comments in pagelib.php for a first
impression. Feedback highly encouraged!

Blocks code has undergone significant changes to work with Pages. Flexibility is its
middle name, since I think (without having tried it) that adding e.g. a third
placeholder for "center" blocks in courses, with full support for moving around etc,
will now take about 15 lines of new or edited code. If you are not impressed yet, I
suggest watching a documentary on solar physics. :P

MINOR CHANGES:
--------------

Added instance_allow_config() in the blocks class hierarchy to supplement per-instance
configuration options. You can override it to return true and thus get configuration
amenities without allowing multiple instances.

Minor polishing to comments and documentation (whatever caught my eye was game).

Tightened up some code here and there by utilizing all the new features.

BUGFIXES:
---------

A bug in restore_execute.html caused hidden blocks to not be restored at all.
This commit is contained in:
defacer
2004-11-08 19:36:07 +00:00
parent dea3ce5b03
commit f032aa7a5f
13 changed files with 565 additions and 355 deletions
+5 -12
View File
@@ -32,8 +32,6 @@
}
/// If data submitted, then process and store.
if ($form = data_submitted() and confirm_sesskey()) {
@@ -54,29 +52,24 @@
if (!empty($course)) {
// Test for and remove blocks which aren't appropriate anymore
$page = new stdClass;
$page->id = $course->id;
$page->type = MOODLE_PAGE_COURSE;
$page = MoodlePage::create_object(MOODLE_PAGE_COURSE, $course->id);
blocks_remove_inappropriate($page);
// Update with the new data
if (update_record("course", $form)) {
if (update_record('course', $form)) {
add_to_log($course->id, "course", "update", "edit.php?id=$id", "");
fix_course_sortorder();
redirect("view.php?id=$course->id", get_string("changessaved"));
redirect($page->url_get_full(), get_string('changessaved'));
} else {
error("Serious Error! Could not update the course record! (id = $form->id)");
}
} else {
$form->timecreated = time();
if ($newcourseid = insert_record("course", $form)) { // Set up new course
if ($newcourseid = insert_record('course', $form)) { // Set up new course
// Setup the blocks
$page = new stdClass;
$page->type = MOODLE_PAGE_COURSE;
$page->id = $newcourseid;
$page = MoodlePage::create_object(MOODLE_PAGE_COURSE, $newcourseid);
blocks_repopulate_page($page); // Return value not checked because you can always edit later
$section = NULL;