*** empty log message ***

This commit is contained in:
sebastian 2005-03-14 17:38:33 +00:00
parent c7ba993c18
commit 5f5a6c65b5
25 changed files with 280 additions and 91 deletions

View file

@ -1,8 +1,8 @@
<?php <?php
$Smarty->register_object('UIBROWSER', $uiBrowser); $Smarty->register_object('UIBROWSER', $uiBrowser);
$Smarty->register_object('PL', $uiBrowser->PLAYLIST);
$Smarty->register_object('BROWSE', $uiBrowser->BROWSE); $Smarty->register_object('BROWSE', $uiBrowser->BROWSE);
$Smarty->register_object('SEARCH', $uiBrowser->SEARCH); $Smarty->register_object('SEARCH', $uiBrowser->SEARCH);
$Smarty->assign_by_ref ('PL', $uiBrowser->PLAYLIST);
$Smarty->assign_by_ref ('SCHEDULER', $uiBrowser->SCHEDULER); $Smarty->assign_by_ref ('SCHEDULER', $uiBrowser->SCHEDULER);
$Smarty->register_function('str_repeat', 'S_str_repeat'); $Smarty->register_function('str_repeat', 'S_str_repeat');

View file

@ -4,7 +4,6 @@ $mask = array(
array( array(
'element' => 'act', 'element' => 'act',
'type' => 'hidden', 'type' => 'hidden',
'constant'=> 'editMetaData'
), ),
array( array(
'element' => 'id', 'element' => 'id',
@ -502,6 +501,35 @@ $mask = array(
'label' => 'Copyright', 'label' => 'Copyright',
), ),
) )
),
'playlist' => array(
array(
'element' => 'dc:title',
'type' => 'text',
'label' => 'Title',
'required' => TRUE,
'id3' => 'Title'
),
array(
'element' => 'dc:creator',
'type' => 'text',
'label' => 'Creator',
'required' => TRUE,
'id3' => 'Artist'
),
array(
'element' => 'dcterms:extent',
'type' => 'text',
'label' => 'Length',
'attributes'=> array('readonly' => 'on'),
'id3' => FALSE
),
array(
'element' => 'dc:description',
'type' => 'textarea',
'label' => 'Description',
'id3' => 'Comment'
),
) )
); );
?> ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

View file

