| 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 | require_once("../inc/base.php"); |
| 21 | header("Content-Type: text/javascript"); |
| 22 | $delay = get_config("update_delay"); |
| 23 | $disable_amazon = get_config("amazon_link_disable"); |
| 24 | $metadata_disable = get_config("metadata_disable"); |
| 25 | |
| 26 | if(is_null($delay)||!is_numeric($delay)) { |
| 27 | $delay = 1; |
| 28 | } |
| 29 | |
| 30 | echo "var update_delay = " . $delay . ";\n"; |
| 31 | |
| 32 | if(is_null($metadata_disable)) { |
| 33 | $metadata_disable = "false"; |
| 34 | } |
| 35 | else $metadata_disable = "true"; |
| 36 | echo "var metadata_disable = " . $metadata_disable . ";\n"; |
| 37 | |
| 38 | echo "var stop_button = "; |
| 39 | if(is_null(get_config("stop_button"))) { |
| 40 | echo "false"; |
| 41 | } |
| 42 | else { |
| 43 | echo "true"; |
| 44 | } |
| 45 | echo ";\n"; |
| 46 | |
| 47 | |
| 48 | echo "var pl_entries = new Array('Pos', "; |
| 49 | |
| 50 | $selected = get_selected_plfields(); |
| 51 | $length = count($pl_fields); |
| 52 | for($i=0; $i<$length; $i++) { |
| 53 | if($selected[$i]) |
| 54 | echo "'" . $pl_fields[$i] . "', "; |
| 55 | } |
| 56 | |
| 57 | echo "'Time');\n"; |
| 58 | |
| 59 | echo "var SHOUT_URL="; |
| 60 | $shout = get_config("shout_url"); |
| 61 | if(!is_null($shout)) |
| 62 | echo "\"" . str_replace("\"", "\\\"", $shout) . "\""; |
| 63 | else echo "false"; |
| 64 | echo ";\n"; |
| 65 | |
| 66 | echo "var pagination_max = " . get_config("pagination", "0") . ";\n"; |
| 67 | |
| 68 | echo "\n"; |
| 69 | ?> |