dirroot.'/mod/forum/lib.php'); require_once($CFG->libdir.'/ajax/ajaxlib.php'); $topic = optional_param('topic', -1, PARAM_INT); // 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); $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); if ($topic != -1) { $displaysection = course_set_display($course->id, $topic); } else { if (isset($USER->display[$course->id])) { // for admins, mostly $displaysection = $USER->display[$course->id]; } else { $displaysection = course_set_display($course->id, 0); } } $context = get_context_instance(CONTEXT_COURSE, $course->id); if (($marker >=0) && has_capability('moodle/course:setcurrentsection', $context) && confirm_sesskey()) { $course->marker = $marker; if (! set_field("course", "marker", $marker, "id", $course->id)) { error("Could not mark that topic for this course"); } } $streditsummary = get_string('editsummary'); $stradd = get_string('add'); $stractivities = get_string('activities'); $strshowalltopics = get_string('showalltopics'); $strtopic = get_string('topic'); $strgroups = get_string('groups'); $strgroupmy = get_string('groupmy'); $editing = $PAGE->user_is_editing(); if ($editing) { $strstudents = moodle_strtolower($course->students); $strtopichide = get_string('topichide', '', $strstudents); $strtopicshow = get_string('topicshow', '', $strstudents); $strmarkthistopic = get_string('markthistopic'); $strmarkedthistopic = get_string('markedthistopic'); $strmoveup = get_string('moveup'); $strmovedown = get_string('movedown'); } /// Layout the whole page as three big columns. echo '
| ';
if (!empty($THEME->roundcorners)) {
echo ' ';
echo ' ';
}
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
if (!empty($THEME->roundcorners)) {
echo ' ';
}
echo ' | ';
}
break;
case 'middle':
/// Start main column
echo '';
if (!empty($THEME->roundcorners)) {
echo ' ';
echo ' ';
}
echo '';
print_heading_block(get_string('topicoutline'), 'outline');
echo '
';
}
echo ' | ';
break;
case 'right':
// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
echo '';
if (!empty($THEME->roundcorners)) {
echo ' ';
echo ' ';
}
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
if (!empty($THEME->roundcorners)) {
echo ' ';
}
echo ' | ';
}
break;
}
}
echo '|||||||||||||||