-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
62 lines (53 loc) · 1.37 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
<?php
/**
* Author: Ghost
* Date: 6/19/13
*/
session_start();
define("BASEDIR", __DIR__ . "/");
require_once(BASEDIR . "/include/script/Autoloader.php");
require_once(BASEDIR . "/include/script/IOCRegistration.php");
Utility_IOC::build("TanguerApp");
/**
* JSON requests come in with $_GET['j'] == 1
*/
if(isset($_REQUEST['j']) && $_REQUEST['j'] == 1){
if(!isset($_REQUEST['t'])){
TanguerApp::jsonError();
}
require(BASEDIR . "/include/script/jsonRequestHandler.php");
die();
}
/**
* Non-JSON requests are processed if the requester is not requesting a JSON response
*/
?>
<!DOCTYPE html>
<html lang="en" class="<?php echo Utility_Constants::APP_GUI_MODE == "dev" ? "devMode" : "";?>">
<?php echo TanguerApp::head(); ?>
<body>
<?php
echo TanguerApp::alertsToHTML();
echo TanguerApp::printHeader();
echo TanguerApp::loadView();
echo TanguerApp::modalsToHTML();
?>
<div id="debug"></div>
</body>
</html>
<?php
//TODO: Move this??
/**
* Useful Usort for sorting a list of events by their start times
* @param Event_Event $a
* @param Event_Event $b
* @return int
*/
function sortByStartTime(Event_Event $a,Event_Event $b){
$aStart = $a->getDateStart();
$bStart = $b->getDateStart();
if($aStart == $bStart){
return 0;
}
return ($aStart < $bStart) ? -1 : 1;
}