mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Fix for bug 1736:
Invisible blocks are now not contributing to block column width calculations.
This commit is contained in:
parent
f5ecf2e91a
commit
0c9c6363bc
@ -176,6 +176,10 @@ function blocks_preferred_width($blockarray, $blockinfos) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
foreach($blockarray as $blockid) {
|
foreach($blockarray as $blockid) {
|
||||||
|
if($blockid < 0) {
|
||||||
|
// Invisible block
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if(isset($blockinfos[$blockid])) {
|
if(isset($blockinfos[$blockid])) {
|
||||||
$blockname = $blockinfos[$blockid]->name;
|
$blockname = $blockinfos[$blockid]->name;
|
||||||
$pref = block_method_result($blockname, 'preferred_width');
|
$pref = block_method_result($blockname, 'preferred_width');
|
||||||
@ -959,7 +963,7 @@ function blocks_get_block_ids ($blockinfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This is used to register the blocks that are displayed in the course page.
|
// This is used to register the blocks that are displayed in the course page.
|
||||||
// Set in course/view.php, and read from any other place.
|
// Set in course/view.php or /index.php, and read from any other place.
|
||||||
function blocks_used($blocks = NULL, $records = NULL) {
|
function blocks_used($blocks = NULL, $records = NULL) {
|
||||||
static $used = NULL;
|
static $used = NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user