Menu

[r30]: / e9-core / codepage.class.php  Maximize  Restore  History

Download this file

40 lines (29 with data), 804 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?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" );
}
};
?>