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 | |
0d6b9d4f |
27 | $edit = optional_param('edit', ''); |
28 | $blockaction = optional_param('blockaction'); |
29 | |
30 | $PAGE = page_create_instance($USER->id); |
31 | |
ee6055eb |
32 | $pageblocks = blocks_setup($PAGE,BLOCKS_PINNED_BOTH); |
0d6b9d4f |
33 | |
34 | if (!empty($edit) && $PAGE->user_allowed_editing()) { |
35 | if ($edit == 'on') { |
36 | $USER->editing = true; |
37 | } else if ($edit == 'off') { |
38 | $USER->editing = false; |
39 | } |
40 | } |
41 | |
fdaa6006 |
42 | $PAGE->print_header($mymoodlestr); |
0d6b9d4f |
43 | |
44 | echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">'; |
45 | echo '<tr valign="top">'; |
46 | |
47 | |
48 | $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 210); |
49 | |
50 | if(blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) { |
51 | echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="left-column">'; |
52 | blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); |
53 | echo '</td>'; |
54 | } |
55 | |
56 | echo '<td valign="top" width="*" id="middle-column">'; |
57 | include('overview.php'); |
58 | echo '</td>'; |
59 | |
60 | $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210); |
61 | |
62 | if(blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing()) { |
63 | echo '<td style="vertical-align: top; width: '.$blocks_preferred_width.'px;" id="right-column">'; |
64 | blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); |
65 | echo '</td>'; |
66 | } |
67 | |
68 | |
69 | /// Finish the page |
70 | echo '</tr></table>'; |
71 | |
72 | print_footer(); |
73 | |
74 | |
75 | |
76 | ?> |