*** empty log message ***

This commit is contained in:
sebastian 2005-02-26 19:29:36 +00:00
parent 2f6ef90968
commit 8f28715ddb
17 changed files with 279 additions and 169 deletions

View file

@ -23,7 +23,7 @@
Author : $Author: sebastian $ Author : $Author: sebastian $
Version : $Revision: 1.17 $ Version : $Revision: 1.18 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/htmlUI/var/Attic/conf.php,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -143,4 +143,8 @@ define('UI_SCRATCHPAD_MAXLENGTH_KEY', 'djBagMaxlength');
define('UI_SCRATCHPAD_SESSNAME', 'SCRATCHPAD'); define('UI_SCRATCHPAD_SESSNAME', 'SCRATCHPAD');
define('UI_STATIONINFO_SESSNAME', 'STATIONINFO'); define('UI_STATIONINFO_SESSNAME', 'STATIONINFO');
define('UI_SEARCH_SESSNAME', 'SEARCH'); define('UI_SEARCH_SESSNAME', 'SEARCH');
define('UI_MDATA_KEY_TITLE', 'dc:title');
define('UI_MDATA_KEY_ARTIST', 'dc:creator');
define('UI_MDATA_KEY_DURATION', 'dcterms:extent');
?> ?>

View file

@ -57,7 +57,7 @@ $mask = array(
'groupit' => TRUE, 'groupit' => TRUE,
'attributes' => array('onClick' => 'showTalk()') 'attributes' => array('onClick' => 'showTalk()')
), ),
'group' => array( array(
'group' => array('Main', 'Music', 'Talk'), 'group' => array('Main', 'Music', 'Talk'),
) )
@ -82,19 +82,22 @@ $mask = array(
'element' => 'dc:title', 'element' => 'dc:title',
'type' => 'text', 'type' => 'text',
'label' => 'Title', 'label' => 'Title',
'required' => TRUE 'required' => TRUE,
'id3' => 'Title'
), ),
array( array(
'element' => 'dc:creator', 'element' => 'dc:creator',
'type' => 'text', 'type' => 'text',
'label' => 'Creator', 'label' => 'Creator',
'required' => TRUE, 'required' => TRUE,
'id3' => 'Artist'
), ),
array( array(
'element' => 'ls:genre', 'element' => 'ls:genre',
'type' => 'text', 'type' => 'text',
'label' => 'Genre', 'label' => 'Genre',
'required' => TRUE, 'required' => TRUE,
'id3' => 'Genre'
), ),
array( array(
'element' => 'dc:format', 'element' => 'dc:format',
@ -102,17 +105,19 @@ $mask = array(
'label' => 'File format', 'label' => 'File format',
'required' => TRUE, 'required' => TRUE,
'options' => array( 'options' => array(
'' => '', '' => '',
'File' => 'File', 'File' => 'File',
'live stream' => 'Live Stream', 'live stream' => 'Live Stream',
'networked file'=> 'Networked File', 'networked file'=> 'Networked File',
) ),
'id3' => FALSE
), ),
array( array(
'element' => 'dcterms:extent', 'element' => 'dcterms:extent',
'type' => 'text', 'type' => 'text',
'label' => 'Length', 'label' => 'Length',
'attributes'=> array('readonly' => 'on') 'attributes'=> array('readonly' => 'on'),
'id3' => FALSE
), ),
/* /*
array( array(
@ -149,167 +154,195 @@ $mask = array(
'element' => 'dc:title', 'element' => 'dc:title',
'type' => 'text', 'type' => 'text',
'label' => 'Title', 'label' => 'Title',
'id3' => 'Title'
), ),
array( array(
'element' => 'dc:creator', 'element' => 'dc:creator',
'type' => 'text', 'type' => 'text',
'label' => 'Creator', 'label' => 'Creator',
'id3' => 'Artist'
), ),
array( array(
'element' => 'dc:source', 'element' => 'dc:source',
'type' => 'text', 'type' => 'text',
'label' => 'Album', 'label' => 'Album',
'id3' => 'Album'
), ),
array( array(
'element' => 'ls:year', 'element' => 'ls:year',
'type' => 'date', 'type' => 'date',
'label' => 'Year', 'label' => 'Year',
'options' => array( 'options' => array(
'language' => 'en', 'language' => 'en',
'format' => 'dMY', 'format' => 'dMY',
'addEmptyOption'=> TRUE, 'addEmptyOption'=> TRUE,
'minYear' => 1900 'minYear' => 1900
) ),
'id3' => 'Year'
), ),
array( array(
'element' => 'dc:type', 'element' => 'dc:type',
'type' => 'text', 'type' => 'text',
'label' => 'Genre', 'label' => 'Genre',
'id3' => 'Genre'
), ),
array( array(
'element' => 'dc:description', 'element' => 'dc:description',
'type' => 'textarea', 'type' => 'textarea',
'label' => 'Description', 'label' => 'Description',
'id3' => 'Comment'
), ),
array( array(
'element' => 'dc:format', 'element' => 'dc:format',
'type' => 'select', 'type' => 'select',
'label' => 'Format', 'label' => 'Format',
'options' => array( 'options' => array(
'' => '', '' => '',
'File' => 'File', 'File' => 'File',
'live stream' => 'Live Stream', 'live stream' => 'Live Stream',
'networked file'=> 'Networked File' 'networked file'=> 'Networked File'
) ),
'id3' => FALSE
), ),
array( array(
'element' => 'ls:bpm', 'element' => 'ls:bpm',
'type' => 'text', 'type' => 'text',
'label' => 'BPM', 'label' => 'BPM',
'rule' => 'numeric', 'rule' => 'numeric',
'id3' => 'BPM'
), ),
array( array(
'element' => 'ls:rating', 'element' => 'ls:rating',
'type' => 'text', 'type' => 'text',
'label' => 'Rating', 'label' => 'Rating',
'rule' => 'numeric', 'rule' => 'numeric',
'id3' => 'Rating'
), ),
array( array(
'element' => 'dcterms:extent', 'element' => 'dcterms:extent',
'type' => 'text', 'type' => 'text',
'label' => 'Length', 'label' => 'Length',
'attributes'=> array('readonly' => 'on') 'attributes'=> array('readonly' => 'on'),
'id3' => FALSE
), ),
array( array(
'element' => 'ls:encoded_by', 'element' => 'ls:encoded_by',
'type' => 'text', 'type' => 'text',
'label' => 'Encoded by', 'label' => 'Encoded by',
'id3' => 'Encoded by'
), ),
array( array(
'element' => 'ls:track_num', 'element' => 'ls:track_num',
'type' => 'select', 'type' => 'select',
'label' => 'Track number', 'label' => 'Track number',
'options' => _getNumArr(0, 99) 'options' => _getNumArr(0, 99),
'id3' => 'Track'
), ),
array( array(
'element' => 'ls:disc_num', 'element' => 'ls:disc_num',
'type' => 'select', 'type' => 'select',
'label' => 'Disc number', 'label' => 'Disc number',
'option' => _getNumArr(0, 9), 'options' => _getNumArr(0, 20),
'id3' => 'Disk'
), ),
array( array(
'element' => 'Description_Mood', ## something wrong in docu!!! 'element' => 'ls:mood',
'type' => 'text', 'type' => 'text',
'label' => 'Mood', 'label' => 'Mood',
'id3' => 'Mood'
), ),
array( array(
'element' => 'dc:publisher', 'element' => 'dc:publisher',
'type' => 'text', 'type' => 'text',
'label' => 'Label', 'label' => 'Label',
'id3' => 'Label'
), ),
array( array(
'element' => 'ls:composer', 'element' => 'ls:composer',
'type' => 'text', 'type' => 'text',
'label' => 'Composer', 'label' => 'Composer',
'id3' => 'Composer'
), ),
array( array(
'element' => 'ls:bitrate', 'element' => 'ls:bitrate',
'type' => 'text', 'type' => 'text',
'label' => 'Bitrate', 'label' => 'Bitrate',
'rule' => 'numeric' 'rule' => 'numeric',
'id3' => 'Bitrate'
), ),
array( array(
'element' => 'ls:channels', 'element' => 'ls:channels',
'type' => 'select', 'type' => 'select',
'label' => 'Channels', 'label' => 'Channels',
'options' => array( 'options' => array(
'' => '', '' => '',
'mono' => 'Mono', 'mono' => 'Mono',
'stereo' => 'Stereo', 'stereo' => 'Stereo',
'5.1' => '5.1' '5.1' => '5.1'
) ),
'id3' => 'Channels'
), ),
array( array(
'element' => 'ls:samplerate', 'element' => 'ls:samplerate',
'type' => 'select', 'type' => 'select',
'label' => 'Sample rate', 'label' => 'Sample rate',
'options' => array() ## vervollständigen! 'options' => array(), ## vervollständigen!
'id3' => 'Samplerate'
), ),
array( array(
'element' => 'ls:encoder', 'element' => 'ls:encoder',
'type' => 'text', 'type' => 'text',
'label' => 'Encoder software used', 'label' => 'Encoder software used',
'id3' => 'Encoder'
), ),
array( array(
'element' => 'ls:crc', 'element' => 'ls:crc',
'type' => 'text', 'type' => 'text',
'label' => 'Checksum', 'label' => 'Checksum',
'rule' => 'numeric' 'rule' => 'numeric',
'id3' => 'CRC'
), ),
array( array(
'element' => 'ls:lyrics', 'element' => 'ls:lyrics',
'type' => 'textarea', 'type' => 'textarea',
'label' => 'Lyrics', 'label' => 'Lyrics',
'id3' => 'Lyrics'
), ),
array( array(
'element' => 'ls:orchestra', 'element' => 'ls:orchestra',
'type' => 'text', 'type' => 'text',
'label' => 'Orchestra or band', 'label' => 'Orchestra or band',
'id3' => 'Orchestra or band'
), ),
array( array(
'element' => 'ls:conductor', 'element' => 'ls:conductor',
'type' => 'text', 'type' => 'text',
'label' => 'Conductor', 'label' => 'Conductor',
'id3' => 'Conductor'
), ),
array( array(
'element' => 'ls:lyricist', 'element' => 'ls:lyricist',
'type' => 'text', 'type' => 'text',
'label' => 'Lyricist', 'label' => 'Lyricist',
'id3' => 'Lyricist'
), ),
array( array(
'element' => 'ls:originallyricist', 'element' => 'ls:originallyricist',
'type' => 'text', 'type' => 'text',
'label' => 'Original lyricist', 'label' => 'Original lyricist',
'id3' => 'Original lyricist'
), ),
array( array(
'element' => 'ls:radiostationname', 'element' => 'ls:radiostationname',
'type' => 'text', 'type' => 'text',
'label' => 'Radio station name', 'label' => 'Radio station name',
'id3' => 'Radio station name'
), ),
array( array(
'element' => 'ls:audiofileinfourl', 'element' => 'ls:audiofileinfourl',
'type' => 'text', 'type' => 'text',
'label' => 'Audio file information web page', 'label' => 'Audio file information web page',
'id3' => 'Audio file information web page'
), ),
array( array(
'rule' => 'regex', 'rule' => 'regex',
@ -321,6 +354,7 @@ $mask = array(
'element' => 'ls:artisturl', 'element' => 'ls:artisturl',
'type' => 'text', 'type' => 'text',
'label' => 'Artist web page', 'label' => 'Artist web page',
'id3' => 'Artist web page'
), ),
array( array(
'rule' => 'regex', 'rule' => 'regex',
@ -332,6 +366,7 @@ $mask = array(
'element' => 'ls:audiosourceurl', 'element' => 'ls:audiosourceurl',
'type' => 'text', 'type' => 'text',
'label' => 'Audio source web page', 'label' => 'Audio source web page',
'id3' => 'Audio source web page'
), ),
array( array(
'rule' => 'regex', 'rule' => 'regex',
@ -343,6 +378,7 @@ $mask = array(
'element' => 'ls:radiostationurl', 'element' => 'ls:radiostationurl',
'type' => 'text', 'type' => 'text',
'label' => 'Radio station web page', 'label' => 'Radio station web page',
'id3' => 'Radio station web page'
), ),
array( array(
'rule' => 'regex', 'rule' => 'regex',
@ -354,6 +390,7 @@ $mask = array(
'element' => 'ls:buycdurl', 'element' => 'ls:buycdurl',
'type' => 'text', 'type' => 'text',
'label' => 'Buy CD web page', 'label' => 'Buy CD web page',
'id3' => 'Buy CD webpage'
), ),
array( array(
'rule' => 'regex', 'rule' => 'regex',
@ -365,23 +402,27 @@ $mask = array(
'element' => 'ls:isrcnumber', 'element' => 'ls:isrcnumber',
'type' => 'text', 'type' => 'text',
'label' => 'ISRC number', 'label' => 'ISRC number',
'rule' => 'numeric' 'rule' => 'numeric',
'id3' => 'ISRC'
), ),
array( array(
'element' => 'ls:catalognumber', 'element' => 'ls:catalognumber',
'type' => 'text', 'type' => 'text',
'label' => 'Catalog number', 'label' => 'Catalog number',
'rule' => 'numeric' 'rule' => 'numeric',
'id3' => 'Catalog'
), ),
array( array(
'element' => 'ls:originalartist', 'element' => 'ls:originalartist',
'type' => 'text', 'type' => 'text',
'label' => 'Original artist', 'label' => 'Original artist',
'id3' => 'Original Artist'
), ),
array( array(
'element' => 'dc:rights', ## ??? 'element' => 'dc:rights', ## ???
'type' => 'text', 'type' => 'text',
'label' => 'Copyright', 'label' => 'Copyright',
'id3' => 'Copyright'
), ),
), ),
'Talk' => array( 'Talk' => array(

View file

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

View file

@ -33,7 +33,7 @@ switch($_REQUEST['act']){
case "replaceFile": case "replaceFile":
$ui_tmpgunid = $uiHandler->gb->_gunidFromId($uiHandler->id); $ui_tmpgunid = $uiHandler->gb->_gunidFromId($uiHandler->id);
if ($uiHandler->delete($uiHandler->id)) { if ($uiHandler->delete($uiHandler->id) === TRUE) {
$ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $uiHandler->pid, $ui_fmask["uploadFile"], $ui_tmpgunid); $ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $uiHandler->pid, $ui_fmask["uploadFile"], $ui_tmpgunid);
$uiHandler->SCRATCHPAD->removeItems($uiHandler->id); $uiHandler->SCRATCHPAD->removeItems($uiHandler->id);
$uiHandler->SCRATCHPAD->addItem($ui_tmpid); $uiHandler->SCRATCHPAD->addItem($ui_tmpid);
@ -47,7 +47,7 @@ switch($_REQUEST['act']){
case "replaceWebstream": case "replaceWebstream":
$ui_tmpgunid = $uiHandler->gb->_gunidFromId($uiHandler->id); $ui_tmpgunid = $uiHandler->gb->_gunidFromId($uiHandler->id);
if ($uiHandler->delete($uiHandler->id)) { if ($uiHandler->delete($uiHandler->id) == TRUE) {
$ui_tmpid = $uiHandler->addWebstream($_REQUEST, $uiHandler->pid, $ui_fmask['addWebstream'], $ui_tmpgunid); $ui_tmpid = $uiHandler->addWebstream($_REQUEST, $uiHandler->pid, $ui_fmask['addWebstream'], $ui_tmpgunid);
$uiHandler->SCRATCHPAD->removeItems($uiHandler->id); $uiHandler->SCRATCHPAD->removeItems($uiHandler->id);
$uiHandler->SCRATCHPAD->addItem($ui_tmpid); $uiHandler->SCRATCHPAD->addItem($ui_tmpid);
@ -149,13 +149,18 @@ switch($_REQUEST['act']){
break; break;
case "PL.activate": case "PL.activate":
$uiHandler->PLAYLIST->activate($_REQUEST['id']);
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
if ($uiHandler->PLAYLIST->activate($_REQUEST['id']) === TRUE) {
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
}
break; break;
case "PL.newUsingItem": case "PL.create":
$uiHandler->PLAYLIST->newUsingItem($_REQUEST['id']);
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
if (($ui_tmpid = $uiHandler->PLAYLIST->create($_REQUEST['id'])) !== FALSE) {
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
}
break; break;
case "PL.addItem": case "PL.addItem":
@ -163,6 +168,11 @@ switch($_REQUEST['act']){
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
break; break;
case "PL.removeItem":
$uiHandler->PLAYLIST->removeItem($_REQUEST['id']);
$uiHandler->PLAYLIST->setReload();
break;
case "PL.release": case "PL.release":
$uiHandler->PLAYLIST->release(); $uiHandler->PLAYLIST->release();
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();

View file

@ -6,6 +6,7 @@
{include file="script/basics.js.tpl"} {include file="script/basics.js.tpl"}
{include file="script/contextMenue.js.tpl"} {include file="script/contextMenue.js.tpl"}
{include file="script/collector.js.tpl"}
</head> </head>
<body> <body>

View file

@ -3,22 +3,41 @@
<div class="standardFrame"> <div class="standardFrame">
{include file="sub/x.tpl"} {include file="sub/x.tpl"}
<div align="center"><b>Simple Playlist Management</b></div> <center>
<br> <form name="PL">
<table border="1">
<tr><th colspan="4">Simple Playlist Management</th></tr>
{PL->get assign='PL'} {PL->get assign='PL'}
{if is_array($PL)} {* already activated Playlist *} {if is_array($PL)} {* already activated Playlist *}
active Playlist: {$PL.children.0.children.0.content}
<br> <tr><th colspan="4">active Playlist: {$PL.children.0.children.0.content}</th></tr>
{foreach from=$PL item=pl} <tr align="center"><td></td><td>Title</td><td>Duration</td><td>Type</td></tr>
{$pl}
<br> {PL->getFlat assign='FLAT'}
{/foreach} {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>
{else} {* no active Playlist *} {else} {* no active Playlist *}
No active Playlist! No active Playlist!
<br> <br>
<input type="button" value="Make new Playlist" onClick="location.href='{$UI_BRWOSER}?act=PL.simpleManagement&createNew=1'"> <input type="button" value="Make new Playlist" onClick="hpopup('{$UI_HANDLER}?act=PL.create')">
{/if} {/if}
</table>
</form>
</div>
</div> </div>

View file

@ -1,7 +1,5 @@
{*Smarty template*} {*Smarty template*}
{include file="script/scratchPad.js.tpl"}
<div id="scratchpad"> <div id="scratchpad">
<center><b>%%ScratchPad%%</b> <center><b>%%ScratchPad%%</b>
{if is_array($SCRATCHPAD)} {if is_array($SCRATCHPAD)}
@ -32,9 +30,9 @@
</tr> </tr>
{/foreach} {/foreach}
<tr style="background-color: {cycle values='#eeeeee, #dadada'}"> <tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<td><input type="checkbox" name="all" onClick="SP_switchAll()"></th> <td><input type="checkbox" name="all" onClick="form_switchAll('SP')"></th>
<td align="center" colspan="2"><a href="#" onClick="SP_submit()">[Remove Selected]</a></th> <td align="center" colspan="2"><a href="#" onClick="form_submit('SP')">[Remove Selected]</a></th>
<td align="center" colspan="2"><a href="#" onClick="SP_clearAll()">[Clear]</a></th> <td align="center" colspan="2"><a href="#" onClick="form_clearAll('SP')">[Clear]</a></th>
</tr> </tr>
</table> </table>
</form> </form>

View file

@ -0,0 +1,38 @@
{*Smarty template*}
{literal}
<script type="text/javascript">
function form_submit(formname)
{
var href = '{/literal}{$UI_HANDLER}?act='+formname+'.removeItem{literal}';
var n;
for (n=0; n < (document.forms[formname].elements.length-1); n++) {
if (document.forms[formname].elements[n].checked) {
href = href + '&id[]=' + document.forms[formname].elements[n].name;
}
}
hpopup(href);
}
function form_switchAll(formname)
{
var n;
for (n=0; n < document.forms[formname].elements.length; n++) {
if (document.forms[formname].elements[n].type == 'checkbox') {
document.forms[formname].elements[n].checked = document.forms[formname].elements['all'].checked;
}
}
}
function form_clearAll(formname)
{
if (confirm("{/literal}{tra 0='Are you sure to remove all Items?'}{literal}")) {
document.forms[formname].elements['all'].checked = true;
form_switchAll(formname);
form_submit(formname);
}
}
</script>
{/literal}

View file

@ -36,12 +36,16 @@ function menu(id) {
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.addItem&id="+id+"')\" "+oF+">&nbsp;Add to active Playlist&nbsp;</a></td></tr>"; menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.addItem&id="+id+"')\" "+oF+">&nbsp;Add to active Playlist&nbsp;</a></td></tr>";
break; break;
case "PL.removeItem":
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.removeItem&id="+id+"')\" "+oF+">&nbsp;Remove Item from Playlist&nbsp;</a></td></tr>";
break;
case "PL.activate": case "PL.activate":
menuHtml = menuHtml + "<tr><td><a class='menu' href=\"javascript: hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.activate&id="+id+"')\" "+oF+">&nbsp;Activate this Playlist&nbsp;</a></td></tr>"; menuHtml = menuHtml + "<tr><td><a class='menu' href=\"javascript: hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.activate&id="+id+"')\" "+oF+">&nbsp;Activate this Playlist&nbsp;</a></td></tr>";
break; break;
case "PL.newUsingItem": case "PL.create":
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.newUsingItem&id="+id+"')\" "+oF+">&nbsp;New Playlist using Item&nbsp;</a></td></tr>"; menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=PL.create&id="+id+"')\" "+oF+">&nbsp;New Playlist using Item&nbsp;</a></td></tr>";
break; break;
case "SP.addItem": case "SP.addItem":
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=SP.addItem&id="+id+"')\" "+oF+">&nbsp;Add to ScratchPad&nbsp;</a></td></tr>"; menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=SP.addItem&id="+id+"')\" "+oF+">&nbsp;Add to ScratchPad&nbsp;</a></td></tr>";

View file

@ -1,38 +0,0 @@
{*Smarty template*}
{literal}
<script type="text/javascript">
function SP_submit()
{
var href = '{/literal}{$UI_HANDLER}?act=SP.removeItem{literal}';
var n;
for (n=0; n < (document.forms['SP'].elements.length-1); n++) {
if (document.forms['SP'].elements[n].checked) {
href = href + '&id[]=' + document.forms['SP'].elements[n].name;
}
}
hpopup(href, 'SP');
}
function SP_switchAll()
{
var n;
for (n=0; n < document.forms['SP'].elements.length; n++) {
if (document.forms['SP'].elements[n].type == 'checkbox') {
document.forms['SP'].elements[n].checked = document.forms['SP'].elements['all'].checked;
}
}
}
function SP_clearAll()
{
if (confirm("{/literal}{tra 0='Are you sure to clear ScratchPad?'}{literal}")) {
document.forms['SP'].elements['all'].checked = true;
SP_switchAll();
SP_submit();
}
}
</script>
{/literal}

View file

@ -6,7 +6,7 @@ onContextmenu="return menu('{$i.id}'
{if $PLid} {if $PLid}
, 'PL.addItem' , 'PL.addItem'
{else} {else}
, 'PL.newUsingItem' , 'PL.create'
{/if} {/if}
, 'delete' , 'delete'
{/if} {/if}
@ -19,7 +19,7 @@ onContextmenu="return menu('{$i.id}'
, 'PL.addItem', 'delete' , 'PL.addItem', 'delete'
{/if} {/if}
{else} {else}
, 'PL.activate', 'PL.newUsingItem', 'delete' , 'PL.activate', 'PL.create', 'delete'
{/if} {/if}
{/if} {/if}
{$moreContextAfter} {$moreContextAfter}

View file

@ -110,9 +110,9 @@ class uiBase
function loadStationPrefs(&$mask) function loadStationPrefs(&$mask, $reload=FALSE)
{ {
if (!is_array($this->STATIONPREFS)) { if (!is_array($this->STATIONPREFS || $reload===TRUE)) {
foreach ($mask as $key=>$val) { foreach ($mask as $key=>$val) {
if ($val['isPref']) { if ($val['isPref']) {
if (is_string($setting = $this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element']))) { if (is_string($setting = $this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element']))) {
@ -254,43 +254,26 @@ class uiBase
$s = $ia['playtime_seconds']; $s = $ia['playtime_seconds'];
$extent = date('H:i:s', floor($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.')); $extent = date('H:i:s', floor($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.'));
if ($format=='array') { if ($format=='text') {
return array( return "<div align='left'><pre>".var_export($ia, TRUE)."</pre></div>";
'Format.Extent' => $extent,
'Format.Medium.Bitrate' => $ia['audio']['bitrate'],
'Format.Medium.Channels' => $ia['audio']['channelmode'],
'Format.Medium.Samplerate' => $ia['audio']['sample_rate'],
'Format.Medium.Encoder' => $ia['audio']['codec'] ? $ia['audio']['codec'] : $ia['audio']['encoder'],
);
} elseif ($format=='text') {
#print_r($ia);
return "fileformat: {$ia['fileformat']}<br>
seconds: {$ia['playtime_seconds']}<br>
length: $extent<br>
channels: {$ia['audio']['channels']}<br>
sample_rate: {$ia['audio']['sample_rate']}<br>
bits_per_sample: {$ia['audio']['bits_per_sample']}<br>
channelmode: {$ia['audio']['channelmode']}<br>
title: {$ia['id3v1']['title']}<br>
artist: {$ia['id3v1']['artist']}<br>
comment: {$ia['id3v1']['comment']}";
} elseif ($format=='xml') { } elseif ($format=='xml') {
return return
'<?xml version="1.0" encoding="utf-8"?> '<?xml version="1.0" encoding="utf-8"?>
<audioClip> <audioClip>
<metadata <metadata
xmlns="http://www.streamonthefly.org/" xmlns="http://www.streamonthefly.org/"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcterms="http://purl.org/dc/terms/"
xmlns:xbmf="http://www.streamonthefly.org/xbmf" xmlns:xbmf="http://www.streamonthefly.org/xbmf"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >
<dc:title>'.$this->_getFileTitle($id).'</dc:title> <dc:title>'.$this->_getFileTitle($id).'</dc:title>
<dcterms:extent>'.date('H:i:s', round($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.')).'</dcterms:extent> <dcterms:extent>'.date('H:i:s', round($s)-date('Z')).substr(number_format($s, 6), strpos(number_format($s, 6), '.')).'</dcterms:extent>
</metadata> </metadata>
</audioClip>'; </audioClip>';
} }
return FALSE;
} }
@ -331,9 +314,9 @@ class uiBase
{ {
$data = array('id' => $id, $data = array('id' => $id,
'gunid' => $this->gb->_gunidFromId($id), 'gunid' => $this->gb->_gunidFromId($id),
'title' => $this->_getMDataValue($id, 'title'), 'title' => $this->_getMDataValue($id, UI_MDATA_KEY_TITLE),
'creator' => $this->_getMDataValue($id, 'creator'), 'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_ARTIST),
'duration' => $this->_niceTime($this->_getMDataValue($id, 'dcterms:extent')), 'duration' => $this->_niceTime($this->_getMDataValue($id, UI_MDATA_KEY_DURATION)),
'type' => $this->gb->getFileType($id), 'type' => $this->gb->getFileType($id),
); );
return ($data); return ($data);
@ -342,6 +325,9 @@ class uiBase
function _niceTime($in) function _niceTime($in)
{ {
if(is_array($in)) {
$in = current($in);
}
list ($in, $lost) = explode('.', $in); list ($in, $lost) = explode('.', $in);
if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in)) if (preg_match('/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/', $in))
list($h, $i, $s) = explode(':', $in); list($h, $i, $s) = explode(':', $in);

View file

@ -133,7 +133,7 @@ class uiBrowser extends uiBase {
} }
foreach ($data['listdata'] as $key=>$val) { foreach ($data['listdata'] as $key=>$val) {
if ($val['type'] != 'Folder') if ($val['type'] != 'Folder')
$data['listdata'][$key]['title'] = $this->_getMDataValue($val['id'], 'title'); $data['listdata'][$key]['title'] = $this->_getMDataValue($val['id'], UI_MDATA_KEY_TITLE);
else else
$data['listdata'][$key]['title'] = $val['name']; $data['listdata'][$key]['title'] = $val['name'];
} }
@ -371,7 +371,7 @@ class uiBrowser extends uiBase {
); );
## convert element names to be unique over different forms-parts, add javascript to spread values over parts, add existing values from database ## convert element names to be unique over different forms-parts, add javascript to spread values over parts, add existing values from database
foreach ($mask['tabs']['group']['group'] as $key) { foreach ($mask['pages'] as $key=>$val) {
foreach ($mask['pages'][$key] as $k=>$v) { foreach ($mask['pages'][$key] as $k=>$v) {
$mask['pages'][$key][$k]['element'] = $key.'___'.$this->_formElementEncode($v['element']); $mask['pages'][$key][$k]['element'] = $key.'___'.$this->_formElementEncode($v['element']);
$mask['pages'][$key][$k]['attributes'] = array_merge($mask['pages'][$key][$k]['attributes'], array('onChange' => "spread(this, '".$this->_formElementEncode($v['element'])."')")); $mask['pages'][$key][$k]['attributes'] = array_merge($mask['pages'][$key][$k]['attributes'], array('onChange' => "spread(this, '".$this->_formElementEncode($v['element'])."')"));

View file

@ -161,12 +161,34 @@ class uiHandler extends uiBase {
$this->redirUrl = UI_BROWSER."?act=uploadFile&id=".$pid; $this->redirUrl = UI_BROWSER."?act=uploadFile&id=".$pid;
return FALSE; return FALSE;
} }
$this->gb->replaceMetadata($r, $this->_analyzeFile($r, 'xml'), 'string', $this->sessid);
$this->transMData($r);
$this->redirUrl = UI_BROWSER."?act=editMetaData&id=$r"; $this->redirUrl = UI_BROWSER."?act=editMetaData&id=$r";
return $r; return $r;
} }
function transMData($id)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';
$this->gb->replaceMetadata($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid);
$ia = $this->gb->analyzeFile($id, $this->sessid);
foreach ($mask['pages'] as $key=>$val) {
foreach ($mask['pages'][$key] as $k=>$v) {
if ($v['id3'] != FALSE) {
$key = strtolower($v['id3']);
if ($ia['comments'][$key][0]) {
$this->_setMdataValue($id, $v['element'], $ia['comments'][$key][0]);
#echo "E: ".$v['element']." V: ".$ia['comments'][$key][0]."<br>";
}
}
}
}
}
/** /**
* addWebstream * addWebstream
* *
@ -507,7 +529,7 @@ class uiHandler extends uiBase {
## first remove old entrys ## first remove old entrys
$this->gb->replaceMetaData($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid); $this->gb->replaceMetaData($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid);
foreach ($mask['tabs']['group']['group'] as $key) { foreach ($mask['pages'] as $key=>$val) {
foreach ($mask['pages'][$key] as $k=>$v) { foreach ($mask['pages'][$key] as $k=>$v) {
$formdata[$key.'___'.$this->_formElementEncode($v['element'])] ? $mData[$this->_formElementDecode($v['element'])] = $formdata[$key.'___'.$this->_formElementEncode($v['element'])] : NULL; $formdata[$key.'___'.$this->_formElementEncode($v['element'])] ? $mData[$this->_formElementDecode($v['element'])] = $formdata[$key.'___'.$this->_formElementEncode($v['element'])] : NULL;
} }
@ -574,7 +596,7 @@ class uiHandler extends uiBase {
$this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']]); $this->gb->saveGroupPref($this->sessid, 'StationPrefs', $val['element'], $formdata[$val['element']]);
else else
$this->gb->delGroupPref($this->sessid, 'StationPrefs', $val['element']); $this->gb->delGroupPref($this->sessid, 'StationPrefs', $val['element']);
$this->STATIONPREFS[$val['element']] = is_string($this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element'])) ? $this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element']) : NULL; #$this->STATIONPREFS[$val['element']] = is_string($this->gb->loadGroupPref(NULL, 'StationPrefs', $val['element'])) ? $this->gb->loadGroupPref($this->sessid, 'StationPrefs', $val['element']) : NULL;
} }
if ($val['type'] == 'file' && $formdata[$val['element']]['name']) { if ($val['type'] == 'file' && $formdata[$val['element']]['name']) {
if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath'))) if (FALSE === @move_uploaded_file($formdata[$val['element']]['tmp_name'], $this->gb->loadGroupPref($this->sessid, 'StationPrefs', 'stationLogoPath')))
@ -582,7 +604,7 @@ class uiHandler extends uiBase {
return; return;
} }
} }
$this->loadStationPrefs($mask, TRUE);
$this->_retMsg('Settings saved'); $this->_retMsg('Settings saved');
return TRUE; return TRUE;
} }

View file

@ -19,6 +19,7 @@ class uiPlaylist
if (!$this->activeId) { if (!$this->activeId) {
return FALSE; return FALSE;
} }
#print_r( $this->Base->gb->getPlaylistArray($this->activeId, $this->Base->sessid));
return $this->Base->gb->getPlaylistArray($this->activeId, $this->Base->sessid); return $this->Base->gb->getPlaylistArray($this->activeId, $this->Base->sessid);
} }
@ -40,7 +41,7 @@ class uiPlaylist
$this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $this->token); $this->Base->gb->savePref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY, $this->token);
#$this->active = $this->Base->gb->getPlaylistArray($plid, $this->Base->sessid); #$this->active = $this->Base->gb->getPlaylistArray($plid, $this->Base->sessid);
$this->activeId = $plid; $this->activeId = $plid;
$this->Base->_retMsg('Playlist "$1" activated', $this->Base->_getMDataValue($plid, 'title')); $this->Base->_retMsg('Playlist "$1" activated', $this->Base->_getMDataValue($plid, UI_MDATA_KEY_TITLE));
return TRUE; return TRUE;
} }
@ -55,7 +56,7 @@ class uiPlaylist
return FALSE; return FALSE;
} }
$plgunid = $this->Base->gb->releaseLockedPlaylist($this->token, $this->Base->sessid); $plgunid = $this->Base->gb->releaseLockedPlaylist($this->token, $this->Base->sessid);
$this->Base->_retMsg('Playlist "$1" released', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), 'title')); $this->Base->_retMsg('Playlist "$1" released', $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($plgunid), UI_MDATA_KEY_TITLE));
$this->activeId = NULL; $this->activeId = NULL;
$this->token = NULL; $this->token = NULL;
$this->Base->gb->delPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY); $this->Base->gb->delPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY);
@ -74,55 +75,74 @@ class uiPlaylist
function addItem($id) function addItem($id)
{ {
if (!$this->Base->gb->addAudioClipToPlaylist($this->token, $id, $this->Base->sessid)) { if ($this->Base->gb->addAudioClipToPlaylist($this->token, $id, $this->Base->sessid) === FALSE) {
$this->Base_retMsg('Cannot add File to Playlist'); $this->Base_retMsg('Cannot add Item to Playlist');
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
function removeItem($id) function removeItem($gunids)
{ {
if (!$gunids) {
$this->Base->_retMsg('No Item(s) given');
return FALSE;
}
if (!is_array($gunids))
$gunids = array($gunids);
foreach ($gunids as $gunid) {
if ($this->Base->gb->delAudioClipFromPlaylist($this->token, $this->Base->gb->_idFromGunid($gunid), $this->Base->sessid) !== TRUE) {
$this->Base->_retMsg('Cannot remove Item from Playlist');
return FALSE;
}
}
return TRUE;
} }
function newUsingItem($id) function create($id=FALSE)
{ {
# create PL # create PL
# activate # activate
# add clip # add clip if given
if ($this->testNew() === FALSE) { if (is_array($this->activeId)) {
$this->Base->_retMsg('Already active Playlist'); $this->Base->_retMsg('Already active Playlist');
return FALSE; return FALSE;
} }
$this->addItem($id); $datetime = date('Y-m-d H:i:s');
return TRUE; if (!$plid = $this->Base->gb->createPlaylist($this->Base->homeid, $datetime, $this->Base->sessid)) {
}
function createEmpty()
{
if (!$plid = $this->Base->gb->createPlaylist($this->Base->homeid, date('Y-M-D H-i-s'), $this->Base->sessid)) {
$this->Base->_retMsg('Cannot create Playlist'); $this->Base->_retMsg('Cannot create Playlist');
return FALSE; return FALSE;
} }
$this->Base->_setMDataValue($plid, 'dc:title', 'empty'); $this->Base->_setMDataValue($plid, 'dc:title', $datetime);
if ($this->activate($plid)===FALSE) {
return FALSE;
}
if ($id!==FALSE) {
if ($this->addItem($id)!==TRUE) {
return FALSE;
}
}
return $plid; return $plid;
} }
function testNew()
{
# if exists -> return false
# else
# create empty
# activate
if (is_array($this->activeId)) { function getFlat()
return FALSE; {
$this->plwalk($this->get(), 0);
return $this->flat;
}
function plwalk($arr, $parent)
{
foreach ($arr['children'] as $node=>$sub) {
if ($sub['elementname']=='playlistelement') {
$this->plwalk($sub, $node);
}
if ($sub['elementname']=='audioclip') {
$this->flat["$parent.$node"] = $sub['attrs'];
}
} }
$plid = $this->createEmpty();
$this->activate($plid);
return TRUE;
} }
} }

View file

@ -89,10 +89,12 @@ class uiScratchPad
function removeItems($ids) function removeItems($ids)
{ {
if (!$ids) if (!$ids) {
return FALSE; ## empty parameter $this->Base->_retMsg('No Item(s) given');
return FALSE;
}
if (!is_array($ids)) if (!is_array($ids))
$ids = array($ids); ## just single id given $ids = array($ids);
foreach ($ids as $id) { foreach ($ids as $id) {
#$info = $this->Base->_getMetaInfo($id); #$info = $this->Base->_getMetaInfo($id);

View file

@ -18,7 +18,7 @@ class uiSearch
{ {
include dirname(__FILE__).'/formmask/metadata.inc.php'; include dirname(__FILE__).'/formmask/metadata.inc.php';
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$form->setConstants(array('id'=>$id, 'counter'=>UI_SEARCH_MIN_ROWS)); $form->setConstants(array('id'=>$id, 'counter'=>$this->criteria['counter'] ? $this->criteria['counter'] : UI_SEARCH_MIN_ROWS));
foreach ($mask['tabs']['group']['group'] as $k=>$v) { foreach ($mask['tabs']['group']['group'] as $k=>$v) {
foreach ($mask['pages'][$v] as $val){ foreach ($mask['pages'][$v] as $val){
@ -32,7 +32,7 @@ class uiSearch
for($n=1; $n<=UI_SEARCH_MAX_ROWS; $n++) { for($n=1; $n<=UI_SEARCH_MAX_ROWS; $n++) {
unset ($group); unset ($group);
$form->addElement('static', 's1', NULL, "<div id='searchRow_$n'>"); $form->addElement('static', 's1', NULL, "<div id='searchRow_$n'>");
if ($n > UI_SEARCH_MIN_ROWS) $form->addElement('static', 's1_style', NULL, "<style type='text/css'>#searchRow_$n {visibility : hidden; height : 0px;}</style>"); if ($n>UI_SEARCH_MIN_ROWS && $n>$this->criteria['counter']) $form->addElement('static', 's1_style', NULL, "<style type='text/css'>#searchRow_$n {visibility : hidden; height : 0px;}</style>");
$sel = &$form->createElement('hierselect', "row_$n", NULL); $sel = &$form->createElement('hierselect', "row_$n", NULL);
$sel->setOptions(array($col1, $col2)); $sel->setOptions(array($col1, $col2));
$group[] = &$sel; $group[] = &$sel;
@ -61,16 +61,18 @@ class uiSearch
$this->criteria['operator'] = $formdata['operator']; $this->criteria['operator'] = $formdata['operator'];
$this->criteria['filetype'] = $formdata['filetype']; $this->criteria['filetype'] = $formdata['filetype'];
$this->criteria['limit'] = $formdata['limit']; $this->criteria['limit'] = $formdata['limit'];
$this->criteria['counter'] = 0;
$this->criteria['form']['operator'] = $formdata['operator']; ## $criteria['form'] is used for retransfer to form ## $this->criteria['form']['operator'] = $formdata['operator']; ## $criteria['form'] is used for retransfer to form ##
$this->criteria['form']['filetype'] = $formdata['filetype']; $this->criteria['form']['filetype'] = $formdata['filetype'];
$this->criteria['form']['limit'] = $formdata['limit']; $this->criteria['form']['limit'] = $formdata['limit'];
foreach ($formdata as $key=>$val) { foreach ($formdata as $key=>$val) {
if (is_array($val) && strlen($val[2])) { if (is_array($val) && strlen($val[2])) {
$this->criteria['counter']++;
$this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]), $this->criteria['conditions'][$key] = array('cat' => $this->Base->_formElementDecode($val[0]),
'op' => $val[1], 'op' => $val[1],
'val' => stripslashes($val[2])); 'val' => stripslashes($val[2]));
$this->criteria['form'][$key] = array(0 => $this->Base->_formElementDecode($val[0]), $this->criteria['form'][$key] = array(0 => $val[0],
1 => $val[1], 1 => $val[1],
2 => stripslashes($val[2])); 2 => stripslashes($val[2]));
} }
@ -129,7 +131,8 @@ class uiSearch
function clear() function clear()
{ {
#$this->results = NULL; #$this->results = NULL;
$this->criteria['form'] = NULL; $this->criteria['form'] = NULL;
$this->criteria['counter'] = NULL;
$this->setReload(); $this->setReload();
} }