2 // format.php - course format featuring single activity
3 // included from view.php
5 $module = $course->format
;
6 require_once($CFG->dirroot
.'/mod/'.$module.'/locallib.php');
8 // Bounds for block widths
9 // more flexible for theme designers taken from theme config.php
10 $lmin = (empty($THEME->block_l_min_width
)) ?
100 : $THEME->block_l_min_width
;
11 $lmax = (empty($THEME->block_l_max_width
)) ?
210 : $THEME->block_l_max_width
;
12 $rmin = (empty($THEME->block_r_min_width
)) ?
100 : $THEME->block_r_min_width
;
13 $rmax = (empty($THEME->block_r_max_width
)) ?
210 : $THEME->block_r_max_width
;
15 define('BLOCK_L_MIN_WIDTH', $lmin);
16 define('BLOCK_L_MAX_WIDTH', $lmax);
17 define('BLOCK_R_MIN_WIDTH', $rmin);
18 define('BLOCK_R_MAX_WIDTH', $rmax);
20 $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH
, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT
]),
22 $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH
, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT
]),
25 $strgroups = get_string('groups');
26 $strgroupmy = get_string('groupmy');
27 $editing = $PAGE->user_is_editing();
29 echo '<table id="layout-table" cellspacing="0" summary="'.get_string('layouttable').'">';
32 if (blocks_have_content($pageblocks, BLOCK_POS_LEFT
) ||
$editing) {
33 echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
34 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT
);
38 echo '<td id="middle-column"><a name="startofcontent"></a>';
39 $moduleformat = $module.'_course_format_display';
40 if (function_exists($moduleformat)) {
41 $moduleformat($USER,$course);
43 notify('The module '. $module. ' does not support single activity course format');
48 if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT
) ||
$editing) {
49 echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
50 blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT
);