You know you are beyond hope of redemption when you make "API uniformity" changes. ;-)
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
echo '<table id="layout-table">';
|
||||
echo '<tr>';
|
||||
|
||||
if(blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $editing) {
|
||||
if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
|
||||
echo '<td style="width: '.$preferred_width_left.'px;" id="left-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
|
||||
echo '</td>';
|
||||
@@ -54,7 +54,7 @@
|
||||
echo '</td>';
|
||||
|
||||
// The right column
|
||||
if(blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing) {
|
||||
if(blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
|
||||
echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
|
||||
echo '</td>';
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
/// The left column ...
|
||||
|
||||
if (blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $editing) {
|
||||
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
|
||||
echo '<td style="width: '.$preferred_width_left.'px;" id="left-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
|
||||
echo '</td>';
|
||||
@@ -254,7 +254,7 @@
|
||||
echo '</td>';
|
||||
|
||||
// The right column
|
||||
if (blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing) {
|
||||
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
|
||||
echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
|
||||
echo '</td>';
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
/// The left column ...
|
||||
|
||||
if (blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $editing) {
|
||||
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
|
||||
echo '<td style="width: '.$preferred_width_left.'px;" id="left-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
|
||||
echo '</td>';
|
||||
@@ -244,7 +244,7 @@
|
||||
echo '</td>';
|
||||
|
||||
// The right column
|
||||
if (blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing) {
|
||||
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
|
||||
echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
|
||||
echo '</td>';
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<tr>
|
||||
<?PHP
|
||||
|
||||
if(blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $editing) {
|
||||
if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
|
||||
echo '<td style="width: '.$preferred_width_left.'px;" id="left-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
|
||||
echo '</td>';
|
||||
@@ -180,7 +180,7 @@
|
||||
|
||||
|
||||
// The right column
|
||||
if(blocks_have_content($pageblocks[BLOCK_POS_RIGHT]) || $editing || isadmin()) {
|
||||
if(blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || isadmin()) {
|
||||
echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
|
||||
if (isadmin()) {
|
||||
echo '<div align="center">'.update_course_icon($SITE->id).'</div>';
|
||||
|
||||
+2
-2
@@ -169,8 +169,8 @@ function blocks_delete_instance($instance) {
|
||||
// Accepts an array of block instances and checks to see if any of them have content to display
|
||||
// (causing them to calculate their content in the process). Returns true or false. Parameter passed
|
||||
// by reference for speed; the array is actually not modified.
|
||||
function blocks_have_content(&$instances) {
|
||||
foreach($instances as $instance) {
|
||||
function blocks_have_content(&$pageblocks, $position) {
|
||||
foreach($pageblocks[$position] as $instance) {
|
||||
if (!$instance->visible) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@
|
||||
|
||||
echo '<table id="layout-table"><tr>';
|
||||
|
||||
if(blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $PAGE->user_is_editing()) {
|
||||
if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
|
||||
echo '</td>';
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@
|
||||
|
||||
echo '<table id="layout-table"><tr>';
|
||||
|
||||
if(blocks_have_content($pageblocks[BLOCK_POS_LEFT]) || $PAGE->user_is_editing()) {
|
||||
if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
|
||||
echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
|
||||
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
|
||||
echo '</td>';
|
||||
|
||||
Reference in New Issue
Block a user