@ -159,6 +159,11 @@ if ($uiBrowser->userid) {
$Smarty->assign('PL_simpleManagement', TRUE); $Smarty->assign('PL_simpleManagement', TRUE);
break; break;
case "PL.editMetaData":
$Smarty->assign('PL_editMetaData', TRUE);
$Smarty->assign('PL_simpleManagement', TRUE);
break;
case "SCHEDULER": case "SCHEDULER":
$Smarty->assign('showScheduler', TRUE); $Smarty->assign('showScheduler', TRUE);
break; break;

View file

@ -226,6 +226,10 @@ switch($_REQUEST['act']){
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
break; break;
case "PL.editMetaData":
$uiHandler->PLAYLIST->editMetaData($_REQUEST);
break;
case "SCHEDULER.set": case "SCHEDULER.set":
$uiHandler->SCHEDULER->set($_REQUEST); $uiHandler->SCHEDULER->set($_REQUEST);
$uiHandler->SCHEDULER->setReload(); $uiHandler->SCHEDULER->setReload();
@ -233,7 +237,7 @@ switch($_REQUEST['act']){
case "SCHEDULER.uploadPlaylistMethod": case "SCHEDULER.uploadPlaylistMethod":
$uiHandler->SCHEDULER->uploadPlaylistMethod($_REQUEST); $uiHandler->SCHEDULER->uploadPlaylistMethod($_REQUEST);
$uiHandler->SCHEDULER->setReload(); $uiHandler->SCHEDULER->setReload();
break; break;
default: default:

View file

@ -10,7 +10,7 @@
{$editItem.type|capitalize} {$editItem.type|capitalize}
</h4> </h4>
{if $editItem.type == 'audioclip'} {if $editItem.type == 'audioclip' || $editItem.type == 'file'}
<input type="button" onClick="showData()" value="Data"> <input type="button" onClick="showData()" value="Data">
<input type="button" onClick="showMData()" value="MData"> <input type="button" onClick="showMData()" value="MData">
<div id="div_Data"> <div id="div_Data">

View file

@ -1,4 +1,4 @@
{PL->getActiveId assign=_PL_activeId} {assign var="_PL_activeId" value=$PL->getActiveId()}
<div id="objects"> <div id="objects">
{include file="sub/x.tpl"} {include file="sub/x.tpl"}
@ -8,7 +8,7 @@
<tr bgcolor="{cycle values='#eeeeee, #dadada"'}"> <tr bgcolor="{cycle values='#eeeeee, #dadada"'}">
<th>Title</th> <th>Title</th>
<th>Type</th> <th>Type</th>
<td align="right" width='70%'> &nbsp; <td align="right" width='70%'> &nbsp;
{if $START.pid}<a href="{$UI_BROWSER}?act=fileList&id={$START.pid}">[go up]</a>{/if} {if $START.pid}<a href="{$UI_BROWSER}?act=fileList&id={$START.pid}">[go up]</a>{/if}
</td> </td>
</tr> </tr>

View file

@ -1,8 +1,9 @@
<form name="PL">
<table border="0">
<tr><th colspan="4">active Playlist: {$PL.children.0.children.0.content}</th></tr> <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> <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=$PL->getFlat() key='pos' item='i'}
{foreach from=$FLAT key='pos' item='i'}
<!-- {$n++} --> <!-- {$n++} -->
<tr onMouseOver="highlight()" <tr onMouseOver="highlight()"
onMouseOut="darklight()" onMouseOut="darklight()"
@ -42,5 +43,7 @@
<td><input type="button" value="Save" onClick="hpopup('{$UI_HANDLER}?act=PL.save')"></td> <td><input type="button" value="Save" onClick="hpopup('{$UI_HANDLER}?act=PL.save')"></td>
<td><input type="button" value="Revert" onClick="hpopup('{$UI_HANDLER}?act=PL.revert')"></td> <td><input type="button" value="Revert" onClick="hpopup('{$UI_HANDLER}?act=PL.revert')"></td>
<td><input type="button" value="Release" onClick="hpopup('{$UI_HANDLER}?act=PL.release')"></td> <td><input type="button" value="Release" onClick="hpopup('{$UI_HANDLER}?act=PL.release')"></td>
<td><input type="button" value="Delete" onClick="hpopup('{$UI_HANDLER}?act=PL.delete')"></td> <td><input type="button" value="MData" onClick="location.href='{$UI_BROWSER}?act=PL.editMetaData'"></td>
</tr> </tr>
</table>
</form>

View file

@ -0,0 +1,18 @@
{assign var="_form" value=$PL->metaDataForm()}
{assign var="dynform" value=$_form.main}
{$_form.langswitch}
{include file="sub/dynForm_plain.tpl"}
<script type="text/javascript">
{literal}
function switchMDataLang()
{
if (validate_editMetaData(document.forms['editMetaData'])) {
document.forms['editMetaData'].elements['langid'].value = document.forms['langswitch'].elements['langid'].value;
document.forms['editMetaData'].submit();
}
return false;
}
{/literal}
</script>

View file

@ -1,32 +1,22 @@
{*Smarty template*}
<div class="standardFrame"> <div class="standardFrame">
{include file="sub/x.tpl"} {include file="sub/x.tpl"}
<center> <center>
<form name="PL"> <h4>Simple Playlist Management</h4>
<table border="0">
<tr><th colspan="4">Simple Playlist Management</th></tr>
{PL->get assign='PL'} {if is_array($PL->get())} {* already activated Playlist *}
{PL->reportLookedPL assign="_looked"} {if $PL_editMetaData}
{include file="playlist/metadata.tpl"}
{if is_array($PL)} {* already activated Playlist *} {else}
{include file="playlist/editor.tpl"} {include file="playlist/editor.tpl"}
{else} {* no active Playlist *} {/if}
{else} {* no active Playlist *}
<tr> {if $PL->reportLookedPL()}
<td colspan="4"> <input type="button" value="Unlook crashed Playlist" onClick="hpopup('{$UI_HANDLER}?act=PL.unlook')">
{if $_looked} {else}
<input type="button" value="Unlook crashed Playlist" onClick="hpopup('{$UI_HANDLER}?act=PL.unlook')"> <input type="button" value="New empty Playlist" onClick="hpopup('{$UI_HANDLER}?act=PL.create')">
{else} {/if}
<input type="button" value="New empty Playlist" onClick="hpopup('{$UI_HANDLER}?act=PL.create')">
{/if}
</td>
</tr>
{/if} {/if}
</table> </center>
</form>
</div>
</div> </div>

View file

@ -0,0 +1,7 @@
onMouseOver="highlight()"
onMouseOut="darklight()"
onContextmenu="return menu('{$_hour}', {$moreContextBefore} 'SCHEDULER.schedule' {$moreContextAfter})"
{assign var="moreContextBefore" value=""}
{assign var="moreContextAfter" value=""}

View file

@ -1,16 +1,74 @@
{$SCHEDULER->buildDay()} {$SCHEDULER->buildDay()}
{assign var="_usage" value=$SCHEDULER->getDayUsage($SCHEDULER->curr.year, $SCHEDULER->curr.month, $SCHEDULER->curr.day)}
<table border=1> <table border=1>
{foreach from=$SCHEDULER->Day item="_Hour"} {foreach from=$SCHEDULER->Day item="_Hour"}
{assign var="_hour" value=$_Hour.hour} {assign var="_hour" value=$_Hour.hour}
{assign var="_border" value=""}
<tr> <tr>
<td {include file="scheduler/contextmenu.tpl"}> <td {include file="scheduler/contextmenu.tpl"}>
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&hour={$_Hour.hour}')">{$_Hour.hour} <a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&hour={$_Hour.hour}')">{$_Hour.hour}
</td> </td>
<td>
{foreach from=$_usage item="_entry"}
{if $_entry.timestamp >= $_Hour.timestamp && $_entry.timestamp < $_Hour.timestamp+3600}
{$_border}
<b>{$_entry.title}</b>
{$_entry.start|regex_replace:"/[0-9]+T/":""|truncate:5:""}-{$_entry.end|regex_replace:"/[0-9]+T/":""|truncate:5:""}
{$_entry.creator}
{assign var="_border" value="|"}
{/if}
{/foreach}
</td>
</tr> </tr>
{/foreach} {/foreach}
</table> </table>
{* timing-ansich
{assign var="_divisor" value=180}
{assign var="_minwidth" value=10}
<table border=1>
<tr>
<td valign="top">
<b>{$SCHEDULER->curr.year}-{$SCHEDULER->curr.month}-{$SCHEDULER->curr.day}</b></a>
{assign var="_oneday" value=$SCHEDULER->getDayTiming($SCHEDULER->curr.year, $SCHEDULER->curr.month, $SCHEDULER->curr.day)}
<table border="0" cellspacing="0" cellpadding="0">
{foreach from=$_oneday item="i"}
<tr height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}" style="font-family: monospace" valign="top">
{if is_array($i.entry)}
<td bgcolor="#ffcacb" width="600" height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}" {include file="scheduler/contextmenu.tpl"}>
{if $i.length/$_divisor > $_minwidth}
<small>
<b>{$i.entry.title}</b>
{$i.entry.start|regex_replace:"/[0-9]+T/":""}-{$i.entry.end|regex_replace:"/[0-9]+T/":""}
{$i.entry.creator}
</small>
{/if}
</td>
{else}
<td bgcolor="#97bacf" width="600" height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}">
</td>
{/if}
</tr>
{/foreach}
</table>
</td>
</tr>
</table>
*}

