*** empty log message ***

This commit is contained in:
sebastian 2005-02-26 21:18:32 +00:00
parent 8f28715ddb
commit 1d00e4587d
6 changed files with 70 additions and 44 deletions

View File

@ -148,7 +148,7 @@ if ($uiBrowser->userid) {
$Smarty->assign('changeStationPrefs', TRUE);
break;
case "PL.simpleManagement":
case "PL.simpleManagement":
if ($_REQUEST['createNew']) {
$uiBrowser->PLAYLIST->testNew();
#$Smarty->assign('PLAYLIST', $uiBrowser->PLAYLIST->get());

View File

@ -178,6 +178,11 @@ switch($_REQUEST['act']){
$uiHandler->PLAYLIST->setReload();
break;
case "PL.revert":
$uiHandler->PLAYLIST->revert();
$uiHandler->PLAYLIST->setReload();
break;
default:
$_SESSION["alertMsg"] = tra("Unknown method: $1", $_REQUEST["act"]);
header("Location: ".UI_BROWSER.'?popup[]=_reload_parent&popup[]=_close');

View File

@ -0,0 +1,23 @@
<tr><th colspan="4">active Playlist: {$PL.children.0.children.0.content}</th></tr>
<tr align="center" style="background-color: {cycle values='#eeeeee, #dadada'}"><td></td><td>Title</td><td>Duration</td><td>Type</td></tr>
{PL->getFlat assign='FLAT'}
{foreach from=$FLAT item='i'}
{* {uiBrowser->_niceTime p1=$i.playlength assign='nicelength'} *}
<tr onMouseOver="highlight()" onMouseOut="darklight()" onContextmenu="return menu('{$i.id}', 'PL.removeItem')" style="background-color: {cycle values='#eeeeee, #dadada'}">
<td><input type="checkbox" name="{$i.id}"></td>
<td>{$i.title}</td>
<td>{$i.duration}</td>
<td>{$i.type}</td>
</tr>
{/foreach}
<tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<td><input type="checkbox" name="all" onClick="form_switchAll('PL')"></th>
<td align="center" colspan="2"><a href="#" onClick="form_submit('PL')">[Remove Selected]</a></th>
<td align="center" colspan="2"><a href="#" onClick="form_clearAll('PL')">[Clear]</a></th>
</tr>
<tr>
<td colspan="2"><input type="button" value="Save & Release" onClick="hpopup('{$UI_HANDLER}?act=PL.release')"></td>
<td colspan="2"><input type="button" value="Revert all Changes" onClick="hpopup('{$UI_HANDLER}?act=PL.revert')"></td>
</tr>

View File

@ -5,36 +5,15 @@
<center>
<form name="PL">
<table border="1">
<table border="0">
<tr><th colspan="4">Simple Playlist Management</th></tr>
{PL->get assign='PL'}
{if is_array($PL)} {* already activated Playlist *}
<tr><th colspan="4">active Playlist: {$PL.children.0.children.0.content}</th></tr>
<tr align="center"><td></td><td>Title</td><td>Duration</td><td>Type</td></tr>
{PL->getFlat assign='FLAT'}
{foreach from=$FLAT item='i'}
{uiBrowser->_niceTime p1=$i.playlength assign='nicelength'}
<tr onMouseOver="highlight()" onMouseOut="darklight()" onContextmenu="return menu('{$i.id}', 'PL.removeItem')">
<td><input type="checkbox" name="{$i.id}"></td>
<td>{$i.title}</td>
<td>{$nicelength}</td>
<td>{$i.type}</td>
</tr>
{/foreach}
<tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<td><input type="checkbox" name="all" onClick="form_switchAll('PL')"></th>
<td align="center" colspan="2"><a href="#" onClick="form_submit('PL')">[Remove Selected]</a></th>
<td align="center" colspan="2"><a href="#" onClick="form_clearAll('PL')">[Clear]</a></th>
</tr>
</table>
{if is_array($PL)} {* already activated Playlist *}
{include file="playlist/editor.tpl"}
{else} {* no active Playlist *}
No active Playlist!
<br>
<input type="button" value="Make new Playlist" onClick="hpopup('{$UI_HANDLER}?act=PL.create')">
<tr><td colspan="4">No active Playlist!</td></tr>
<tr><td colspan="4"><input type="button" value="Make new Playlist" onClick="hpopup('{$UI_HANDLER}?act=PL.create')"></td></tr>
{/if}
</table>

View File

@ -325,23 +325,16 @@ class uiBase
function _niceTime($in)
{
if(is_array($in)) {
$in = current($in);
}
list ($in, $lost) = explode('.', $in);
if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in))
list($h, $i, $s) = explode(':', $in);
elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in))
list($i, $s) = explode(':', $in);
else
$s = $in;
if(is_array($in)) $in = current($in);
if (strpos($in, '.')) list ($in, $lost) = explode('.', $in);
$in = str_replace('&nbsp;', '', $in);
if ($h > 0) {
$H = $this->_twoDigits($h).':';
} else {
$H = '&nbsp;&nbsp;&nbsp;';
}
if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($h, $i, $s) = explode(':', $in);
elseif (preg_match('/^[0-9]{1,2}:[0-9]{1,2}$/', $in)) list($i, $s) = explode(':', $in);
else $s = $in;
if ($h > 0) $H = $this->_twoDigits($h).':';
else $H = '&nbsp;&nbsp;&nbsp;';
$I = $this->_twoDigits($i).':';
$S = $this->_twoDigits($s);

View File

@ -56,6 +56,10 @@ class uiPlaylist
return FALSE;
}
$plgunid = $this->Base->gb->releaseLockedPlaylist($this->token, $this->Base->sessid);
if (PEAR::isError($plgunid)) {
$this->Base->_retMsg('Unable to release Playlist');
return FALSE;
}
$this->Base->_retMsg('Playlist "$1" released', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
$this->activeId = NULL;
$this->token = NULL;
@ -63,6 +67,26 @@ class uiPlaylist
return TRUE;
}
function revert()
{
if(!$this->token) {
$this->Base->_retMsg('No Playlist is looked by You');
return FALSE;
}
$plgunid = $this->Base->gb->revertEditedPlaylist($this->token, $this->Base->sessid);
if (PEAR::isError($plgunid)) {
$this->Base->_retMsg('Unable to revert to looked state');
return FALSE;
}
$this->Base->_retMsg('Playlist "$1" reverted and released', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
$this->activeId = NULL;
$this->token = NULL;
$this->Base->gb->delPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY);
return TRUE;
}
function testForLooked()
{
if(is_string($this->token = $this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) {
@ -140,8 +164,10 @@ class uiPlaylist
if ($sub['elementname']=='playlistelement') {
$this->plwalk($sub, $node);
}
if ($sub['elementname']=='audioclip') {
$this->flat["$parent.$node"] = $sub['attrs'];
if ($sub['elementname']=='audioclip' || $sub['elementname']=='webstream') {
#$this->flat["$parent.$node"] = $sub['attrs'];
#$this->flat["$parent.$node"]['type'] = $sub['elementname'];
$this->flat["$parent.$node"] = $this->Base->_getMetaInfo($this->Base->gb->_idFromGunid($sub['attrs']['id']));
}
}
}