mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
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.
This commit is contained in:
parent
10e5d7c19b
commit
df9e0f89e3
@ -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)) {
|
||||
|
11
index.php
11
index.php
@ -1,6 +1,12 @@
|
||||
<?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);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user