]> git.mjollnir.org Git - moodle.git/commitdiff
fixed block width calculation; merged from MOODLE_16_STABLE
authorskodak <skodak>
Fri, 19 May 2006 21:01:26 +0000 (21:01 +0000)
committerskodak <skodak>
Fri, 19 May 2006 21:01:26 +0000 (21:01 +0000)
blog/header.php

index ba9e76ef393dfa2aaf83d6332c0eb751b7374286..43dc91be13c90fb7fcc993e5fef58008bc602f27 100755 (executable)
@@ -192,12 +192,10 @@ if ($PAGE->user_allowed_editing()) {
 }
 
 // Calculate the preferred width for left, right and center (both center positions will use the same)
-$preferred_width_left = optional_param('preferred_width_left',  blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), PARAM_INT);
-$preferred_width_right = optional_param('preferred_width_right', blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), PARAM_INT);
-$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);
+$preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
+                                        BLOCK_L_MAX_WIDTH);
+$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
+                                        BLOCK_R_MAX_WIDTH);
 
 // Display the blocks and allow blocklib to handle any block action requested
 $pageblocks = blocks_get_by_page($PAGE);