~ubuntu-branches/debian/sid/ampache/sid

« back to all changes in this revision

Viewing changes to lib/javascript/search-data.php

  • Committer: Package Import Robot
  • Author(s): Charlie Smotherman
  • Date: 2013-08-27 13:19:48 UTC
  • mfrom: (1.2.9)
  • Revision ID: package-import@ubuntu.com-20130827131948-1czew0zxn6u70dtv
Tags: 3.6-rzb2752+dfsg-1
* New upsteam snapshot.  Contains important bug fixes to the installer.
* Correct typo in ampache-common.postrm.
* Remove courtousy copy of php-getid3, during repack.  Closes: #701526
* Update package to use dh_linktree to make the needed sym links to the
  needed system libs that were removed during repack.
* Update debian/rules to reflect upstreams removing/moving of modules.
* Update debian/ampache-common.install to reflect upstreams removal of files.
* Updated to use new apache2.4 API. Closes: #669756
* Updated /debian/po/de.po thx David Prévot for the patch.  Closes:  #691963
* M3U import is now ordered, fixed upstream.  Closes: #684984
* Text input area has been resized so IPv6 addresses will now fit, fixed
  upstream.  Closes:  #716230
* Added ampache-common.preinst to make sure that the courtousy copies of code
  dirs are empty so dh_linktree can do it's magic on upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
 
/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
 
2
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
3
3
/**
4
 
 
5
 
Copyright (c) Ampache.org
6
 
 All rights reserved.
7
 
 
8
 
 This program is free software; you can redistribute it and/or
9
 
 modify it under the terms of the GNU General Public License v2
10
 
 as published by the Free Software Foundation.
11
 
 
12
 
 This program is distributed in the hope that it will be useful,
13
 
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 GNU General Public License for more details.
16
 
 
17
 
 You should have received a copy of the GNU General Public License
18
 
 along with this program; if not, write to the Free Software
19
 
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20
 
 
21
 
*/
 
4
 *
 
5
 * LICENSE: GNU General Public License, version 2 (GPLv2)
 
6
 * Copyright 2001 - 2013 Ampache.org
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU General Public License v2
 
10
 * as published by the Free Software Foundation
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
20
 *
 
21
 */
 
22
 
22
23
require_once '../init.php';
23
24
 
24
25
function arrayToJSON($array) {
25
 
        $json = '{ ';
26
 
        foreach ($array as $key => $value) {
27
 
                $json .= '"' . $key . '" : ';
28
 
                if (is_array($value)) {
29
 
                        $json .= arrayToJSON($value);
30
 
                }
31
 
                else {
32
 
                        // Make sure to strip backslashes and convert things to
33
 
                        // entities in our output
34
 
                        $json .= '"' . scrub_out(str_replace('\\', '', $value)) . '"';
35
 
                }
36
 
                $json .= ' , ';
37
 
        }
38
 
        $json = rtrim($json, ', ');
39
 
        return $json . ' }';
 
26
    $json = '{ ';
 
27
    foreach ($array as $key => $value) {
 
28
        $json .= '"' . $key . '" : ';
 
29
        if (is_array($value)) {
 
30
            $json .= arrayToJSON($value);
 
31
        }
 
32
        else {
 
33
            // Make sure to strip backslashes and convert things to
 
34
            // entities in our output
 
35
            $json .= '"' . scrub_out(str_replace('\\', '', $value)) . '"';
 
36
        }
 
37
        $json .= ' , ';
 
38
    }
 
39
    $json = rtrim($json, ', ');
 
40
    return $json . ' }';
40
41
}
41
42
 
42
43
Header('content-type: application/x-javascript');
47
48
echo arrayToJSON($search->types) . "'.evalJSON());\n";
48
49
echo 'var basetypes = $H(\'';
49
50
echo arrayToJSON($search->basetypes) . "'.evalJSON());\n";
50
 
echo 'removeIcon = \'<a href="javascript: void(0)">' . get_user_icon('disable', T_('Remove')) . '</a>\';';
 
51
echo 'removeIcon = \'<a href="javascript: void(0)">' . UI::get_icon('disable', T_('Remove')) . '</a>\';';
51
52
?>