forked from volumio/Volumio-WebUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
72 lines (68 loc) · 2.07 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
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
<?php
/*
* PlayerUI Copyright (C) 2013 Andrea Coiutti & Simone De Gregori
* Tsunamp Team
* http://www.tsunamp.com
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RaspyFi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*
* UI-design/JS code by: Andrea Coiutti (aka ACX)
* PHP/JS code by: Simone De Gregori (aka Orion)
*
* file: index.php
* version: 1.0
*
*/
// common include
include('inc/connection.php');
// set template
$tpl = "indextpl.html";
$sezione = basename(__FILE__, '.php');
$_section = $sezione;
include('_header.php');
// Check updates before everything else, since if state is outdated then other parts of the webui may crash
if (!isset($_GET['skip_updates']) || $_GET['skip_updates'] != '1') {
include('updates/check_updates.php');
}
playerSession('open',$db,'','');
playerSession('unlock',$db,'','');
// set template
$tpl = "indextpl.html";
?>
<!-- content --!>
<?php
eval("echoTemplate(\"".getTemplate("templates/$tpl")."\");");
?>
<!-- content -->
<?php
//generic functions in home
if (isset($_POST['syscmd'])) {
if ($_SESSION['w_lock'] != 1 && $_SESSION['w_queue'] == '') {
session_start();
sendMpdCommand($mpd,'clear');
// set UI notify
$_SESSION['notify']['title'] = 'Clear Queue';
$_SESSION['notify']['msg'] = 'Play Queue Cleared';
// unlock session file
playerSession('unlock');
} else {
echo "background worker busy";
}
// unlock session file
playerSession('unlock');
}
?>
<?php include('_footer.php'); ?>