2005-01-18 11:11:26 +00:00
|
|
|
<?php // $Id$
|
|
|
|
// format.php - course format featuring social forum
|
|
|
|
// included from view.php
|
2004-04-18 23:20:53 +00:00
|
|
|
|
2007-05-09 15:03:01 +00:00
|
|
|
if (!empty($THEME->customcorners)) {
|
|
|
|
require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
|
|
|
|
}
|
|
|
|
|
2007-01-28 17:11:05 +00:00
|
|
|
// Bounds for block widths
|
|
|
|
// more flexible for theme designers taken from theme config.php
|
|
|
|
$lmin = (empty($THEME->block_l_min_width)) ? 100 : $THEME->block_l_min_width;
|
|
|
|
$lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
|
|
|
|
$rmin = (empty($THEME->block_r_min_width)) ? 100 : $THEME->block_r_min_width;
|
|
|
|
$rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
|
|
|
|
|
|
|
|
define('BLOCK_L_MIN_WIDTH', $lmin);
|
|
|
|
define('BLOCK_L_MAX_WIDTH', $lmax);
|
|
|
|
define('BLOCK_R_MIN_WIDTH', $rmin);
|
|
|
|
define('BLOCK_R_MAX_WIDTH', $rmax);
|
|
|
|
|
2005-10-29 16:36:15 +00:00
|
|
|
$preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
|
|
|
|
BLOCK_L_MAX_WIDTH);
|
|
|
|
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
|
|
|
|
BLOCK_R_MAX_WIDTH);
|
2002-02-26 06:33:48 +00:00
|
|
|
|
2005-02-12 13:09:18 +00:00
|
|
|
$strgroups = get_string('groups');
|
|
|
|
$strgroupmy = get_string('groupmy');
|
|
|
|
$editing = $PAGE->user_is_editing();
|
2004-04-18 23:20:53 +00:00
|
|
|
|
2007-01-23 08:28:55 +00:00
|
|
|
echo '<table id="layout-table" cellspacing="0" summary="'.get_string('layouttable').'">';
|
2004-04-18 23:20:53 +00:00
|
|
|
echo '<tr>';
|
|
|
|
|
2005-03-08 17:32:08 +00:00
|
|
|
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
|
2007-01-04 15:52:11 +00:00
|
|
|
echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
|
2007-05-09 15:03:01 +00:00
|
|
|
if (!empty($THEME->customcorners)) print_custom_corners_start();
|
2005-03-02 05:47:39 +00:00
|
|
|
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
|
2007-05-09 15:03:01 +00:00
|
|
|
if (!empty($THEME->customcorners)) print_custom_corners_end();
|
2004-04-18 23:20:53 +00:00
|
|
|
echo '</td>';
|
|
|
|
}
|
|
|
|
|
2007-05-09 15:03:01 +00:00
|
|
|
echo '<td id="middle-column">';
|
|
|
|
if (!empty($THEME->customcorners)) print_custom_corners_start();
|
|
|
|
echo '<a name="startofcontent"></a>';
|
2005-03-08 17:32:08 +00:00
|
|
|
if ($forum = forum_get_course_forum($course->id, 'social')) {
|
2007-01-05 16:40:04 +00:00
|
|
|
print_heading_block(get_string('socialheadline'));
|
2007-07-24 17:06:29 +00:00
|
|
|
$context = get_context_instance(CONTEXT_MODULE, get_coursemodule_from_instance('forum', $forum->id));
|
|
|
|
echo '<div class="subscribelink">', forum_get_subscribe_link($forum, $context), '</div>';
|
2005-03-08 17:32:08 +00:00
|
|
|
forum_print_latest_discussions($course, $forum, 10, 'plain', '', false);
|
2004-04-18 23:20:53 +00:00
|
|
|
|
|
|
|
} else {
|
2005-03-08 17:32:08 +00:00
|
|
|
notify('Could not find or create a social forum here');
|
2004-04-18 23:20:53 +00:00
|
|
|
}
|
2007-05-09 15:03:01 +00:00
|
|
|
if (!empty($THEME->customcorners)) print_custom_corners_end();
|
2004-04-18 23:20:53 +00:00
|
|
|
echo '</td>';
|
|
|
|
|
2004-10-19 21:04:28 +00:00
|
|
|
// The right column
|
2005-03-08 17:32:08 +00:00
|
|
|
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
|
2007-01-04 15:52:11 +00:00
|
|
|
echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
|
2007-05-09 15:03:01 +00:00
|
|
|
if (!empty($THEME->customcorners)) print_custom_corners_start();
|
2005-03-02 05:47:39 +00:00
|
|
|
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
|
2007-05-09 15:03:01 +00:00
|
|
|
if (!empty($THEME->customcorners)) print_custom_corners_end();
|
2004-10-19 21:04:28 +00:00
|
|
|
echo '</td>';
|
2004-04-18 23:20:53 +00:00
|
|
|
}
|
2002-05-31 09:34:50 +00:00
|
|
|
|
2004-04-18 23:20:53 +00:00
|
|
|
echo '</tr>';
|
|
|
|
echo '</table>';
|
2002-11-07 09:30:41 +00:00
|
|
|
|
2004-04-18 23:20:53 +00:00
|
|
|
?>
|