includes/pageprocess.php
changeset 9 1e61232606d6
parent 4 0b3a0aedfd53
child 15 ad5986a53197
--- a/includes/pageprocess.php	Wed Jun 13 19:53:18 2007 -0400
+++ b/includes/pageprocess.php	Sat Jun 16 18:47:06 2007 -0400
@@ -148,20 +148,6 @@
         return false;
       }
     }
-    else if ( in_array($this->namespace, array('Article', 'User', 'Project', 'Help', 'File', 'Category')) && $this->page_exists )
-    {
-      // Send as regular page
-      $text = $this->fetch_text();
-      if ( $text == 'err_no_text_rows' )
-      {
-        $this->err_no_rows();
-        return false;
-      }
-      else
-      {
-        $this->render();
-      }
-    }
     else if ( ( $this->namespace == 'Template' || $this->namespace == 'System' ) && $this->page_exists )
     {
       $this->header();
@@ -195,6 +181,20 @@
         $this->err_page_not_existent();
       }
     }
+    else // if ( in_array($this->namespace, array('Article', 'User', 'Project', 'Help', 'File', 'Category')) && $this->page_exists )
+    {
+      // Send as regular page
+      $text = $this->fetch_text();
+      if ( $text == 'err_no_text_rows' )
+      {
+        $this->err_no_rows();
+        return false;
+      }
+      else
+      {
+        $this->render();
+      }
+    }
     
     
   }
@@ -246,9 +246,20 @@
     $text = $this->fetch_text();
     
     $this->header();
-    display_page_headers();
-    echo RenderMan::render($text);
-    display_page_footers();
+    if ( $this->send_headers )
+    {
+      display_page_headers();
+    }
+    
+    $text = '?>' . RenderMan::render($text);
+    // echo('<pre>'.htmlspecialchars($text).'</pre>');
+    eval ( $text );
+    
+    if ( $this->send_headers )
+    {
+      display_page_footers();
+    }
+    
     $this->footer();
   }