-
Notifications
You must be signed in to change notification settings - Fork 61
/
index.php
executable file
·90 lines (68 loc) · 2.08 KB
/
index.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
/**
* Trellis Desk
*
* @version 2.0
* @copyright Copyright (C) 2009-2012 ACCORD5. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
*/
define( 'IN_TD', true );
#=============================
# Lets Play Nice With Output
#=============================
ob_start();
ob_end_clean();
#=============================
# Safe and Secure
#=============================
if ( function_exists('date_default_timezone_get') )
{
date_default_timezone_set( date_default_timezone_get() );
}
ini_set( 'register_globals', 0 );
if ( @ini_get( 'register_globals' ) )
{
foreach ( $_REQUEST as $key => $value )
{
unset( $$key );
}
}
#=============================
# Define Our Paths
#=============================
define( "TD_PATH", str_replace( '//', '/', dirname(__FILE__).'/' ) );
define( 'TD_INC', TD_PATH ."includes/" );
define( 'TD_CLASS', TD_PATH ."includes/classes/class_" );
define( 'TD_FUNC', TD_PATH ."includes/functions/func_" );
define( 'TD_SRC', TD_PATH ."sources/" );
define( 'TD_SKIN', TD_PATH ."skins/" ); # TODO: TD_LANG contstant?
#=============================
# Main Class
#=============================
require_once TD_INC ."trellis.php";
$trellis = new trellis();
$trellis->initialize();
#=============================
# Other Junk
#=============================
$choice = array(
'kb' => 'knowledgebase',
'account' => 'account',
'feed' => 'feed',
'dashboard' => 'dashboard',
'pages' => 'pages',
'news' => 'news',
'register' => 'register',
'tickets' => 'tickets',
);
#=============================
# Require & Run
#=============================
$required = $choice[ $trellis->input['page'] ];
if ( ! isset( $required ) ) $required = 'dashboard';
require_once TD_SRC . $required .".php";
$required_class = 'td_source_'. $required;
$run = new $required_class();
$run->trellis =& $trellis;
$run->auto_run();
?>