includes/namespaces/template.php
changeset 800 9cdfe82c56cd
child 801 eb8b23f11744
equal deleted inserted replaced
799:4629ad98ee88 800:9cdfe82c56cd
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between
       
     5  * Version 1.1.5 (Caoineag alpha 5)
       
     6  * Copyright (C) 2006-2008 Dan Fuhry
       
     7  *
       
     8  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
       
     9  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
       
    10  *
       
    11  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
       
    12  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
       
    13  */
       
    14 
       
    15 class Namespace_Template extends Namespace_Default
       
    16 {
       
    17   function send()
       
    18   {
       
    19     global $output;
       
    20     
       
    21     $output->add_before_footer($this->display_categories());
       
    22     $output->header();
       
    23     
       
    24     if ( $this->exists )
       
    25     {
       
    26       $text = $this->fetch_text();
       
    27       $text = preg_replace('/<noinclude>(.*?)<\/noinclude>/is', '\\1', $text);
       
    28       $text = preg_replace('/<nodisplay>(.*?)<\/nodisplay>/is', '', $text);
       
    29       
       
    30       $text = RenderMan::render( $text );
       
    31       
       
    32       eval( '?>' . $text );
       
    33     }
       
    34     else
       
    35     {
       
    36       $this->error_404();
       
    37     }
       
    38     
       
    39     $output->footer();
       
    40   }
       
    41 }