| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Summary view] [Print] [Text view]
1 <?php // $Id: format.php,v 1.41.2.2 2007/11/23 16:41:19 skodak Exp $ 2 // format.php - course format featuring social forum 3 // included from view.php 4 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; 11 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); 16 17 $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 18 BLOCK_L_MAX_WIDTH); 19 $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 20 BLOCK_R_MAX_WIDTH); 21 22 $strgroups = get_string('groups'); 23 $strgroupmy = get_string('groupmy'); 24 $editing = $PAGE->user_is_editing(); 25 26 echo '<table id="layout-table" cellspacing="0" summary="'.get_string('layouttable').'">'; 27 echo '<tr>'; 28 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(); 34 echo '</td>'; 35 } 36 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')); 42 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); 47 48 } else { 49 notify('Could not find or create a social forum here'); 50 } 51 print_container_end(); 52 echo '</td>'; 53 54 // The right column 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(); 60 echo '</td>'; 61 } 62 63 echo '</tr>'; 64 echo '</table>'; 65 66 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |