This commit is contained in:
csikosjanos 2006-03-20 17:01:55 +00:00
parent 0723557ef9
commit 50af857cda
9 changed files with 120 additions and 0 deletions

View file

@ -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')
)
)
);

View file

@ -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');

View file

@ -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);

View file

@ -797,4 +797,8 @@
<key>yesterday</key>
<value>yesterday</value>
</item>
<item>
<key>Export Playlist</key>
<value>Export Playlist</value>
</item>
</translations>

View file

@ -0,0 +1,5 @@
<img src="img/ls_logo_animated.gif">
<script language="javascript">
location.href="{$href}";
setTimeout("window.close()", 5000);
</script>

View file

@ -0,0 +1,20 @@
{include file="popup/header.tpl"}
<table height="100%" width="100%">
<tr>
<td style="border: 0">
<center>
<table width="100%" height="100%">
<tr><td style="border: 0">
{include file="sub/dynForm_plain.tpl}
</td></tr>
</table>
</center>
</td>
</tr>
</table>
</body>
</html>

View file

@ -46,6 +46,7 @@ onClick="return contextmenu('{$i.id}'
, 'PL.activate'
, 'PL.create'
, 'delete'
, 'PL.export'
{/if}
{/if}
)"

View file

@ -66,6 +66,10 @@ function contextmenu(param) {
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.changeTransition&type=fadeOut&id="+param+"', 'PL', '400', '150')\" "+oF+">&nbsp;##Change Fadeout##&nbsp;</a></li>";
break;
case "PL.export":
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.export&type=fadeOut&id="+param+"', 'PL', '400', '150')\" "+oF+">&nbsp;##Export Playlist##&nbsp;</a></li>";
break;
case "SP.addItem":
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SP.addItem&id="+param+"')\" "+oF+">&nbsp;##Add to ScratchPad##&nbsp;</a></li>";
break;

View file

@ -604,4 +604,16 @@ class uiPlaylist
return FALSE;
}
function exportForm($id,$mask)
{
$mask['act']['constant'] = 'PL.export';
$mask['id']['constant'] = $id;
$form = new HTML_QuickForm('PL_exportForm', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
}
}
?>