forked from GibbonEdu/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fullscreen.php
executable file
·145 lines (132 loc) · 6.2 KB
/
fullscreen.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/*
Gibbon, Flexible & Open School System
Copyright (C) 2010, Ross Parker
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//Gibbon system-wide includes
include './functions.php';
include './config.php';
include './version.php';
//New PDO DB connection
$pdo = new Gibbon\sqlConnection();
$connection2 = $pdo->getConnection();
@session_start();
$_SESSION[$guid]['sidebarExtra'] = '';
//Check to see if system settings are set from databases
if ($_SESSION[$guid]['systemSettingsSet'] == false) {
getSystemSettings($guid, $connection2);
}
//If still false, show warning, otherwise display page
if ($_SESSION[$guid]['systemSettingsSet'] == false) {
echo __($guid, 'System Settings are not set: the system cannot be displayed');
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo $_SESSION[$guid]['organisationNameShort'].' - '.$_SESSION[$guid]['systemName'] ?></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="content-language" content="en"/>
<meta name="author" content="Ross Parker, International College Hong Kong"/>
<meta name="robots" content="none"/>
<?php
//Set theme
$themeCSS = "<link rel='stylesheet' type='text/css' href='./themes/Default/css/main.css' />";
if ($_SESSION[$guid]['i18n']['rtl'] == 'Y') {
$themeCSS .= "<link rel='stylesheet' type='text/css' href='./themes/Default/css/main_rtl.css' />";
}
$themeJS = "<script type='text/javascript' src='./themes/Default/js/common.js'></script>";
$_SESSION[$guid]['gibbonThemeID'] = '001';
$_SESSION[$guid]['gibbonThemeName'] = 'Default';
try {
if (@$_SESSION[$guid]['gibbonThemeIDPersonal'] != null) {
$dataTheme = array('gibbonThemeIDPersonal' => $_SESSION[$guid]['gibbonThemeIDPersonal']);
$sqlTheme = 'SELECT * FROM gibbonTheme WHERE gibbonThemeID=:gibbonThemeIDPersonal';
} else {
$dataTheme = array();
$sqlTheme = "SELECT * FROM gibbonTheme WHERE active='Y'";
}
$resultTheme = $connection2->prepare($sqlTheme);
$resultTheme->execute($dataTheme);
if (count($resultTheme) == 1) {
$rowTheme = $resultTheme->fetch();
$themeCSS = "<link rel='stylesheet' type='text/css' href='./themes/".$rowTheme['name']."/css/main.css' />";
if ($_SESSION[$guid]['i18n']['rtl'] == 'Y') {
$themeCSS .= "<link rel='stylesheet' type='text/css' href='./themes/".$rowTheme['name']."/css/main_rtl.css' />";
}
$themeCJS = "<script type='text/javascript' src='./themes/".$rowTheme['name']."/js/common.js'></script>";
$_SESSION[$guid]['gibbonThemeID'] = $rowTheme['gibbonThemeID'];
$_SESSION[$guid]['gibbonThemeName'] = $rowTheme['name'];
}
} catch (PDOException $e) {
echo "<div class='error'>";
echo $e->getMessage();
echo '</div>';
}
echo $themeCSS;
echo $themeJS;
//Set module CSS & JS
if (isset($_GET['q'])) {
if ($_GET['q'] != '') {
$moduleCSS = "<link rel='stylesheet' type='text/css' href='./modules/".$_SESSION[$guid]['module']."/css/module.css' />";
$moduleJS = "<script type='text/javascript' src='./modules/".$_SESSION[$guid]['module']."/js/module.js'></script>";
echo $moduleCSS;
echo $moduleJS;
}
}
?>
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico"/>
<script type="text/javascript" src="./lib/LiveValidation/livevalidation_standalone.compressed.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION[$guid]['absoluteURL'] ?>/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION[$guid]['absoluteURL'] ?>/lib/jquery/jquery-migrate.min.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION[$guid]['absoluteURL'] ?>/lib/jquery-ui/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION[$guid]['absoluteURL'] ?>/lib/jquery-ui/i18n/jquery.ui.datepicker-en-GB.js"></script>
<script type="text/javascript">
$.datepicker.setDefaults($.datepicker.regional['en-GB']);
</script>
<link rel="stylesheet" href="<?php echo $_SESSION[$guid]['absoluteURL'] ?>/lib/jquery-ui/css/blitzer/jquery-ui.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo $_SESSION[$guid]['absoluteURL'] ?>/lib/chained/jquery.chained.min.js"></script>
<?php
if ($_SESSION[$guid]['analytics'] != '') {
echo $_SESSION[$guid]['analytics'];
}
?>
</head>
<body style='background-image: none'>
<?php
$_SESSION[$guid]['address'] = $_GET['q'];
$_SESSION[$guid]['module'] = getModuleName($_SESSION[$guid]['address']);
$_SESSION[$guid]['action'] = getActionName($_SESSION[$guid]['address']);
if ($_SESSION[$guid]['address'] == '') {
echo '<h1>';
echo __($guid, 'There is no content to display');
echo '</h1>';
} else {
if (strstr($_SESSION[$guid]['address'], '..') != false) {
echo "<div class='error'>";
echo __($guid, 'Illegal address detected: access denied.');
echo '</div>';
} else {
if (is_file('./'.$_SESSION[$guid]['address'])) {
include './'.$_SESSION[$guid]['address'];
} else {
include './error.php';
}
}
}
?>
</body>
</html>
<?php
}
?>