View file

@ -24,7 +24,7 @@
<td>&nbsp;</td> <td>&nbsp;</td>
{else} {else}
<td width="80"> <td width="80">
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}')">{$_Day.day} <a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&view=day&&day={$_Day.day}')"><b>{$_Day.day}</b>
<div><img src="img/percentage_red.png" width="{if $percentage>50}{$percentage}{elseif $percentage>0}{$percentage+2}{else}0{/if}%" height="10" border="0"><img src="img/percentage_blue.png" width="{if $percentage>50}{$null-$percentage+100}{elseif $percentage>0}{$NULL-$percentage-2+100}{else}100{/if}%" height="10" border="0"></div> <div><img src="img/percentage_red.png" width="{if $percentage>50}{$percentage}{elseif $percentage>0}{$percentage+2}{else}0{/if}%" height="10" border="0"><img src="img/percentage_blue.png" width="{if $percentage>50}{$null-$percentage+100}{elseif $percentage>0}{$NULL-$percentage-2+100}{else}100{/if}%" height="10" border="0"></div>
</td> </td>
{/if} {/if}

View file

@ -7,7 +7,7 @@
<tr> <tr>
<td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=--')"><<</a> </td> <td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=--')"><<</a> </td>
{foreach from=$SCHEDULER->Week item="_Weekday"} {foreach from=$SCHEDULER->Week item="_Weekday"}
<td>{$_Weekday.label.full}</td> <th>{$_Weekday.label.full}</th>
{/foreach} {/foreach}
<td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=%2B%2B')">>></a></td> <td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=%2B%2B')">>></a></td>
</tr> </tr>
@ -17,29 +17,29 @@
<td valign="top"> <td valign="top">
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&view=day&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')"><b>{$_Day.day}</b></a> <a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&view=day&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')"><b>{$_Day.day}</b></a>
{assign var="_oneday" value=$SCHEDULER->getDayTiming($_Day.year, $_Day.month, $_Day.day)} {assign var="_oneday" value=$SCHEDULER->getDayTiming($_Day.year, $_Day.month, $_Day.day)}
<table border="0" cellspacing="0" cellpadding="0"> <table border="0" cellspacing="0" cellpadding="0">
{foreach from=$_oneday item="i"}
{foreach from=$_oneday item="i"} <tr height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}" style="font-family: monospace" valign="top">
<tr height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}" style="font-family: monospace" valign="top"> {if is_array($i.entry)}
{if is_array($i.entry)} <td bgcolor="#ffcacb" width="100" height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}" onMouseover="" onMouseout="">
<td bgcolor="pink" width="80" height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}"> {if $i.length/$_divisor > $_minwidth}
{if $i.length/$_divisor > $_minwidth} <small>
<small> <b>{$i.entry.title}</b>
Start:{$i.entry.start|regex_replace:"/[0-9]+T/":""} <br>
<br> {$i.entry.start|regex_replace:"/[0-9]+T/":""|truncate:5:""}-{$i.entry.end|regex_replace:"/[0-9]+T/":""|truncate:5:""}
End:&nbsp;&nbsp;{$i.entry.end|regex_replace:"/[0-9]+T/":""} <br>
</small> {$i.entry.creator}
{/if} </small>
</td>
{else}
<td bgcolor="lightblue" width="80" height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}">
</td>
{/if} {/if}
</tr> </td>
{/foreach} {else}
<td bgcolor="#97bacf" width="100" height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}">
</table> </td>
{/if}
</tr>
{/foreach}
</table>
</td> </td>
{/foreach} {/foreach}

