diff --git a/livesupport/src/modules/htmlUI/var/formmask/generic.inc.php b/livesupport/src/modules/htmlUI/var/formmask/generic.inc.php
index a9890a663..59f98a12d 100644
--- a/livesupport/src/modules/htmlUI/var/formmask/generic.inc.php
+++ b/livesupport/src/modules/htmlUI/var/formmask/generic.inc.php
@@ -769,5 +769,48 @@ $ui_fmask = array(
array(
'group' => array('cancel', 'reset', 'submitter')
)
+ ),
+ 'PL.export' => array(
+ 'act' => array(
+ 'element' => 'act',
+ 'type' => 'hidden',
+ ),
+ 'id' => array(
+ 'element' => 'id',
+ 'type' => 'hidden'
+ ),
+ array(
+ 'element' => 'exporttype',
+ 'type' => 'select',
+ 'label' => 'Type',
+ 'options' => array('allComponents' => 'All components','playlistOnly' => 'Playlist only')
+ ),
+ array(
+ 'element' => 'playlisttype',
+ 'type' => 'select',
+ 'label' => 'File Format',
+ 'options' => array(
+ 'smil' => 'SMIL',
+ // 'xspf' => 'XSPF',
+ 'm3u' => 'M3U'
+ )
+ ),
+ array(
+ 'element' => 'cancel',
+ 'type' => 'button',
+ 'label' => 'Cancel',
+ 'attributes'=> array('onClick' => 'window.close()'),
+ 'groupit' => TRUE
+ ),
+ array(
+ 'element' => 'submitter',
+ 'type' => 'button',
+ 'label' => 'OK',
+ 'attributes'=> array('onClick' => 'this.form.submit()'),
+ 'groupit' => TRUE
+ ),
+ array(
+ 'group' => array('cancel', 'submitter')
+ )
)
);
\ No newline at end of file
diff --git a/livesupport/src/modules/htmlUI/var/html/ui_browser.php b/livesupport/src/modules/htmlUI/var/html/ui_browser.php
index 4120059f3..d871dcb22 100644
--- a/livesupport/src/modules/htmlUI/var/html/ui_browser.php
+++ b/livesupport/src/modules/htmlUI/var/html/ui_browser.php
@@ -105,6 +105,33 @@ if (is_array($_REQUEST['popup'])){
$Smarty->assign('dynform', $uiBrowser->PLAYLIST->setItemPlaylengthForm($_REQUEST['id'], $_REQUEST['elemId'], $ui_fmask['PL.setItemPlaylength']));
$Smarty->display('popup/PLAYLIST.setItemPlaylength.tpl');
break;
+
+ case "PL.export":
+ $Smarty->assign('dynform', $uiBrowser->PLAYLIST->exportForm($_REQUEST['id'], $ui_fmask['PL.export']));
+ $Smarty->display('popup/PLAYLIST.export.tpl');
+ break;
+
+ case "PL.redirect2DownloadExportedFile":
+ $Smarty->assign('href', UI_BROWSER."?popup[]=PL.downloadExportedFile&id={$_REQUEST['id']}&playlisttype={$_REQUEST['playlisttype']}&exporttype={$_REQUEST['exporttype']}");
+ $Smarty->display('popup/PLAYLIST.downloadExportedFile.tpl');
+ break;
+
+ case "PL.downloadExportedFile":
+ $exportedPlaylist = $uiBrowser->gb->exportPlaylistOpen($uiBrowser->sessid,
+ $uiBrowser->gb->_gunidFromId($_REQUEST['id']),
+ $_REQUEST['playlisttype'],
+ $_REQUEST['exporttype']=='playlistOnly'?true:false);
+ $fp=fopen($exportedPlaylist['fname'],'r');
+ if (is_resource($fp)) {
+ header("Content-Type: application/octet-stream");
+ header("Content-Length: " . filesize($exportedPlaylist['fname']));
+ header('Content-Disposition: attachment; filename="playlist.tar"');
+ header("Content-Transfer-Encoding: binary\n");
+ fpassthru($fp);
+ $uiBrowser->gb->exportPlaylistClose($exportedPlaylist['token']);
+ }
+ //$Smarty->display('popup/PLAYLIST.downloadExportedFile.tpl');
+ break;
case "SCHEDULER.addItem":
$Smarty->display('popup/SCHEDULER.addItem.tpl');
diff --git a/livesupport/src/modules/htmlUI/var/html/ui_handler.php b/livesupport/src/modules/htmlUI/var/html/ui_handler.php
index 245b1635c..6fc186250 100644
--- a/livesupport/src/modules/htmlUI/var/html/ui_handler.php
+++ b/livesupport/src/modules/htmlUI/var/html/ui_handler.php
@@ -254,6 +254,10 @@ switch($_REQUEST['act']){
$uiHandler->SCRATCHPAD->removeItems($ui_tmpid);
$uiHandler->PLAYLIST->setReload();
break;
+
+ case "PL.export":
+ $uiHandler->redirUrl = UI_BROWSER."?popup[]=PL.redirect2DownloadExportedFile&id={$_REQUEST['id']}&playlisttype={$_REQUEST['playlisttype']}&exporttype={$_REQUEST['exporttype']}";
+ break;
case "SCHEDULER.set":
$uiHandler->SCHEDULER->set($_REQUEST);
diff --git a/livesupport/src/modules/htmlUI/var/localizer/lang/default_DEFAULT/templates.xml b/livesupport/src/modules/htmlUI/var/localizer/lang/default_DEFAULT/templates.xml
index 142a2cd3f..2dfa651ed 100644
--- a/livesupport/src/modules/htmlUI/var/localizer/lang/default_DEFAULT/templates.xml
+++ b/livesupport/src/modules/htmlUI/var/localizer/lang/default_DEFAULT/templates.xml
@@ -797,4 +797,8 @@
yesterday
yesterday
+ -
+ Export Playlist
+ Export Playlist
+
\ No newline at end of file
diff --git a/livesupport/src/modules/htmlUI/var/templates/popup/PLAYLIST.downloadExportedFile.tpl b/livesupport/src/modules/htmlUI/var/templates/popup/PLAYLIST.downloadExportedFile.tpl
new file mode 100755
index 000000000..31018b693
--- /dev/null
+++ b/livesupport/src/modules/htmlUI/var/templates/popup/PLAYLIST.downloadExportedFile.tpl
@@ -0,0 +1,5 @@
+
+
diff --git a/livesupport/src/modules/htmlUI/var/templates/popup/PLAYLIST.export.tpl b/livesupport/src/modules/htmlUI/var/templates/popup/PLAYLIST.export.tpl
new file mode 100755
index 000000000..553b49659
--- /dev/null
+++ b/livesupport/src/modules/htmlUI/var/templates/popup/PLAYLIST.export.tpl
@@ -0,0 +1,20 @@
+{include file="popup/header.tpl"}
+
+
+
+
+
+
+
+
+ {include file="sub/dynForm_plain.tpl}
+ |
+
+
+ |
+
+
+
+