Add support for view-only mode.
[patchfork.git] / player / index.php
CommitLineData
964dd0bc
JW
1<?php
2/*
3 Pitchfork Music Player Daemon Client
4 Copyright (C) 2007 Roger Bystrøm
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; version 2 of the License.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20 include_once("../inc/function_test.php");
21 require_once('../inc/base.php');
22 require_once("../lang/master.php");
23 header("Content-Type: text/html; charset=UTF-8");
24 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
25 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
26 header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); // HTTP/1.1
27 header("Cache-Control: post-check=0, pre-check=0", false);
28 header("Pragma: no-cache"); // HTTP/1.0
29?>
30<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
31
32<html>
33 <head>
34 <link rel="stylesheet" type="text/css" href="../std/base.css" />
35 <link rel="stylesheet" type="text/css" href="../theme/<?php echo htmlentities($selected_theme); ?>/theme.css" />
36<?php
37 $scripts = array("player/preferences.js.php", "lang/en.js", "std/collection.js", "std/toolkit.js", "std/streaming.js",
38 "std/plsearch.js", "std/playlist.js", "std/keyboard.js", "std/browser.js", "std/quickadd.js",
39 "std/command.js", "theme/" . htmlentities($selected_theme) . "/theme.js" );
40 if($language != "en")
41 $scripts[] = "lang/".$language.".js";
42
43 if(is_null(get_config("metadata_disable")))
44 $scripts[] = "std/metadata.js";
45
46 foreach($scripts as $script)
47 echo "\t\t<script type=\"text/JavaScript\" src=\"../".$script."\"></script>\n";
48 ?>
49 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
50 <meta name="robots" content="noindex,nofollow" />
51 <title>Pitchfork MPD Client</title>
52 </head>
53<body onload='init_player()'>
54
55<div class='player_control' style='' id='player_control'>
56
57 <div id='status_bar'>
58 <p id='status_bar_txt'></p>
59 <img id='status_bar_img' class='status_working' />
60 </div>
61
62 <div id='albumart'></div>
63 <div class='pc_artist' >
64 <p class='disp'><span id='disp_title'></span><br/></p>
65 <p class='disp' ><span id='disp_artist'></span><br/></p>
9a6ec85f 66 <p class='disp'><span id='disp_album'></span> <span id='disp_year'></span><br/></p>
964dd0bc
JW
67 </div>
68
69 <div class='pc_ci' >
70 <div class='nomargin'>
f8fb3735
JW
71 <? if ($ro) { ?>
72 <b>[<?=m("view only")?>]</b><br>
73 <? } else { ?>
964dd0bc
JW
74 <img id='previous_button' class='act_button fakelink'/>
75 <img id='stop_button' style='display: none; ' class='act_button fakelink' />
76 <img id='pp_button' class='act_button fakelink' />
77 <img id='next_button' class='act_button fakelink'/>
f8fb3735 78 <? } ?>
964dd0bc
JW
79 </div>
80 <p class='disp'><span id="disp_info"></span></p>
81 <input type='text' id='quickadd' value='<?php echo m("Quick add"); ?>' />
82 <div id='qa_suggestions' ><p id='qa_suggestions_txt' ></p></div>
83 </div>
84
85 <div class='pc_sliders'>
86 <div id='posslider' ></div>
87 <div id="volslider" ></div>
88 </div>
89
90 <div class='pc_settings'>
91 <div id='settings_header' class='settings_header'><p class='nomargin' style='padding-left: 10px;'><?php echo m("Server settings"); ?></p></div>
92 <div class='settings_container' id='settings_container'><p id='settings_content'></p></div>
93 </div>
94
95 <div class='pc_other'><ul class='nomargin'>
96 <li class='menuitem fakelink' title="<?php echo m("Add playlists or audio-files"); ?>"
97 id='playlist_add'><?php echo m("Add playlist"); ?></li>
98 <li class='menuitem fakelink' title="<?php echo m("Save current playlist"); ?>"
99 id='playlist_save'><?php echo m("Save playlist"); ?></li>
100 <li class='menuitem fakelink' title='<?php echo m("Search current playlist"); ?>'
101 id='playlist_search_btn' ><?php echo m("Search playlist"); ?></li>
102 <li class='menuitem' ><a class='pc_other' href='config.php'><?php echo m("Configure"); ?></a></li>
f8fb3735
JW
103 <? if ($ro) { ?>
104 <li class='menuitem' ><a class='pc_other' href='login.php'><?php echo m("Log in"); ?></a></li>
105 <? } else if (isset($_SESSION['logged_in'])) { ?>
106 <li class='menuitem' ><a class='pc_other' href='login.php?logout'><?php echo m("Log out"); ?></a></li>
107 <? } ?>
964dd0bc
JW
108
109 <?php
110 if(!is_null(get_config("shout_url")))
111 echo "\t\t<li class='menuitem fakelink' title='" . m("Start streaming to browser") . "' id='streaming_open'>".
112 m("Streaming") . "</li>\n";
113 if(is_null(get_config('metadata_disable'))) {
114 echo "\t\t<li title='" . m("Get music recommendations based on current playlist") . "' id='recommendation_open' ".
115 "class='menuitem fakelink'>". m("Recommendation") . "</li>\n";
116 echo "\t\t<li title='" . m("Get more information about this song/album") . "' id='metadata_open' class='menuitem fakelink'>".
117 m("Song Info") . "</li>\n";
118
119 }
120 ?>
121 </ul></div>
122</div>
123
124<div class='selection_menu'>
125<img id='crop_items_button' class='menu_button fakelink' title="<?php echo m("Crop to selection"); ?>" />
126<img id='remove_items_button' class='menu_button fakelink' title="<?php echo m("Remove selection"); ?>" />
127<img id='open_directory_button' class='menu_button fakelink' title="<?php echo m("Open directory"); ?>" />
128</div>
129
130<div id='content'>
131<table id='playlist' ></table>
132</div>
133
134<div id="sidebar_header"><p class='nomargin'><span class='fakelink' id='metadata_open_lyrics'>[<?php echo m("Lyrics"); ?>]</span> <span id='metadata_open_description' class='fakelink'>[<?php echo m("Album description"); ?>]</span> <span id='metadata_open_review' class='fakelink'>[<?php echo m("Album review"); ?>]</span> <span id='metadata_close' class='fakelink'>[<?php echo m("Close"); ?>]</span></p></div>
135<div id='sidebar_display'><p class='nomargin' id='sidebar_display_txt'> </p></div>
136
137<div id='pagination_options'><img class="pagination_options" src='' id='pagination_jump_current'/><img class="pagination_options" src='' id='pagination_follow_current'/></div>
138<?php if(get_config("pagination", "0")!="0") {?>
139<div id='pagination'><ul id='pagination_list'></ul></div>
140<div id='pagination_spacer'> </div>
141<?php } ?>
142
143</body>
144</html>
This page took 0.030859 seconds and 4 git commands to generate.