src/UI/Output.php
function bodyStart($checkpost=true) {
        global $CFG;
        ob_start();
        // If we are in an iframe use different margins
?>
</head>
<body prefix="oer: http://oerschema.org">
<div id="body_container">
<script>
if (window!=window.top) {
    document.getElementById("body_container").className = "container_iframe";
} else {
    document.getElementById("body_container").className = "container";
}
</script>
<?php
        if ( $checkpost && count($_POST) > 0 ) {
            $dump = self::safe_var_dump($_POST);
            echo('<p style="color:red">Error - Unhandled POST request</p>');
            echo("\n<pre>\n");
            echo($dump);
            if ( count($_FILES) > 0 ) {
                $files = self::safe_var_dump($_FILES);
                echo($files);
            }
            echo("\n</pre>\n");
            error_log($dump);
            die_with_error_log("Unhandled POST request");
        }

        // Complain if this is a test key
        $key_key = $this->ltiParameter('key_key');
        if ( $key_key == '12345' &&
            strpos($CFG->wwwroot, '://localhost') === false ) {
            echo('<div style="background-color: orange; position: absolute; bottom: 5px; left: 5px;">');
            echo(_m('Test Key - Do not use for production'));
            echo('</div>');
        }

        $HEAD_CONTENT_SENT = true;

        $ob_output = ob_get_contents();
        ob_end_clean();
        if ( $this->buffer ) return $ob_output;
        echo($ob_output);
    }
function bodyStart($checkpost=true) {
        global $CFG;
        ob_start();
        // If we are in an iframe use different margins
?>
</head>
<body prefix="oer: http://oerschema.org">
<div id="body_container">
<script>
if (window!=window.top) {
    document.getElementById("body_container").className = "container_iframe";
} else {
    document.getElementById("body_container").className = "container";
}
</script>
<?php
        if ( $checkpost && count($_POST) > 0 ) {
            $dump = self::safe_var_dump($_POST);
            echo('<p style="color:red">Error - Unhandled POST request</p>');
            echo("\n<pre>\n");
            echo($dump);
            if ( count($_FILES) > 0 ) {
                $files = self::safe_var_dump($_FILES);
                echo($files);
            }
            echo("\n</pre>\n");
            error_log($dump);
            die_with_error_log("Unhandled POST request");
        }

        // Complain if this is a test key
        $key_key = $this->ltiParameter('key_key');
        if ( $key_key == '12345' &&
            strpos($CFG->wwwroot, '://localhost') === false ) {
            echo('<div style="background-color: orange; position: absolute; bottom: 5px; left: 5px;">');
            echo(_m('Test Key - Do not use for production'));
            echo('</div>');
        }

        $HEAD_CONTENT_SENT = true;

        $ob_output = ob_get_contents();
        ob_end_clean();
        if ( $this->buffer ) return $ob_output;
        echo($ob_output);
    }
function bodyStart ( $ checkpost = true ) { global $ CFG ; ob_start ( ) ; // If we are in an iframe use different margins ?>
</head>
<body prefix="oer: http://oerschema.org">
<div id="body_container">
<script>
if (window!=window.top) {
    document.getElementById("body_container").className = "container_iframe";
} else {
    document.getElementById("body_container").className = "container";
}
</script>
<?php if ( $ checkpost && count ( $ _POST ) > 0 ) { $ dump = self :: safe_var_dump ( $ _POST ) ; echo ( '<p style="color:red">Error - Unhandled POST request</p>' ) ; echo ( "\n<pre>\n" ) ; echo ( $ dump ) ; if ( count ( $ _FILES ) > 0 ) { $ files = self :: safe_var_dump ( $ _FILES ) ; echo ( $ files ) ; } echo ( "\n</pre>\n" ) ; error_log ( $ dump ) ; die_with_error_log ( "Unhandled POST request" ) ; } // Complain if this is a test key $ key_key = $ this -> ltiParameter ( 'key_key' ) ; if ( $ key_key == '12345' && strpos ( $ CFG -> wwwroot , '://localhost' ) === false ) { echo ( '<div style="background-color: orange; position: absolute; bottom: 5px; left: 5px;">' ) ; echo ( _m ( 'Test Key - Do not use for production' ) ) ; echo ( '</div>' ) ; } $ HEAD_CONTENT_SENT = true ; $ ob_output = ob_get_contents ( ) ; ob_end_clean ( ) ; if ( $ this -> buffer ) return $ ob_output ; echo ( $ ob_output ) ; }
Finish the head and start the body of a Tsugi HTML page.

By default this demands that we are in a GET request.  It
is a fatal error to call this code if we are responding
to a POST request unless this behavior is overidden.

@param $checkpost (optional, boolean)  This can be set to
false to emit the body start even for a POST request.
Finish the head and start the body of a Tsugi HTML page .