Skip to content
Browse files

Added the missing switch construct to the mymoodle page for flexible …

…column positioning.
  • Loading branch information...
1 parent f33f60f commit 1a730605aa62d3a7552addc43b9acdaf6f509777 urs_hunkler committed
Showing with 16 additions and 4 deletions.
  1. +16 −4 my/index.php
View
20 my/index.php
@@ -38,9 +38,13 @@
$PAGE->print_header($mymoodlestr);
- echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
+ echo '<table id="layout-table">';
echo '<tr valign="top">';
+ $lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable;
+ foreach ($lt as $column) {
+ switch ($column) {
+ case 'left':
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 210);
@@ -49,7 +53,10 @@
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
echo '</td>';
}
-
+
+ break;
+ case 'middle':
+
echo '<td valign="top" id="middle-column">';
/// The main overview in the middle of the page
@@ -83,7 +90,10 @@
}
echo '</td>';
-
+
+ break;
+ case 'right':
+
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing()) {
@@ -91,7 +101,9 @@
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
echo '</td>';
}
-
+ break;
+ }
+ }
/// Finish the page
echo '</tr></table>';

0 comments on commit 1a73060

Please sign in to comment.
Something went wrong with that request. Please try again.