Commit d55c9a1f authored by urs_hunkler's avatar urs_hunkler
Browse files

'changes for flexible column arrangement - see MDL-8109'

parent 86aab05c
......@@ -68,6 +68,12 @@
echo '<table id="layout-table" cellspacing="0"><tr>';
/// The left column ...
// uh-changes start
$lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable;
foreach ($lt as $column) {
switch ($column) {
case 'left':
// uh-changes end
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
......@@ -75,6 +81,10 @@
echo '</td>';
}
// uh-changes start
break;
case 'middle':
// uh-changes end
/// Start main column
echo '<td id="middle-column"><a name="startofcontent"></a>';
......@@ -260,6 +270,10 @@
echo '</td>';
// uh-changes start
break;
case 'right':
// uh-changes end
// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
......@@ -267,6 +281,11 @@
echo '</td>';
}
// uh-changes start
break;
}
}
// uh-changes end
echo '</tr></table>';
?>
......@@ -99,13 +99,24 @@
<table id="layout-table" summary="">
<tr>
<?php
// uh-changes start
// $CFG->LayoutTable = array('left', 'middle', 'right');
// $CFG->LayoutTable = array('left', 'right', 'middle');
// $CFG->LayoutTable = array('middle', 'left', 'right');
$lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable;
foreach ($lt as $column) {
switch ($column) {
case 'left':
// uh-changes end
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>';
}
// uh-changes start
break;
case 'middle':
// uh-changes end
echo '<td id="middle-column">';
......@@ -225,7 +236,10 @@
}
echo '</td>';
// uh-changes start
break;
case 'right':
// uh-changes end
// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
......@@ -236,6 +250,11 @@
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
echo '</td>';
}
// uh-changes start
break;
}
}
// uh-changes end
?>
</tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment