-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.php
42 lines (36 loc) · 1.52 KB
/
settings.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
<?php
require_once __DIR__ . '/inc/base.php';
insertHeader();
$config = new \Bookshelf\Core\Configuration(true);
if(isset($_POST['libraryDir'])) {
$config->setLibraryDir($_POST['libraryDir']);
}
if(isset($_POST['debuggingEnabled'])) {
$bool = false;
if($_POST['debuggingEnabled'] == 'true' || $_POST['debuggingEnabled'] == 'yes') {
$bool = true;
}
elseif($_POST['debuggingEnabled'] == 'false' || $_POST['debuggingEnabled'] == 'no') {
$bool = false;
}
else {
$bool = (bool)$_POST['debuggingEnabled'];
}
$config->setDebuggingEnabled((bool)$bool);
}
if(isset($_POST['baseUrl'])) {
$config->setBaseUrl($_POST['baseUrl']);
}
?>
<h1>Settings</h1>
<form action="#" method="post">
<!-- Yes, this *is* an actual, real *table*. No, it doesn't have a border but it is a table nonetheless. No table-layouting but a table :) -->
<table id="settingsTable">
<tr><td class="settingsLabel">Library directory:</td><td class="settingsInput"><input name="libraryDir" type="text" value="<?php echo $config->getLibraryDir(); ?>"></td></tr>
<tr><td class="settingsLabel">Debugging enabled:</td><td class="settingsInput"><input name="debuggingEnabled" type="text" value="<?php echo $config->getDebuggingEnabled() ? 'true' : 'false'; ?>"></td></tr>
<tr><td class="settingsLabel">Base URL:</td><td class="settingsInput"><input name="baseUrl" type="text" value="<?php echo $config->getBaseUrl(); ?>"></td></tr>
</table>
<input type="submit">
</form>
<?php
insertFooter();