forked from GibbonEdu/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fullscreen.php
executable file
·162 lines (148 loc) · 6.25 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?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
try {
$connection2=new PDO("mysql:host=$databaseServer;dbname=$databaseName;charset=utf8", $databaseUsername, $databasePassword);
$connection2->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$connection2->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
}
catch(PDOException $e) {
echo $e->getMessage();
}
@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) {
print _("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 print $_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 up for i18n via gettext
if ($_SESSION[$guid]["i18n"]["code"]!=NULL) {
putenv("LC_ALL=" . $_SESSION[$guid]["i18n"]["code"]);
setlocale(LC_ALL, $_SESSION[$guid]["i18n"]["code"]);
bindtextdomain("gibbon", "./i18n");
textdomain("gibbon");
}
//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) {
print "<div class='error'>" ;
print $e->getMessage();
print "</div>" ;
}
print $themeCSS ;
print $themeJS ;
//Set module CSS & JS
$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>" ;
print $moduleCSS ;
print $moduleJS ;
//Set timezone from session variable
date_default_timezone_set($_SESSION[$guid]["timezone"]);
?>
<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 print $_SESSION[$guid]["absoluteURL"] ?>/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="<?php print $_SESSION[$guid]["absoluteURL"] ?>/lib/jquery-ui/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="<?php print $_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 print $_SESSION[$guid]["absoluteURL"] ?>/lib/jquery-ui/css/blitzer/jquery-ui.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php print $_SESSION[$guid]["absoluteURL"] ?>/lib/chained/jquery.chained.mini.js"></script>
<?php
if ($_SESSION[$guid]["analytics"]!="") {
print $_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"]=="") {
print "<h1>" ;
print _("There is no content to display") ;
print "</h1>" ;
}
else {
if (strstr($_SESSION[$guid]["address"],"..")!=FALSE) {
print "<div class='error'>" ;
print _("Illegal address detected: access denied.") ;
print "</div>" ;
}
else {
if(is_file("./" . $_SESSION[$guid]["address"])) {
include ("./" . $_SESSION[$guid]["address"]) ;
}
else {
include "./error.php" ;
}
}
}
?>
</body>
</html>
<?php
}
?>