<?php
class e_codepage extends e_page
{
function __construct( $request )
{
global $_dir, $_var;
// Default settings, can be overriden in e9-app/*.php
$this->set_template( 'canvas_master' );
$this->set_subtemplate( $request->get_node() );
$file = $_dir['app'] . $request->get_node() . '.php';
@include( $file );
// Ugly, I know
$this->set_subtemplate( $this->read_page( $this->get_subtemplate() ) );
}
function read_page( $str )
{
global $_dir;
$file = $_dir['theme'] . $str . '.html';
return file_get_contents( $file );
}
static function page_exists( $str )
{
global $_dir;
// Someday The God Of Performance will have me answer for all my sins
return file_exists( "{$_dir['theme']}{$str}.html" )
|| file_exists( "{$_dir['app']}{$str}.php" );
}
};
?>