forked from craig-russell/Log-Hog
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
349 lines (342 loc) · 12.4 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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<?php
require_once("core/php/class/core.php");
$core = new core();
require_once("core/php/class/errorCheck.php");
$errorCheck = new errorCheck();
require_once("core/php/class/session.php");
$session = new session();
if(!$session->startSession())
{
$core->echoErrorJavaScript("", "", 14);
}
$currentPage = "index.php";
$errorCheck->checkIfFilesExist(
array("core/conf/config.php","core/php/configStatic.php","core/php/loadVars.php","core/php/loadVarsToJs.php","core/php/updateCheck.php","core/js/jquery.js","core/php/customCSS.php","core/php/template/popup.php","core/js/main.js","setup/setupProcessFile.php","error.php"),
"",
$currentPage);
$errorCheck->checkIfFilesAreReadable(
array("core/conf/config.php","core/php/configStatic.php","core/php/loadVars.php","core/php/loadVarsToJs.php","core/php/updateCheck.php","core/js/jquery.js","core/php/customCSS.php","core/php/template/popup.php","core/js/main.js","setup/setupProcessFile.php","error.php"),
"",
$currentPage);
require_once("core/php/class/update.php");
$update = new update();
require_once("core/php/class/settings.php");
$settings = new settings();
$core->setCookieRedirect();
$currentSelectedTheme = $session->returnCurrentSelectedTheme();
$baseUrl = "local/".$currentSelectedTheme."/";
$varTemplateSrcModifier = "";
if(!file_exists($baseUrl.'conf/config.php'))
{
require_once("setup/setupProcessFile.php");
if($setupProcess !== "finished")
{
if($setupProcess === 'preStart')
{
$partOfUrl = $core->clean_url($_SERVER['REQUEST_URI']);
if(strpos($partOfUrl, "index.php") !== false)
{
$partOfUrl = str_replace("index.php", "", $partOfUrl);
}
$url = "http://" . $_SERVER['HTTP_HOST'] .$partOfUrl ."setup/welcome.php";
header('Location: ' . $url, true, 302);
exit();
}
}
}
require_once($baseUrl.'conf/config.php');
require_once('core/conf/config.php');
include('core/conf/globalConfig.php');
if(is_file('local/conf/globalConfig.php'))
{
include('local/conf/globalConfig.php');
}
else
{
$globalConfig = array();
}
$currentTheme = $core->loadSpecificVar($defaultConfig, $config, "currentTheme");
$defaultSettingsDir = 'core/Themes/'.$currentTheme."/defaultSetting.php";
if(is_dir('local/Themes/'.$currentTheme))
{
$defaultSettingsDir = 'local/Themes/'.$currentTheme."/defaultSetting.php";
}
require_once($defaultSettingsDir);
require_once('core/php/configStatic.php');
require_once('core/php/loadVars.php');
require_once('core/php/loadVarsToJs.php');
require_once('core/php/updateCheck.php');
$settingsUrlModifier = "";
require_once("core/php/defaultConfData.php");
require_once('core/php/defaultLogSidebarData.php');
require_once('core/php/defaultIndexHeaderData.php');
$daysSince = $update->calcuateDaysSince($configStatic['lastCheck']);
/* USED IN ABOUT PAGE (template/about.php) */
$otherPageImageModifier = "";
/* Override window config if multi log is disabled */
$currentSessionValue = $windowConfig;
$lastSessionLogArray = "null";
if(isset($_COOKIE["windowConfig"]) && $logLoadPrevious === "true")
{
$cookieData = json_decode($_COOKIE["windowConfig"]);
$lastSessionLogArray = $_COOKIE["logDisplayArray"];
$currentSessionValue = $cookieData;
}
if(in_array('enableMultiLog', $arrayOfDisabledModules))
{
$windowConfig = "1x1";
$currentSessionValue = $windowConfig;
}
$windowDisplayConfig = explode("x", $currentSessionValue);
/* Used for full screen menu */
$externalLinkImage = $core->generateImage(
$arrayOfImages["loadingImg"],
$imageConfig = array(
"height" => "15px",
"class" => "mainMenuImage",
"style" => "margin-bottom: -10px;",
"data-src" => $arrayOfImages["externalLink"]
)
);
$needRefresh = $core->generateImage(
$arrayOfImages["loadingImg"],
$imageConfig = array(
"height" => "15px",
"class" => "mainMenuImage",
"style" => "margin-bottom: -10px;",
"title" => "Refresh Required",
"data-src" => $arrayOfImages["refresh"]
)
);
?>
<!doctype html>
<head>
<title>Log Hog | Index</title>
<link rel="icon" type="image/png" href="core/img/favicon.png" />
<link rel="stylesheet" type="text/css" href="core/template/load.css?v=<?php echo $core->getFileTime("core/template/load.css",$configStatic["version"]);?>">
<script type="text/javascript">
var baseUrl = "<?php echo $baseUrl;?>";
var Rightclick_ID_list = [];
var lastSessionLogArray = <?php echo $lastSessionLogArray; ?>;
</script>
<?php $core->getScripts(
array(
array(
"filePath" => "core/js/lazyLoadImg.js",
"baseFilePath" => "core/js/lazyLoadImg.js",
"default" => $configStatic["version"]
),
array(
"filePath" => "core/js/jquery.js",
"baseFilePath" => "core/js/jquery.js",
"default" => $configStatic["version"]
),
array(
"filePath" => "core/js/indexJs.js",
"baseFilePath" => "core/js/indexJs.js",
"default" => $configStatic["version"]
)
)
); ?>
<?php require_once("core/php/indexJsObjectCreator.php"); ?>
</head>
<body>
<span id="mainContent" style="display: none;" >
<?php
require_once("core/php/customCSS.php");
require_once("core/php/customIndexCSS.php");
?>
<div <?php if($enablePollTimeLogging == "false"){ echo "style = 'display: none;'";} ?> id="loggTimerPollStyle" class="noticeBar">
<span id="loggingTimerPollRate" >### MS /<?php echo $pollingRate; ?> MS</span> | <span id="loggSkipCount" >0</span>/<?php echo $pollForceTrue; ?> | <span id="loggAllCount" >0</span>/<?php echo $pollRefreshAll; ?>
</div>
<div id="noticeBar" class="noticeBar" style="display: none;" >
<span id="connectionNotice">
Notice - <?php echo ($pollForceTrue * 2); ?> poll requests have failed. Please check server connectivity or refresh page.
</span>
<span id="connectionWarning">
Warning - <?php echo ($pollForceTrue * 4); ?> poll requests have failed. Please check server connectivity or refresh page.
</span>
</div>
<div id="inlineNotifications" class="inlineNotificationsClass" ></div>
<div style="overflow: hidden; display: block;">
<?php require_once("core/php/template/indexHeader.php"); ?>
<div class="backgroundForMenus" id="menu" style="position: absolute; display: none;"></div>
<span id="stars" style="display: block;" ></span>
<span id="stars2" style="display: block;" ></span>
<span id="stars3" style="display: block;" ></span>
</div>
<div id="popupSelectContainer" class="backgroundForMenus addBorder menu" style="display: none;"></div>
<div style="display: inline-block; position: absolute; top: 0; left: 0; z-index: 5;" >
<div id="notificationIcon">
<span onclick="toggleNotifications();" id="notificationBadge"></span>
</div>
<div id="historyDropdown" class="dropdownMenu" >
<div class="notificationTriangle"></div>
</div>
</div>
<div id="main">
<div id="settingsSideBar" class="fullScreenMenuLeftSidebar">
<?php require_once('core/php/template/settingsSideBar.php'); ?>
</div>
<table id="log" cellspacing="0" cellpadding="0">
<tbody><tr><td></td></tr></tbody>
</table>
<div id="firstLoad"></div>
<div id="noLogToDisplay" class='errorMessageLog errorMessageGreenBG' style="display: none; margin-top: 2%;" > There are currently no logs to display. </div>
<div id="moreInfoSideBar" class="fullScreenMenuLeftSidebar" style="display: none;"></div>
</div>
<div id="storage">
<?php
readfile('core/html/indexStorage.html');
require_once('core/php/template/indexStorage.php');
?>
</div>
<div id="fullScreenMenu" class="smallBlur" style="display: none;">
<?php require_once('core/php/template/fullScreenMenu.php'); ?>
</div>
<form id="settingsInstallUpdate" action="update/updater.php" method="post" style="display: none"></form>
<form id="localLayout" style="display: none;" >
<?php include("core/php/template/logLayoutInner.php"); ?>
</form>
<script>
<?php //needs to be moved out of index at some point
if(!(in_array('rightClickMenuEnable', $arrayOfDisabledModules))): ?>
if(document.getElementById('deleteImage'))
{
Rightclick_ID_list.push('deleteImage');
}
if(document.getElementById('pauseImage'))
{
Rightclick_ID_list.push('pauseImage');
}
if(document.getElementById('notificationBadge'))
{
Rightclick_ID_list.push('notificationBadge');
}
if(document.getElementById("notificationCount"))
{
Rightclick_ID_list.push('notificationCount');
}
if(document.getElementById("searchFieldInput"))
{
Rightclick_ID_list.push('searchFieldInput');
}
<?php
endif;
if($levelOfUpdate !== 0 && $configStatic["version"] !== $dontNotifyVersion && $updateNotificationEnabled === "true"):
if($updateNoticeMeter === "every" || $levelOfUpdate > 1):
$updateImage = "";
if($levelOfUpdate == 1)
{
$updateImage = json_encode($core->generateImage(
$arrayOfImages["yellowWarning"],
$imageConfig = array(
"id" => "updateImage",
"class" => "menuImage",
"height" => "15px"
)
));
}
elseif($levelOfUpdate == 2 || $levelOfUpdate == 3)
{
$updateImage = json_encode($core->generateImage(
$arrayOfImages["redWarning"],
$imageConfig = array(
"id" => "updateImage",
"class" => "menuImage",
"height" => "15px"
)
));
}
?>
function addUpdateNotification()
{
var currentId = notifications.length;
notifications[currentId] = new Array();
notifications[currentId]["id"] = currentId;
notifications[currentId]["name"] = "New Update: <?php echo $configStatic['newestVersion'];?>";
notifications[currentId]["time"] = formatAMPM(new Date());
notifications[currentId]["action"] = "toggleUpdateMenu();";
notifications[currentId]["image"] = <?php echo $updateImage; ?>;
}
<?php endif;
endif;
echo "var colorArrayLength = ".count($currentSelectedThemeColorValues).";";
echo "var dateOfLastUpdate = '".$configStatic['lastCheck']."';";
echo "var daysSinceLastCheck = '".$daysSince."';";
echo "var windowDisplayConfigRowCount = ".$windowDisplayConfig[0].";";
echo "var windowDisplayConfigColCount = ".$windowDisplayConfig[1].";";
echo "var updateIconYellowSrc = '".$arrayOfImages["updateYellow"]["src"]."';";
echo "var updateIconRedSrc = '".$arrayOfImages["updateRed"]["src"]."';";
$srcForLoadImage = "core/img/loading.gif";
if(isset($arrayOfImages))
{
$srcForLoadImage = $arrayOfImages["loading"]["src"];
}
?>
var srcForLoadImage = "<?php echo $srcForLoadImage; ?>";
var currentVersion = "<?php echo $configStatic['version'];?>";
var saveVerifyImage = <?php echo json_encode($core->generateImage(
$arrayOfImages["greenCheck"],
array(
"height" => "50px"
)
)); ?>
</script>
<?php require_once('core/php/template/popup.php'); ?>
<nav id="context-menu" class="context-menu">
<ul id="context-menu-items" class="context-menu__items">
</ul>
</nav>
</span>
<span id="initialLoadContent">
<span id="initialLoadContentContent">
<table style="width: 100%; height: 100%; padding: 25px;">
<tr>
<td>
<h1>Log-Hog <?php echo $configStatic["version"]; ?></h1>
<h2 id="initialLoadContentInfo" >Loading CSS Files</h2>
<h3>
<span id="initialLoadContentCountInfo" ></span>
<span id="initialLoadContentEvenMoreInfo" >File Check <span id="initialLoadCountCheck" >1</span> of 1000</span>
</h3>
</td>
</tr>
<tr>
<th>
<p><progress id="initialLoadProgress" value="0" max="100" style="width: 100%;height: 10px;"></progress></p>
<h2 style="display: none;" id="initialLoadContentEvenEvenMoreInfo" >This file looks like it is taking a while to load</h2>
</th>
</tr>
<tr <?php if($enableInitialFileLoadLogging === 'false'): ?> style="display:none;" <?php endif; ?> >
<td>
<h4 id="initialLoadContentMoreInfo" ></h4>
</td>
</tr>
</table>
</span>
<span id="initialLoadContentBlurBackground">
</span>
</span>
<span id="initialLoadContentBackground">
</span>
<script type="text/javascript">
var themeChangeLogicDirModifier = "core/php/post/";
var themeErrorLogicDirModifier = "";
function redirectToLocationFromUpgradeTheme()
{
location.reload();
}
document.addEventListener("DOMContentLoaded", function(event)
{
arrayOfJsFilesKeys = Object.keys(arrayOfJsFiles);
lengthOfArrayOfJsFiles = arrayOfJsFilesKeys.length;
setTimeout(function() {
timerForLoadJS = setInterval(tryLoadJSStuff, 25);
}, 25);
});
</script>
<script type="text/javascript">
var htmlRestoreOptions = "<?php echo $settings->generateRestoreList($configStatic); ?>";
</script>
</body>