Permalink
Browse files

MDL-8109 - found a way to work with the split print_header and print_…

…footer part. Check the tracker for more info
  • Loading branch information...
1 parent 62ec0b2 commit 9ffa6198f319260554f58a5eb19624be0a2554b8 urs_hunkler committed Aug 7, 2007
Showing with 71 additions and 4 deletions.
  1. +71 −4 lib/adminlib.php
View
@@ -2660,7 +2660,17 @@ function admin_externalpage_print_header($adminroot) {
blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
BLOCK_L_MAX_WIDTH);
$PAGE->print_header();
+ echo "\n".'<!-- admin_externalpage_print_header start-->'."\n";
echo '<table id="layout-table" summary=""><tr>';
+
+ $lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable;
+ foreach ($lt as $column) {
+ $lt1[] = $column;
+ if ($column == 'middle') break;
+ }
+ foreach ($lt1 as $column) {
+ switch ($column) {
+ case 'left':
echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
if (!empty($THEME->roundcorners)) {
echo '<div class="bt"><div></div></div>';
@@ -2672,46 +2682,103 @@ function admin_externalpage_print_header($adminroot) {
echo '<div class="bb"><div></div></div>';
}
echo '</td>';
+ break;
+
+ case 'middle':
echo '<td id="middle-column">';
if (!empty($THEME->roundcorners)) {
- echo '<div class="bt"><div></div></div>';
+ echo '<div class="bt"><div>.</div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
+ break;
+
+ case 'right':
+ if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
+ echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
+ if (!empty($THEME->roundcorners)) {
+ echo '<div class="bt"><div>.</div></div>';
+ echo '<div class="i1"><div class="i2"><div class="i3">';
+ }
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+ if (!empty($THEME->roundcorners)) {
+ echo '</div></div></div>';
+ echo '<div class="bb"><div>.</div></div>';
+ }
+ echo '</td>';
+ }
+ break;
+ }
+ }
} else {
print_header();
}
+ echo "\n".'<!-- admin_externalpage_print_header end-->'."\n";
}
function admin_externalpage_print_footer($adminroot) {
global $CFG, $PAGE, $SITE, $THEME;
-
+
+ echo "\n".'<!-- admin_externalpage_print_footer start-->'."\n";
if (!empty($SITE->fullname)) {
$pageblocks = blocks_setup($PAGE);
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH,
blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
BLOCK_R_MAX_WIDTH);
+
+ $lt = (empty($THEME->layouttable)) ? array('left', 'middle', 'right') : $THEME->layouttable;
+ foreach ($lt as $column) {
+ if ($column != 'middle') {
+ array_shift($lt);
+ } else if ($column == 'middle') {
+ break;
+ }
+ }
+ foreach ($lt as $column) {
+ switch ($column) {
+ case 'left':
+ echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
+ if (!empty($THEME->roundcorners)) {
+ echo '<div class="bt"><div></div></div>';
+ echo '<div class="i1"><div class="i2"><div class="i3">';
+ }
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
echo '<div class="bb"><div></div></div>';
}
echo '</td>';
+ break;
+
+ case 'middle':
+ if (!empty($THEME->roundcorners)) {
+ echo '</div></div></div>';
+ echo '<div class="bb"><div>.</div></div>';
+ }
+ echo '</td>';
+ break;
+
+ case 'right':
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
if (!empty($THEME->roundcorners)) {
- echo '<div class="bt"><div></div></div>';
+ echo '<div class="bt"><div>.</div></div>';
echo '<div class="i1"><div class="i2"><div class="i3">';
}
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
if (!empty($THEME->roundcorners)) {
echo '</div></div></div>';
- echo '<div class="bb"><div></div></div>';
+ echo '<div class="bb"><div>.</div></div>';
}
echo '</td>';
}
+ break;
+ }
+ }
echo '</tr></table>';
}
print_footer();
+ echo "\n".'<!-- admin_externalpage_print_footer end-->'."\n";
}
function admin_get_root() {

0 comments on commit 9ffa619

Please sign in to comment.