/**
  * Outputs the current page with the buffer data
  * @param string $strBuffer Buffer data
  *
  * @return string
  */
 public static function OutputPage($strBuffer)
 {
     // If the ProcessOutput flag is set to false, simply return the buffer
     // without processing anything.
     if (!QApplication::$ProcessOutput) {
         return $strBuffer;
     }
     if (QApplication::$ErrorFlag) {
         return $strBuffer;
     } else {
         if (QApplication::$RequestMode == QRequestMode::Ajax) {
             return trim($strBuffer);
         } else {
             // Update Cache-Control setting
             header('Cache-Control: ' . QApplication::$CacheControl);
             // make sure the server does not override the character encoding value by explicitly sending it out as a header.
             // some servers will use an internal default if not specified in the header, and that will override the "encoding" value sent in the text.
             header(sprintf('Content-Type: %s; charset=%s', strtolower(QApplication::$ContentType), strtolower(QApplication::$EncodingType)));
             /*
              * Normally, FormBase->RenderEnd will render the javascripts. In the unusual case
              * of not rendering with a QForm object, this will still output embedded javascript commands.
              */
             $strScript = QApplicationBase::RenderJavascript();
             if ($strScript) {
                 return $strBuffer . '<script type="text/javascript">' . $strScript . '</script>';
             }
             return $strBuffer;
         }
     }
 }