diff -urN moodle/lib/blocklib.php moodle+print/lib/blocklib.php --- moodle/lib/blocklib.php 2007-05-19 02:48:14.000000000 +0000 +++ moodle+print/lib/blocklib.php 2007-06-15 07:51:26.000000000 +0000 @@ -254,6 +254,10 @@ function blocks_print_group(&$page, &$pageblocks, $position) { global $COURSE; + // PETER + // Simply return if PRINT is set. That seems to prevent blocks from displaying. + if( isset( $_REQUEST['PRINT'] ) ) return; + if(empty($pageblocks[$position])) { $pageblocks[$position] = array(); $maxweight = 0; diff -urN moodle/lib/weblib.php moodle+print/lib/weblib.php --- moodle/lib/weblib.php 2007-05-24 02:59:48.000000000 +0000 +++ moodle+print/lib/weblib.php 2007-06-15 07:53:37.000000000 +0000 @@ -2720,6 +2720,11 @@ } $CFG->stylesheets[] = $CFG->themewww.'/'.$theme.'/styles.php'.$paramstring; + // PETER + // Pull in the stylesheet that hides some page elements, if PRINT is set. + if( isset( $_REQUEST['PRINT'] ) ) + $CFG->stylesheets[] = $CFG->themewww .'/print.css'; + /// We have to change some URLs in styles if we are in a $HTTPSPAGEREQUIRED page if (!empty($HTTPSPAGEREQUIRED)) { $CFG->themewww = str_replace('http:', 'https:', $CFG->themewww); @@ -2799,7 +2804,13 @@ $loggedinas = get_string('loggedinnot', 'moodle'). " (frametarget href=\"$wwwroot/login/index.php\">".get_string('login').')'; } - return '
'.$loggedinas.'
'; + // PETER + // Display a PRINT or NORMAL view link. + if( isset( $_REQUEST['PRINT'] ) ) + return '
'.$loggedinas.' | Normal View
'; + else + return '
'.$loggedinas.' | Print View
'; } /** diff -urN moodle/theme/print.css moodle+print/theme/print.css --- moodle/theme/print.css 1970-01-01 00:00:00.000000000 +0000 +++ moodle+print/theme/print.css 2007-06-15 07:54:17.000000000 +0000 @@ -0,0 +1,10 @@ +// Hide header (with image) +#header { display: none; } + +// Hide navigation malarkey. +.navbutton { display: none; } +.accesshide { display: none; } + +// Hide links down the bottom of the page. +.homelink { display: none; } +.helplink { display: none; }