-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.php
214 lines (205 loc) · 12.3 KB
/
setup.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
<?php
include_once "zettle.common.php";
$pluginName = "zettle";
$pluginJson = convertAndGetSettings($pluginName);
// // Check if command has been made executable
// if (!is_executable($settings["pluginDirectory"] . "/fpp-zettle/commands/ZettleTotals.sh")) {
// chmod($settings["pluginDirectory"] . "/fpp-zettle/commands/ZettleTotals.sh", 0755);
// }
?>
<link rel="stylesheet" href="/plugin.php?plugin=fpp-zettle&file=zettle.css&nopage=1">
<script type="text/javascript" src="/plugin.php?plugin=fpp-zettle&file=zettle.js&nopage=1"></script>
<div id="global" class="settings">
<?php include $settings["pluginDirectory"] . "/fpp-zettle/pluginUpdate.php" ?>
<legend>Zettle Setup</legend>
<p>Add your client id and secret generated from the Zettle Integrations
webpage</p>
<form id="setup" action="" method="post">
<div class="container-fluid settingsTable settingsGroupTable">
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Client ID
</div>
</div>
<div class="printSettingFieldCol col-md">
<input type="text" id="client_id" value="<?php echo $pluginJson["client_id"]; ?>" required class="form-control">
</div>
</div>
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Api Key
</div>
</div>
<div class="printSettingFieldCol col-md">
<input type="password" id="client_secret" value="<?php echo $pluginJson["client_secret"]; ?>" required class="form-control">
</div>
</div>
</div>
<input id="save" type="submit" value="Save" class="buttons btn-success">
<?php if ($pluginJson["client_id"] != "" && count($pluginJson["subscriptions"]) == 0) { ?>
<a href="plugin.php?_menu=content&plugin=fpp-zettle&page=create-subscription.php" class="buttons">Create Subscription</a>
<?php } ?>
<?php if ($pluginJson["client_id"] != "" && count($pluginJson["subscriptions"]) > 0) { ?>
<input id="clear_config" type="button" class="buttons" value="Clear Config">
<a href="plugin.php?_menu=content&plugin=fpp-zettle&page=update-subscription.php" class="buttons">Update Subscription</a>
<?php } ?>
</form>
<?php if ($pluginJson["client_id"] != "" && count($pluginJson["subscriptions"]) > 0) { ?>
<legend>Effect</legend>
<!--p>The effect that will be run when a transaction comes in.</p-->
<p>Select a command that you would like to run when a transaction comes in</p>
<div id="text_options" class="callout callout-info" style="display: none;">
<h4>Overlay Model Effect and URL Text Options</h4>
<p>There are a number of options available.</p>
<ul>
<!--li>{{PAYER_NAME}} : Show the name of the person that has donated</li-->
<li>{{AMOUNT}} : Show the amount the person donated</li>
<li>{{EVERYTHING}} : Show the amount you have rased from day one</li>
<li>{{TODAY}} : Show the amount you have rased today</li>
<li>{{THIS_MONTH}} : Show the amount you have rased this month</li>
</ul>
<p>Note: You can put what ever you want in the text felid does not to have the above options in it.</p>
</div>
<form id="api_effect" action="" method="post">
<div class="container-fluid settingsTable settingsGroupTable">
<div class="row">
<div class="buttonCommandWrap">
<div class="bb_commandTableWrap">
<div class="bb_commandTableCrop">
<table border=0 id="tableButtonTPL" class="tableButton">
<tr>
<td>Activate:</td>
<td>
<select id="effect_activate" required>
<option value="yes" <?php echo $pluginJson['effect_activate'] == 'yes' ? 'selected' : null; ?>>Yes</option>
<option value="no" <?php echo $pluginJson['effect_activate'] == 'no' ? 'selected' : null;
echo !isset($pluginJson['effect_activate']) ? 'selected' : ''; ?>>No</option>
</select>
</td>
</tr>
<tr>
<td>Command:</td>
<td>
<select id="button_TPL_Command" class="buttonCommand" required>
<option value="" disabled selected>Select a Command</option>
</select>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<!--div class="container-fluid settingsTable settingsGroupTable">
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Select effect
</div>
</div>
<div class="printSettingFieldCol col-md">
<select name="select_effect" id="select_effect" class="form-control">
<option value="">Select Effect</option>
</select>
</div>
</div>
</div-->
<input id="effect_save" type="submit" value="Save" class="buttons btn-success">
<input id="test_command" type="button" value="Test" class="buttons">
<a href="plugin.php?_menu=content&plugin=fpp-zettle&page=multiple-readers.php" class="buttons">Have Multiple Readers</a>
</form>
<?php if (isset($pluginJson['readers']) && count($pluginJson['readers']) > 0) { ?>
<p>You multiple readers configured</p>
<?php } ?>
<div class="alert alert-info">If you are looking for help press F1 or <a href="plugin.php?plugin=fpp-zettle&page=help.php" class="alert-link" target="_blank">Click Here</a></div>
<legend>Pushover</legend>
<p>Get notification sent your phone every time a donate is made. Pushover is free to use for 30 days. If you want to use it for longer there is a $5 USD one-time purchase fee. Check out the details at there website: <a href="https://pushover.net/" target="_blank">https://pushover.net</a></p>
<form id="pushover" action="">
<div class="container-fluid settingsTable settingsGroupTable">
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Activate
</div>
</div>
<div class="printSettingFieldCol col-md">
<select id="pushover_activate" required class="form-control">
<option value="yes" <?php echo $pluginJson['pushover']['activate'] == 'yes' ? 'selected' : null; ?>>Yes</option>
<option value="no" <?php echo $pluginJson['pushover']['activate'] == 'no' ? 'selected' : null;
echo !isset($pluginJson['pushover']['activate']) ? 'selected' : ''; ?>>No</option>
</select>
</div>
</div>
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Application API Token
</div>
</div>
<div class="printSettingFieldCol col-md">
<input type="text" id="pushover_app_token" value="<?php echo $pluginJson["pushover"]["app_token"]; ?>" required class="form-control">
</div>
</div>
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>User Key
</div>
</div>
<div class="printSettingFieldCol col-md">
<input type="text" id="pushover_user_key" value="<?php echo $pluginJson["pushover"]["user_key"]; ?>" required class="form-control">
</div>
</div>
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Message
</div>
</div>
<div class="printSettingFieldCol col-md">
<input type="text" id="pushover_message" value="<?php echo $pluginJson["pushover"]["message"]; ?>" required class="form-control">
</div>
</div>
</div>
<input type="submit" value="Save" class="buttons btn-success">
</form>
<legend>Publish</legend>
<p>We would like to gather some information from your donations. We would like to collect the donation amount and store it remotely on the <a href="https://fpp-zettle.co.uk" target="_blank">fpp-zettle.co.uk</a> server.</p>
<p>If you would like to take part in this please select "Yes" from the activate select and press save.</p>
<form action="" id="publish">
<div class="container-fluid settingsTable settingsGroupTable">
<div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Activate
</div>
</div>
<div class="printSettingFieldCol col-md">
<select id="publish_activate" required class="form-control">
<option value="yes" <?php echo $pluginJson['publish']['activate'] == 'yes' ? 'selected' : null; ?>>Yes</option>
<option value="no" <?php echo $pluginJson['publish']['activate'] == 'no' ? 'selected' : null;
echo !isset($pluginJson['publish']['activate']) ? 'selected' : ''; ?>>No</option>
</select>
</div>
</div>
<!-- <div class="row">
<div class="printSettingLabelCol col-md-4 col-lg-3 col-xxxl-2">
<div class="description">
<i class="fas fa-fw fa-nbsp ui-level-0"></i>Location
</div>
</div>
<div class="printSettingFieldCol col-md">
<select id="publish_location" required class="form-control">
<option value="yes" <?php echo $pluginJson['publish']['location'] == 'yes' ? 'selected' : null; ?>>Yes</option>
<option value="no" <?php echo $pluginJson['publish']['location'] == 'no' ? 'selected' : null; ?>>No</option>
</select>
</div>
</div> -->
</div>
<input type="submit" value="Save" class="buttons btn-success">
</form>
<?php } ?>
</div>