2 // format.php - course format featuring social forum
3 // included from view.php
5 // Bounds for block widths
6 // more flexible for theme designers taken from theme config.php
7 $lmin = (empty($THEME->block_l_min_width
)) ?
100 : $THEME->block_l_min_width
;
8 $lmax = (empty($THEME->block_l_max_width
)) ?
210 : $THEME->block_l_max_width
;
9 $rmin = (empty($THEME->block_r_min_width
)) ?
100 : $THEME->block_r_min_width
;
10 $rmax = (empty($THEME->block_r_max_width
)) ?
210 : $THEME->block_r_max_width
;
12 define('BLOCK_L_MIN_WIDTH', $lmin);
13 define('BLOCK_L_MAX_WIDTH', $lmax);
14 define('BLOCK_R_MIN_WIDTH', $rmin);
15 define('BLOCK_R_MAX_WIDTH', $rmax);
17 $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH
, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT
]),
19 $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH
, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT
]),
22 $strgroups = get_string('groups');
23 $strgroupmy = get_string('groupmy');
24 $editing = $PAGE->user_is_editing();
26 echo '<table id="layout-table" cellspacing="0" summary="'.get_string('layouttable').'">';
29 if (blocks_have_content($pageblocks, BLOCK_POS_LEFT
) ||
$editing) {
30 echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
31 print_container_start();
32 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT
);
33 print_container_end();
37 echo '<td id="middle-column">';
38 print_container_start();
39 echo skip_main_destination();
40 if ($forum = forum_get_course_forum($course->id
, 'social')) {
41 print_heading_block(get_string('socialheadline'));
43 $cm = get_coursemodule_from_instance('forum', $forum->id
);
44 $context = get_context_instance(CONTEXT_MODULE
, $cm->id
);
45 echo '<div class="subscribelink">', forum_get_subscribe_link($forum, $context), '</div>';
46 forum_print_latest_discussions($course, $forum, 10, 'plain', '', false);
49 notify('Could not find or create a social forum here');
51 print_container_end();
55 if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT
) ||
$editing) {
56 echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
57 print_container_start();
58 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT
);
59 print_container_end();