forked from benkeen/generatedata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·47 lines (38 loc) · 1.88 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
<?php
require_once("library.php");
Core::init();
// if need be, redirect to the install instructions page
Utils::maybeShowInstallationPage();
if (!Core::checkIsLoggedIn() && !Core::checkAllowMultiUserAnonymousUse()) {
header("location: login.php#t1");
exit;
}
$pageParams = array();
if (isset($_POST["updateSettings"])) {
list($success, $message) = Settings::updateSettings($_POST);
$pageParams["success"] = $success;
$pageParams["message"] = $message;
}
$exportTypes = Core::$exportTypePlugins;
$exportTypeAdditionalSettings = ExportTypePluginHelper::getExportTypeAdditionalSettingsHTML($exportTypes);
$dataTypes = DataTypePluginHelper::getDataTypeList(Core::$dataTypePlugins);
$exportTypeJSModules = ExportTypePluginHelper::getExportTypeJSResources($exportTypes, "string");
$exportTypeCssIncludes = ExportTypePluginHelper::getExportTypeCSSIncludes($exportTypes);
$dataTypeJSModules = DataTypePluginHelper::getDataTypeJSResources($dataTypes, "string");
$dataTypeCssIncludes = DataTypePluginHelper::getDataTypeCSSIncludes($dataTypes);
$cssIncludes = $exportTypeCssIncludes . "\n" . $dataTypeCssIncludes;
$pageParams["dataTypeJSModules"] = $dataTypeJSModules;
$pageParams["exportTypeJSModules"] = $exportTypeJSModules;
$pageParams["exportTypeAdditionalSettings"] = $exportTypeAdditionalSettings;
$pageParams["settings"] = Settings::getSettings();
$pageParams["cssIncludes"] = $cssIncludes;
$pageParams["codeMirrorIncludes"] = ExportTypePluginHelper::getExportTypeCodeMirrorModes($exportTypes);
$pageParams["defaultExportType"] = Core::getDefaultExportType();
$pageParams["defaultNumRows"] = Core::getDefaultNumRows();
if (Core::checkIsLoggedIn()) {
$pageParams["isLoggedIn"] = true;
$pageParams["accountType"] = Core::$user->getAccountType();
} else {
$pageParams["isLoggedIn"] = false;
}
Templates::displayPage("resources/templates/index.tpl", $pageParams);