summaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorflashk <flashk@ampache>2007-12-29 20:54:20 +0000
committerflashk <flashk@ampache>2007-12-29 20:54:20 +0000
commitcbda7ff555d3a2d95991304cc24045191ffe260c (patch)
treeb7c0baea036d6fee474a36cd1dbaa096d93493b6 /admin
parentb1d25fc28f25691333bff62b38d0e2650fa8ce8b (diff)
downloadampache-cbda7ff555d3a2d95991304cc24045191ffe260c.tar.gz
ampache-cbda7ff555d3a2d95991304cc24045191ffe260c.tar.bz2
ampache-cbda7ff555d3a2d95991304cc24045191ffe260c.zip
Added ability to export catalog to iTunes database
Fixed sql error when creating catalog
Diffstat (limited to 'admin')
-rw-r--r--admin/export.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/admin/export.php b/admin/export.php
new file mode 100644
index 00000000..f5301643
--- /dev/null
+++ b/admin/export.php
@@ -0,0 +1,56 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ 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 this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+require_once '../lib/init.php';
+
+if (!Access::check('interface','100')) {
+ access_denied();
+ exit;
+}
+
+/* Switch on Action */
+switch ($_REQUEST['action']) {
+ case 'export':
+
+ // This may take a while
+ set_time_limit(0);
+
+ $catalog = new Catalog($_REQUEST['export_catalog']);
+
+ header("Content-Transfer-Encoding: binary");
+ header("Cache-control: public");
+
+ switch($_REQUEST['export_format']) {
+ case 'itunes':
+ header("Content-Type: application/itunes+xml; charset=utf-8");
+ header("Content-Disposition: attachment; filename=\"itunes.xml\"");
+ $catalog->export('itunes');
+ break;
+ }
+
+ break;
+ default:
+ show_header();
+ require_once Config::get('prefix') . '/templates/show_export.inc.php';
+ show_footer();
+ break;
+} // end switch on action
+?>