With appropriate error reporting, adding a label to a section of a course results...
[moodle.git] / my / index.php
CommitLineData
0d6b9d4f 1<?php
2
3 // this is the 'my moodle' page
4
5 require_once('../config.php');
6 require_once($CFG->libdir.'/blocklib.php');
7 require_once('pagelib.php');
8
9 require_login();
10
fdaa6006 11 $mymoodlestr = get_string('mymoodle','my');
12
13 if (isguest()) {
14 $wwwroot = $CFG->wwwroot.'/login/index.php';
15 if (!empty($CFG->loginhttps)) {
16 $wwwroot = str_replace('http','https', $wwwroot);
17 }
18
19 print_header($mymoodlestr);
20 notice_yesno(get_string('noguest', 'my').'<br /><br />'.get_string('liketologin'),
092dcfa4 21 $wwwroot, $CFG->wwwroot);
fdaa6006 22 print_footer();
23 die();
24 }
25
26
d2b23346 27 $edit = optional_param('edit', -1, PARAM_BOOL);
28 $blockaction = optional_param('blockaction', '', PARAM_ALPHA);
0d6b9d4f 29
30 $PAGE = page_create_instance($USER->id);
31
ee6055eb 32 $pageblocks = blocks_setup($PAGE,BLOCKS_PINNED_BOTH);
0d6b9d4f 33
d2b23346 34 if (($edit != -1) and $PAGE->user_allowed_editing()) {
35 $USER->editing = $edit;
0d6b9d4f 36 }
37
fdaa6006 38 $PAGE->print_header($mymoodlestr);
0d6b9d4f 39
40 echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
41 echo '<tr valign="top">';
42
43
44 $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 210);
45
46 if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
47 echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="left-column">';
48 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
49 echo '</td>';
50 }
51
52 echo '<td valign="top" width="*" id="middle-column">';
53 include('overview.php');
54 echo '</td>';
55
56 $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
57
58 if(blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing()) {
59 echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="right-column">';
60 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
61 echo '</td>';
62 }
63
64
65 /// Finish the page
66 echo '</tr></table>';
67
68 print_footer();
69
70
71
72?>