-
Notifications
You must be signed in to change notification settings - Fork 0
/
donorpress-settings.php
64 lines (62 loc) · 2.52 KB
/
donorpress-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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
use DonorPress\Donor;
use DonorPress\DonorType;
use DonorPress\DonationCategory;
use DonorPress\DonorTemplate;
use DonorPress\CustomVariables;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
?>
<style>
@media print
{
#adminmenumain,#wpadminbar,.no-print, .no-print *
{
display: none !important;
}
body { background-color:white;}
#wpcontent, #wpfooter{ margin-left:0px;}
}
</style>
<?php
$tabs=['cv'=>'Site Variables','email'=>'Email Templates','cat'=>'Donation Categories','type'=>'Donor Types','bak'=>'Backup/Restore'];
$active_tab=Donor::show_tabs($tabs);
?>
<div id="pluginwrap">
<?php
if (DonationCategory::request_handler()) { print "</div>"; return;}
if (DonorType::request_handler()) { print "</div>"; return;}
if (DonorTemplate::request_handler()) { print "</div>"; return;}
if (CustomVariables::request_handler()) { print "</div>"; return;}
?>
<h1>Settings: <?php print esc_html($tabs[$active_tab])?></h1><?php
switch($active_tab){
case "type": DonorType::list(); break;
case "cat": DonationCategory::list(); break;
case "email": DonorTemplate::list(); break;
case "bak":
?><form method="post" enctype="multipart/form-data">
<h2>Backup</h2>
<div>
<button name="Function" value="BackupDonorPress">Backup Donor Press Tables/Settings</button>
</div>
<hr>
<h2>Restore</h2>
<div>
<input type="file" name="fileToUpload" accept=".json">
<button name="Function" value="RestoreDonorPress">Restore from File</button>
Server Upload Limit: <?php print esc_html(ini_get("upload_max_filesize"));?> <em>Caution - will remove current Donor Press Data</em>
</div>
<hr>
<h2>Nuke Site</h2>
<button name="Function" value="NukeDonorPress">Clear Out Donor Press Files</button> - Useful for uninstalls or during testing.
<h2>Load Test Data</h2>
<button name="Function" value="LoadTestData">Load Test Records</button> Records: <input type="number" name="records" value="20"/> - Useful for testing the plugin. This will add new donor and donations records (but not remove existing data).
</form><?php
break;
case "cv":
default:
CustomVariables::form();
break;
}
?>
</div>