From df9e0f89e30678426cab98fb4564e50ed10eb44c Mon Sep 17 00:00:00 2001 From: defacer Date: Tue, 1 Jun 2004 13:47:55 +0000 Subject: [PATCH] Fixes for bug 1485: Now the site has blocks by default. Also, block panel width is restricted even if there are no blocks to display. --- admin/site.php | 5 +++++ index.php | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/admin/site.php b/admin/site.php index 81e80f49db..ba9fe99f1f 100644 --- a/admin/site.php +++ b/admin/site.php @@ -28,6 +28,11 @@ error("Serious Error! Could not update the site record! (id = $form->id)"); } } else { + // [pj] We are about to create the site, so let's add some blocks... + // calendar_month is included as a Moodle feature advertisement ;-) + require_once('../lib/blocklib.php'); + $form->blockinfo = blocks_get_default_blocks(NULL, 'site_main_menu,admin,course_list:course_summary,calendar_month'); + if ($newid = insert_record("course", $form)) { $cat->name = get_string("miscellaneous"); if (insert_record("course_categories", $cat)) { diff --git a/index.php b/index.php index 8f6311637a..4ddf7f75b8 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,12 @@ blockcache->width->{$site->id}->right; } + $preferred_width_left = min($preferred_width_left, BLOCK_L_MAX_WIDTH); + $preferred_width_left = max($preferred_width_left, BLOCK_L_MIN_WIDTH); + $preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH); + $preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH); + ?> -- 2.39.5