This commit is contained in:
sebastian 2005-06-09 13:48:37 +00:00
parent b2bcbd8e18
commit 54be542f05
8 changed files with 107 additions and 68 deletions

View file

@ -66,6 +66,11 @@ if (is_array($_REQUEST['popup'])){
$Smarty->display('popup/PLAYLIST.changeTransition.tpl');
break;
case "PL.changeAllTransitions";
$Smarty->assign('dynform', $uiBrowser->PLAYLIST->changeAllTransitionsForm($ui_fmask['PL.changeTransition']));
$Smarty->display('popup/PLAYLIST.changeAllTransitions.tpl');
break;
case "PL.confirmDelete":
$Smarty->display('popup/PLAYLIST.confirmDelete.tpl');
break;

View file

@ -67,7 +67,8 @@
</table>
</div>
<div class="footer" style="width: 569px;">
<input type="button" class="button_large" onClick="collector_submit('PL', 'PL.removeItem')" value="##Remove Selected##" />
<input type="button" class="button_large" onClick="collector_submit('PL', '0&popup[]=PL.changeAllTransitions', '{$UI_BROWSER}', 'chgAllTrans', 400, 150)" value="##Change Fades##" />
<input type="button" class="button_large" onClick="collector_submit('PL', 'PL.removeItem')" value="##Remove Selected##" />
<input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" />
</div>
<div class="container_button">

View file

@ -34,7 +34,7 @@ function myClock(eh, ei, es, dh, di, ds, next, interval) {
clock['elapsed'] = new Date();
clock['duration'] = new Date();
clock['remaining'] = new Date();
clock['elapsed'].setTime(Date.UTC(1970, 0, 1, eh, ei, es));
clock['elapsed'].setTime (Date.UTC(1970, 0, 1, eh, ei, es));
clock['duration'].setTime(Date.UTC(1970, 0, 1, dh, di, ds));
clock['run'] = setInterval("incClock();", clock['interval']);
}
@ -45,7 +45,7 @@ function incClock() {
clock['elapsed'].setTime(clock['elapsed'].getTime() + clock['interval']);
clock['remaining'].setTime(clock['duration'].getTime() - clock['elapsed'].getTime());
document.getElementById("statusbar_elapsed").innerHTML = twoDigit(clock['elapsed'].getUTCHours()) + ":" + twoDigit(clock['elapsed'].getUTCMinutes()) + ":" + twoDigit(clock['elapsed'].getUTCSeconds());
document.getElementById("statusbar_elapsed").innerHTML = twoDigit(clock['elapsed'].getUTCHours()) + ":" + twoDigit(clock['elapsed'].getUTCMinutes()) + ":" + twoDigit(clock['elapsed'].getUTCSeconds());
document.getElementById("statusbar_remaining").innerHTML = twoDigit(clock['remaining'].getUTCHours()) + ":" + twoDigit(clock['remaining'].getUTCMinutes()) + ":" + twoDigit(clock['remaining'].getUTCSeconds());
document.getElementById("statusbar_scala").style.width = (100 / clock['duration'].getTime() * clock['elapsed'].getTime()) + "%";
}
@ -62,10 +62,14 @@ function stopClock() {
{/literal}
pre0_myClock({$smarty.now|date_format:"%Y, %m, %d, %H, %M, %S"}, 1000);
pre0_myClock({$smarty.now|date_format:"%Y"|string_format:"%d"}, {$smarty.now|date_format:"%m"|string_format:"%d"}, {$smarty.now|date_format:"%d"|string_format:"%d"},
{$smarty.now|date_format:"%H"|string_format:"%d"}, {$smarty.now|date_format:"%M"|string_format:"%d"}, {$smarty.now|date_format:"%S"|string_format:"%d"},
1000);
{if (is_array($_nowplaying.duration))}
myClock ({$_nowplaying.elapsed.h}, {$_nowplaying.elapsed.m}, {$_nowplaying.elapsed.s|truncate:2:""}, {$_nowplaying.duration.h}, {$_nowplaying.duration.m}, {$_nowplaying.duration.s|truncate:2:""}, {if is_array($_nextplaying)}1{else}0{/if}, 333);
myClock ({$_nowplaying.elapsed.h|string_format:"%d"}, {$_nowplaying.elapsed.m|string_format:"%d"}, {$_nowplaying.elapsed.s|string_format:"%d"},
{$_nowplaying.duration.h|string_format:"%d"}, {$_nowplaying.duration.m|string_format:"%d"}, {$_nowplaying.duration.s|string_format:"%d"},
{if is_array($_nextplaying)}1{else}0{/if}, 333);
{/if}
</script>

View file

@ -1,10 +1,11 @@
{literal}
<script type="text/javascript">
function collector_submit(formname, action)
function collector_submit(formname, action, script, name, width, height)
{
var href = '';
var n;
if (!script) var script = '{/literal}{$UI_HANDLER}{literal}';
for (n=0; n < (document.forms[formname].elements.length); n++) {
if (document.forms[formname].elements[n].checked && document.forms[formname].elements[n].name != 'all') {
@ -12,10 +13,10 @@ function collector_submit(formname, action)
}
}
if (href == '')
return false;
if (href == '') return false;
hpopup({/literal}'{$UI_HANDLER}{literal}?act=' + action + href);
if (name) popup (script + '?act=' + action + href, popup, width, height);
else hpopup(script + '?act=' + action + href);
}
function collector_switchAll(formname)

View file

@ -350,7 +350,7 @@ class uiBase
function _getMDataValue($id, $key, $langid=FALSE)
{
if ($langid===FALSE) $langid = $_SESSION['langid'];
if (!$langid) $langid = $_SESSION['langid'];
if (is_array($arr = $this->gb->getMDataValue($id, $key, $this->sessid, $langid))) {
$value = current($arr);

View file

@ -289,33 +289,29 @@ class uiBrowser extends uiBase {
extract($param);
static $records, $relations;
$arr =& $records[$id];
if (is_array($arr)) return $arr;
if (!is_array($relations)) include dirname(__FILE__).'/formmask/mdata_relations.inc.php';
if (is_array($arr)) return $arr;
require_once dirname(__FILE__).'/formmask/mdata_relations.inc.php';
require_once 'XML/Unserializer.php';
$handler =& new XML_Unserializer;
$handler->unserialize($this->getMdata($id));
$arr = $handler->getUnserializedData();
$arr = $this->gb->getMDataArray($id, $this->sessid);
if (!is_array($arr)) return FALSE;
foreach ($arr['metadata'] as $key=>$val) {
if (is_array($val)) { ## just workaround
$val = current($val);
foreach ($arr as $key=>$val) {
if (is_array($val)) {
if ($val[$this->langid]) $val = $val[$this->langid];
else $val = $val[UI_DEFAULT_LANGID];
}
if ($relations[$key]) {
unset($arr['metadata'][$key]);
$arr['metadata'][$relations[tra($key)]] = $val;
unset($arr[$key]);
$arr[$relations[tra($key)]] = $val;
} else {
$arr[$key] = $val;
}
}
ksort($arr['metadata']);
ksort($arr);
return $arr;
return array('metadata' => $arr);
}

View file

@ -257,43 +257,66 @@ class uiPlaylist
function changeTransition($id, $type, $duration)
{
$curr = $this->getCurrElement($id);
$prev = $this->getPrevElement($id);
$next = $this->getNextElement($id);
$pause = $pause;
$xfade = GreenBox::_secsToPlTime($duration/1000);
switch ($type) {
case "fadeX":
$item[$prev['attrs']['id']] =
array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($duration/1000));
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($duration/1000),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT]));
break;
case "pause":
$item[$prev['attrs']['id']] =
array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime(-$duration/1000));
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime(-$duration/1000),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT]));
break;
case "fadeIn":
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($duration/1000),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT]));
break;
case "fadeOut":
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($duration/1000));
break;
}
#print_r($item);
foreach ($item as $i=>$val) {
$r = $this->Base->gb->changeFadeInfo($this->token, $i, $val[UI_PL_ELEM_FADEIN], $val[UI_PL_ELEM_FADEOUT], $this->Base->sessid);
#print_r($r);
if (PEAR::isError($r)) {
if ($id) {
// just change fade between 2 clips
$curr = $this->getCurrElement($id);
$prev = $this->getPrevElement($id);
$next = $this->getNextElement($id);
switch ($type) {
case "fadeX":
$item[$prev['attrs']['id']] =
array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => $xfade
);
$item[$id] = array(UI_PL_ELEM_FADEIN => $xfade,
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])
);
break;
case "pause":
$item[$prev['attrs']['id']] =
array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => $pause
);
$item[$id] = array(UI_PL_ELEM_FADEIN => $pause,
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])
);
break;
case "fadeIn":
$item[$id] = array(UI_PL_ELEM_FADEIN => $xfade,
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])
);
break;
case "fadeOut":
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => $xfade
);
break;
}
#print_r($item);
foreach ($item as $i=>$val) {
$r = $this->Base->gb->changeFadeInfo($this->token, $i, $val[UI_PL_ELEM_FADEIN], $val[UI_PL_ELEM_FADEOUT], $this->Base->sessid);
#print_r($r);
if (PEAR::isError($r)) {
if (UI_VERBOSE) print_r($r);
$this->Base->_retMsg('Change fade information failed.');
return FALSE;
}
}
} else {
// change fade of all clips
foreach ($this->getFlat($this->activeId) as $v) {
$r = $this->Base->gb->changeFadeInfo($this->token, $v['attrs']['id'], $type==='pause'?$pause:$xfade, $type==='pause'?$pause:$xfade, $this->Base->sessid);
#print_r($r);
if (PEAR::isError($r)) {
if (UI_VERBOSE) print_r($r);
$this->Base->_retMsg('Change fade information failed.');
return FALSE;
}
}
}
}
@ -312,7 +335,7 @@ class uiPlaylist
function getCurrElement($id)
{
$arr = $this->getFlat($id);
$arr = $this->getFlat($this->activeId);
while ($val = current($arr)) {
if ($val['attrs']['id'] == $id) {
return current($arr);
@ -324,7 +347,7 @@ class uiPlaylist
function getPrevElement($id)
{
$arr = $this->getFlat($id);
$arr = $this->getFlat($this->activeId);
while ($val = current($arr)) {
if ($val['attrs']['id'] == $id) {
return prev($arr);
@ -336,7 +359,7 @@ class uiPlaylist
function getNextElement($id)
{
$arr = $this->getFlat($id);
$arr = $this->getFlat($this->activeId);
while ($val = current($arr)) {
if ($val['attrs']['id'] == $id) {
return next($arr);
@ -367,11 +390,9 @@ class uiPlaylist
$form->setConstants(array('headline' => '<b>'.$s['title'].'</b>'));
break;
}
$form->setConstants(array('id' => $id,
'duration' => $duration)
);
);
$this->Base->_parseArr2Form($form, $mask[$type]);
$this->Base->_parseArr2Form($form, $mask['all']);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
@ -380,6 +401,17 @@ class uiPlaylist
}
function changeAllTransitionsForm(&$mask)
{
$form = new HTML_QuickForm('PL_changeTransition', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$this->Base->_parseArr2Form($form, $mask['transition']);
$this->Base->_parseArr2Form($form, $mask['all']);
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
return $renderer->toArray();
}
function metaDataForm($langid)
{
include dirname(__FILE__).'/formmask/metadata.inc.php';

View file

@ -489,7 +489,7 @@ class uiScheduler extends uiCalendar
if ($this->_isError($r))
return FALSE;
if (isset($r['scheduleEntryId']))
$this->Base->_retMsg('Entry added at $1 with ScheduleId: $2', $datetime, $r['scheduleEntryId']);
$this->Base->_retMsg('Entry added at $1 with ScheduleId: $2', strftime("%Y-%m-%d %H:%M:%S", $this->_datetime2timestamp($datetime)), $r['scheduleEntryId']);
}