includes/output.php
changeset 867 fc4e242995d4
parent 801 eb8b23f11744
child 1038 6a04793ae13c
--- 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('~</?enano:no-opt>~', '', $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('~</?enano:no-opt>~', '', $content);
+    }
+  }
+}
+
+/**
  * Outputter that bypasses $template->header() and $template->footer(), but still shows HTML added via {before,after}_{header,footer}.
  */