moodle/my/index.php

60 lines
1.7 KiB
PHP

<?php
// this is the 'my moodle' page
require_once('../config.php');
require_once($CFG->libdir.'/blocklib.php');
require_once('pagelib.php');
require_login();
$edit = optional_param('edit', '');
$blockaction = optional_param('blockaction');
$PAGE = page_create_instance($USER->id);
$pageblocks = blocks_setup($PAGE,BLOCKS_PINNED_BOTH);
if (!empty($edit) && $PAGE->user_allowed_editing()) {
if ($edit == 'on') {
$USER->editing = true;
} else if ($edit == 'off') {
$USER->editing = false;
}
}
$PAGE->print_header(get_string('mymoodle','my'));
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
echo '<tr valign="top">';
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 210);
if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="left-column">';
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
echo '</td>';
}
echo '<td valign="top" width="*" id="middle-column">';
include('overview.php');
echo '</td>';
$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()) {
echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="right-column">';
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
echo '</td>';
}
/// Finish the page
echo '</tr></table>';
print_footer();
?>