View file

@ -1,4 +1,4 @@
{PL->getActiveId assign=_PL_activeId} {assign var="_PL_activeId" value=$PL->getActiveId()}
<div id="scratchpad"> <div id="scratchpad">
<center><b>%%ScratchPad%%</b> <center><b>%%ScratchPad%%</b>

View file

@ -1,4 +1,4 @@
{PL->getActiveId assign=_PL_activeId} {assign var="_PL_activeId" value=$PL->getActiveId()}
onMouseOver="highlight()" onMouseOver="highlight()"
onMouseOut="darklight()" onMouseOut="darklight()"

View file

@ -307,7 +307,7 @@ class uiBase
$data = array('id' => $id, $data = array('id' => $id,
'gunid' => $this->gb->_gunidFromId($id), 'gunid' => $this->gb->_gunidFromId($id),
'title' => $this->_getMDataValue($id, UI_MDATA_KEY_TITLE), 'title' => $this->_getMDataValue($id, UI_MDATA_KEY_TITLE),
'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_ARTIST), 'creator' => $this->_getMDataValue($id, UI_MDATA_KEY_CREATOR),
'duration' => $this->_niceTime($this->_getMDataValue($id, UI_MDATA_KEY_DURATION)), 'duration' => $this->_niceTime($this->_getMDataValue($id, UI_MDATA_KEY_DURATION)),
'type' => $this->gb->getFileType($id), 'type' => $this->gb->getFileType($id),
); );
@ -336,7 +336,7 @@ class uiBase
function _getMDataValue($id, $key) function _getMDataValue($id, $key)
{ {
if (is_array($arr = $this->gb->getMDataValue($id, $key, $this->sessid))) { if (is_array($arr = $this->gb->getMDataValue($id, $key, $this->sessid))) {
$value = current($arr); $value = current($arr);
return $value['value']; return $value['value'];

View file

@ -63,12 +63,10 @@ class uiBrowse
} }
## just to change limit and file-type ## just to change limit and file-type
$form = new HTML_QuickForm('shitcher', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('switch', UI_STANDARD_FORM_METHOD, UI_HANDLER);
#$mask2['browse_global']['limit']['default'] = $this->criteria['limit'];
#$mask2['browse_global']['filetype']['default'] = $this->criteria['filetype'];
$this->Base->_parseArr2Form($form, $mask2['browse_global']); $this->Base->_parseArr2Form($form, $mask2['browse_global']);
$form->setDefaults(array('limit' => $this->criteria['limit'], $form->setDefaults(array('limit' => $this->criteria['limit'],
'filetype' => $this->criteria['filetype'])); 'filetype' => $this->criteria['filetype']));
$renderer =& new HTML_QuickForm_Renderer_Array(true, true); $renderer =& new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer); $form->accept($renderer);
$output['global']['dynform'] = $renderer->toArray(); $output['global']['dynform'] = $renderer->toArray();

View file

@ -289,7 +289,7 @@ class uiBrowser extends uiBase {
function addGroupMember($id) function addGroupMember($id)
{ {
$g = $this->groupMembers($id); $g = $this->groupMembers($id);
foreach($g['subj'] as $s) { foreach($g['subj'] as $s) {
$this->logins[($s['login'])]=$s['login']; $this->logins[($s['login'])]=$s['login'];
} }
$form = new HTML_QuickForm('addGroupMember', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('addGroupMember', UI_STANDARD_FORM_METHOD, UI_HANDLER);
@ -379,11 +379,10 @@ class uiBrowser extends uiBase {
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER); $form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->_parseArr2Form($form, $mask['basics']); $this->_parseArr2Form($form, $mask['basics']);
$form->setConstants( array('id' => $id, $form->setConstants(array('act' => 'editMetaData',
#!!!!!'langid' => array_pop($this->gb->getMDataValue($id, 'langid', $this->sessid)) 'id' => $id,
'langid' => 'en' #!!!!!'langid' => array_pop($this->gb->getMDataValue($id, 'langid', $this->sessid))
) 'langid' => 'en'));
);
## 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['pages'] as $key=>$val) { foreach ($mask['pages'] as $key=>$val) {

View file

@ -99,7 +99,8 @@ class uiCalendar
$Day = new Calendar_Day ($this->curr['year'], $this->curr['month'], $this->curr['day']); $Day = new Calendar_Day ($this->curr['year'], $this->curr['month'], $this->curr['day']);
$Day->build(); $Day->build();
while ($Hour = $Day->fetch()) { while ($Hour = $Day->fetch()) {
$this->Day[] = array('hour' => $Hour->thisHour()); $this->Day[] = array('hour' => $Hour->thisHour(),
'timestamp' => $Hour->thisHour(TRUE));
} }
} }

View file

@ -32,7 +32,7 @@ define('UI_BROWSE_SESSNAME', 'L_BROWSE');
## Metadata Keys ## Metadata Keys
define('UI_MDATA_KEY_TITLE', 'dc:title'); define('UI_MDATA_KEY_TITLE', 'dc:title');
define('UI_MDATA_KEY_ARTIST', 'dc:creator'); define('UI_MDATA_KEY_CREATOR', 'dc:creator');
define('UI_MDATA_KEY_DURATION', 'dcterms:extent'); define('UI_MDATA_KEY_DURATION', 'dcterms:extent');
define('UI_MDATA_KEY_URL', 'ls:url'); define('UI_MDATA_KEY_URL', 'ls:url');

View file

@ -110,10 +110,10 @@ class uiPlaylist
return $this->activeId; return $this->activeId;
} }
function reportLookedPL($setMsg) function reportLookedPL($setMsg=FALSE)
{ {
if(is_string($saved = $this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) { if(is_string($saved = $this->Base->gb->loadPref($this->Base->sessid, UI_PL_ACCESSTOKEN_KEY))) {
if ($setMsg === TRUE) $this->Base->_retMsg('Found looked Playlist'); if ($setMsg == TRUE) $this->Base->_retMsg('Found looked Playlist');
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
@ -352,6 +352,66 @@ class uiPlaylist
return $renderer->toArray(); return $renderer->toArray();
} }
function metaDataForm($get=TRUE)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';
foreach ($mask['playlist'] as $k=>$v) {
$mask['playlist'][$k]['element'] = $this->Base->_formElementEncode($v['element']);
## recive data from GreenBox
if ($get) {
$mask['playlist'][$k]['default'] = $this->Base->_getMDataValue($this->activeId, $v['element']);
}
## get data from parameter
if (is_array($data)) {
$mask['playlist'][$k]['default'] = $data[strtr($v['element'], '_', '.')];
}
}
$form = new HTML_QuickForm('editMetaData', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask['basics']);
$this->Base->_parseArr2Form($form, $mask['playlist']);
$this->Base->_parseArr2Form($form, $mask['buttons']);
$form->setConstants(array('act' => 'PL.editMetaData',
'id' => $this->activeId));
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['main'] = $renderer->toArray();
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER);
$this->Base->_parseArr2Form($form, $mask['langswitch']);
$output['langswitch'] = $form->toHTML();
#print_r($output);
return $output;
}
function editMetaData(&$formdata)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';
## first remove old entrys
#$this->gb->replaceMetaData($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid);
foreach ($mask['playlist'] as $k=>$v) {
$formdata[$this->Base->_formElementEncode($v['element'])] ? $mData[$this->Base->_formElementDecode($v['element'])] = $formdata[$this->Base->_formElementEncode($v['element'])] : NULL;
}
$data = $this->Base->_dateArr2Str($mData);
foreach ($data as $key=>$val) {
$r = $this->Base->gb->setMDataValue($this->activeId, $key, $this->Base->sessid, $val);
if (PEAR::isError($r)) {
$this->Base->_retMsg('Unable to set $1: $2', $key, $val);
}
}
$this->Base->_retMsg('Metadata saved');
$this->Base->redirUrl = UI_BROWSER."?act=PL.simpleManagement&id=".$this->activeId;
}
function _plTimeToSecs($plt, $length=4) function _plTimeToSecs($plt, $length=4)
{ {
$arr = split(':', $plt); $arr = split(':', $plt);

View file

@ -55,17 +55,34 @@ class uiScheduler extends uiCalendar
function _datetime2timestamp($i) function _datetime2timestamp($i)
{ {
$formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T'); $formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T');
#echo "iiiii: $i ffff:".$formatted; #echo "input: $i formatted:".$formatted;
return strtotime($formatted); return $this->_strtotime($formatted);
}
function _strtotime($input)
{
## !! bug in strtotime. zeigt 8h später an als reines datum, wenn Txx:xx:xx verwendet wird !!
if (strpos($input, 'T'))
return strtotime($input)-8*3600;
return strtotime($input);
} }
function getDayUsage($year, $month, $day) function getDayUsage($year, $month, $day)
{ {
$day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00');
$day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59');
$date = $year.$month.$day; $date = $year.$month.$day;
$arr = $this->displayScheduleMethod($date.'T00:00:00', $date.'T23:59:59.999999'); $arr = $this->displayScheduleMethod($date.'T00:00:00', $date.'T23:59:59.999999');
if (!count($arr)) if (!count($arr))
return FALSE; return FALSE;
foreach ($arr as $key=>$val) {
$arr[$key]['title'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE);
$arr[$key]['creator'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR);
$arr[$key]['timestamp'] = $this->_datetime2timestamp($val['start']);
}
#print_r($arr); #print_r($arr);
return $arr; return $arr;
} }
@ -84,46 +101,46 @@ class uiScheduler extends uiCalendar
function getDayTiming($year, $month, $day) function getDayTiming($year, $month, $day)
{ {
## !! bug in strtotime. zeigt 8h später an als reines datum, wenn Txx:xx:xx verwendet wird !! #echo $year.$month.$day;
$day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00'); $day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00');
$day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59'); $day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59');
if (!$arr = $this->getDayUsage($year, $month, $day)) if (!$arr = $this->getDayUsage($year, $month, $day))
return array(array( ## empty day return array(array( ## empty day
'type' => 'gap', 'type' => 'gap',
'length' => $day_end - $day_start 'length' => $day_end - $day_start
)); ));
$curr = current($arr); $curr = current($arr);
if (strtotime($curr['start']) > $day_start) ## insert gap if first entry start after 00:00:00 if ($this->_strtotime($curr['start']) > $day_start) ## insert gap if first entry start after 00:00:00
$list[] = array( $list[] = array(
'type' => 'gap', 'type' => 'gap',
#'pos' => 0, #'pos' => 0,
'length' => strtotime($curr['start']) - $day_start 'length' => $this->_strtotime($curr['start']) - $day_start
); );
while ($curr = current($arr)) { while ($curr = current($arr)) {
$list[] = array( $list[] = array(
'type' => 'entry', 'type' => 'entry',
#'pos' => strtotime($curr['start']) - $day_start, #'pos' => $this->_strtotime($curr['start']) - $day_start,
'length' => strtotime($curr['end']) - strtotime($curr['start']), 'length' => $this->_strtotime($curr['end']) - $this->_strtotime($curr['start']),
'entry' => $curr 'entry' => $curr
); );
if ($next = next($arr)) { if ($next = next($arr)) {
if (strtotime($next['start']) > strtotime($curr['end'])+1) ## insert gap between entrys if ($this->_strtotime($next['start']) > $this->_strtotime($curr['end'])+1) ## insert gap between entrys
$list[] = array( $list[] = array(
'type' => 'gap', 'type' => 'gap',
#'pos' => strtotime($curr['start'])-$day_start, #'pos' => $this->_strtotime($curr['start'])-$day_start,
'length' => strtotime($next['start']) - strtotime($curr['end']), 'length' => $this->_strtotime($next['start']) - $this->_strtotime($curr['end']),
); );
} }
else { else {
if (strtotime($curr['end']) < $day_end) ## insert gap if prev entry was not until midnight if ($this->_strtotime($curr['end']) < $day_end) ## insert gap if prev entry was not until midnight
$list[] = array( $list[] = array(
'type' => 'gap', 'type' => 'gap',
#'pos' => strtotime($curr['end']) - $day_start, #'pos' => $this->_strtotime($curr['end']) - $day_start,
'length' => $day_end - strtotime($curr['end']), 'length' => $day_end - $this->_strtotime($curr['end']),
); );
} }
@ -138,6 +155,7 @@ class uiScheduler extends uiCalendar
return $id < 1 ? ceil($in) : round($in); return $id < 1 ? ceil($in) : round($in);
} }
function _scheduledDays($period) function _scheduledDays($period)
{ {
if ($period=='month') { if ($period=='month') {