-
Notifications
You must be signed in to change notification settings - Fork 3
/
plugin_setup.php
executable file
·44 lines (36 loc) · 1.14 KB
/
plugin_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
<?php
$playlists = Array();
foreach(scandir($playlistDirectory) as $pFile)
if ($pFile != "." && $pFile != "..") {
if (preg_match('/\.json$/', $pFile)) {
$pFile = preg_replace('/\.json$/', '', $pFile);
$playlists[$pFile] = $pFile;
}
}
?>
<script>
function StartPlaylist() {
var PlayList = $("#PlaylistSelect").val();
var command = "{\"command\": \"Start Playlist\","
+ "\"multisyncCommand\": false,"
+ "\"multisyncHosts\": \"\","
+ "\"args\": ["
+ "\"" + PlayList + "\","
+ ($("#Repeat").is(':checked') ? "\"true\"," : "\"false\",")
+ "\"false\" ] }";
$.ajax({
url: "api/command",
type: 'POST',
dataType: 'json',
data: command
});
}
</script>
<div id="start" class="settings">
<fieldset>
<legend>Big Green Button</legend>
<p>Playlist: <?php PrintSettingSelect("Playlist", "PlaylistSelect", "0", "0", "disabled", $playlists, "big-green-button"); ?> Repeat: <?php PrintSettingCheckbox("Repeat", "Repeat", 0, 0, "1", "0", "big-green-button"); ?></p>
<p><input class="button" onClick="StartPlaylist();" type="submit" value="Start" /></p>
</fieldset>
</div>
<br />