summaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-31 03:20:29 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-31 03:20:29 +0000
commit748e50ade1b0c7034eddaadbe2285e5bf3a20fc6 (patch)
tree759b02a66ea840abc91419c9d7d00a08b2fceb8c /admin
parent4e716204e84fc7546372bdae79121e47b92412bc (diff)
downloadampache-748e50ade1b0c7034eddaadbe2285e5bf3a20fc6.tar.gz
ampache-748e50ade1b0c7034eddaadbe2285e5bf3a20fc6.tar.bz2
ampache-748e50ade1b0c7034eddaadbe2285e5bf3a20fc6.zip
added ability to do add new on other elements of song edit (Thx picasso) added export catalog to csv
Diffstat (limited to 'admin')
-rw-r--r--admin/export.php31
1 files changed, 23 insertions, 8 deletions
diff --git a/admin/export.php b/admin/export.php
index f5301643..1b9ce4ed 100644
--- a/admin/export.php
+++ b/admin/export.php
@@ -26,6 +26,8 @@ if (!Access::check('interface','100')) {
exit;
}
+show_header();
+
/* Switch on Action */
switch ($_REQUEST['action']) {
case 'export':
@@ -35,22 +37,35 @@ switch ($_REQUEST['action']) {
$catalog = new Catalog($_REQUEST['export_catalog']);
+ // Clear everything we've done so far
+ ob_end_clean();
+ ob_start();
header("Content-Transfer-Encoding: binary");
header("Cache-control: public");
+ $date = date("d/m/Y",time());
+
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;
- }
+ case 'itunes':
+ header("Content-Type: application/itunes+xml; charset=utf-8");
+ header("Content-Disposition: attachment; filename=\"ampache-itunes-$date.xml\"");
+ $catalog->export('itunes');
+ break;
+ case 'csv':
+ header("Content-Type: application/vnd.ms-excel");
+ header("Content-Disposition: filename=\"ampache-export-$date.csv\"");
+ $catalog->export('csv');
+ break;
+ } // end switch on format
+
+ // We don't want the footer so we're done here
+ exit;
break;
default:
- show_header();
require_once Config::get('prefix') . '/templates/show_export.inc.php';
- show_footer();
break;
} // end switch on action
+
+show_footer();
?>