Commit df9e0f89 authored by defacer's avatar defacer
Browse files

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.
parent 10e5d7c1
......@@ -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)) {
......
<?PHP // $Id$
// index.php - the front page.
// Bounds for block widths
define('BLOCK_L_MIN_WIDTH', 160);
define('BLOCK_L_MAX_WIDTH', 210);
define('BLOCK_R_MIN_WIDTH', 160);
define('BLOCK_R_MAX_WIDTH', 210);
require_once("config.php");
require_once("course/lib.php");
require_once('lib/blocklib.php');
......@@ -123,6 +129,11 @@
$preferred_width_right = $SESSION->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);
?>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment