# HG changeset patch # User Dan # Date 1237129742 14400 # Node ID fc4e242995d4e5dd502286bc23deaecb2dc462c0 # Parent 0a691138a1e50d50619fce54701758e8ed3b6027 Moved gzip and aggressive_optimize_html calls to output.php diff -r 0a691138a1e5 -r fc4e242995d4 includes/output.php --- a/includes/output.php Sun Mar 15 11:08:07 2009 -0400 +++ b/includes/output.php Sun Mar 15 11:09:02 2009 -0400 @@ -163,6 +163,24 @@ echo $template->getFooter(); echo $this->after_footer; + global $aggressive_optimize_html; + if ( $aggressive_optimize_html ) + { + $content = ob_get_contents(); + ob_end_clean(); + + ob_start(); + echo aggressive_optimize_html($content); + } + else + { + $content = ob_get_contents(); + ob_end_clean(); + + ob_start(); + echo preg_replace('~~', '', $content); + } + } public function set_title($title) @@ -175,6 +193,51 @@ } /** + * Same as HTML, except uses simple-header and simple-footer. + */ + +class Output_HTML_Simple extends Output_HTML +{ + public function footer() + { + global $template; + if ( !$this->headers_sent ) + return; + + $this->headers_sent = false; + $content = ob_get_contents(); + ob_end_clean(); + + ob_start(); + echo $this->before_header; + echo $template->getHeader(true); + echo $this->after_header; + echo $content; + echo $this->before_footer; + echo $template->getFooter(true); + echo $this->after_footer; + + global $aggressive_optimize_html; + if ( $aggressive_optimize_html ) + { + $content = ob_get_contents(); + ob_end_clean(); + + ob_start(); + echo aggressive_optimize_html($content); + } + else + { + $content = ob_get_contents(); + ob_end_clean(); + + ob_start(); + echo preg_replace('~~', '', $content); + } + } +} + +/** * Outputter that bypasses $template->header() and $template->footer(), but still shows HTML added via {before,after}_{header,footer}. */ diff -r 0a691138a1e5 -r fc4e242995d4 index.php --- a/index.php Sun Mar 15 11:08:07 2009 -0400 +++ b/index.php Sun Mar 15 11:09:02 2009 -0400 @@ -575,40 +575,24 @@ break; } - // - // Optimize HTML by replacing newlines with spaces (excludes
,