2 // format.php - course format featuring social forum
3 // included from view.php
5 if (!empty($THEME->customcorners
)) {
6 require_once($CFG->dirroot
.'/lib/custom_corners_lib.php');
9 // Bounds for block widths
10 // more flexible for theme designers taken from theme config.php
11 $lmin = (empty($THEME->block_l_min_width
)) ?
100 : $THEME->block_l_min_width
;
12 $lmax = (empty($THEME->block_l_max_width
)) ?
210 : $THEME->block_l_max_width
;
13 $rmin = (empty($THEME->block_r_min_width
)) ?
100 : $THEME->block_r_min_width
;
14 $rmax = (empty($THEME->block_r_max_width
)) ?
210 : $THEME->block_r_max_width
;
16 define('BLOCK_L_MIN_WIDTH', $lmin);
17 define('BLOCK_L_MAX_WIDTH', $lmax);
18 define('BLOCK_R_MIN_WIDTH', $rmin);
19 define('BLOCK_R_MAX_WIDTH', $rmax);
21 $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH
, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT
]),
23 $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH
, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT
]),
26 $strgroups = get_string('groups');
27 $strgroupmy = get_string('groupmy');
28 $editing = $PAGE->user_is_editing();
30 echo '<table id="layout-table" cellspacing="0" summary="'.get_string('layouttable').'">';
33 if (blocks_have_content($pageblocks, BLOCK_POS_LEFT
) ||
$editing) {
34 echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
35 if (!empty($THEME->customcorners
)) print_custom_corners_start();
36 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT
);
37 if (!empty($THEME->customcorners
)) print_custom_corners_end();
41 echo '<td id="middle-column">';
42 if (!empty($THEME->customcorners
)) print_custom_corners_start();
43 echo '<a name="startofcontent"></a>';
44 if ($forum = forum_get_course_forum($course->id
, 'social')) {
45 print_heading_block(get_string('socialheadline'));
46 $context = get_context_instance(CONTEXT_MODULE
, get_coursemodule_from_instance('forum', $forum->id
));
47 echo '<div class="subscribelink">', forum_get_subscribe_link($forum, $context), '</div>';
48 forum_print_latest_discussions($course, $forum, 10, 'plain', '', false);
51 notify('Could not find or create a social forum here');
53 if (!empty($THEME->customcorners
)) print_custom_corners_end();
57 if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT
) ||
$editing) {
58 echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
59 if (!empty($THEME->customcorners
)) print_custom_corners_start();
60 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT
);
61 if (!empty($THEME->customcorners
)) print_custom_corners_end();