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'); $Smarty->display('popup/PLAYLIST.changeTransition.tpl');
break; break;
case "PL.changeAllTransitions";
$Smarty->assign('dynform', $uiBrowser->PLAYLIST->changeAllTransitionsForm($ui_fmask['PL.changeTransition']));
$Smarty->display('popup/PLAYLIST.changeAllTransitions.tpl');
break;
case "PL.confirmDelete": case "PL.confirmDelete":
$Smarty->display('popup/PLAYLIST.confirmDelete.tpl'); $Smarty->display('popup/PLAYLIST.confirmDelete.tpl');
break; break;

View file

@ -67,6 +67,7 @@
</table> </table>
</div> </div>
<div class="footer" style="width: 569px;"> <div class="footer" style="width: 569px;">
<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_submit('PL', 'PL.removeItem')" value="##Remove Selected##" />
<input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" /> <input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" />
</div> </div>

View file

@ -62,10 +62,14 @@ function stopClock() {
{/literal} {/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))} {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} {/if}
</script> </script>

View file

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

View file

@ -350,7 +350,7 @@ class uiBase
function _getMDataValue($id, $key, $langid=FALSE) 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))) { if (is_array($arr = $this->gb->getMDataValue($id, $key, $this->sessid, $langid))) {
$value = current($arr); $value = current($arr);

View file

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

View file

@ -257,6 +257,11 @@ class uiPlaylist
function changeTransition($id, $type, $duration) function changeTransition($id, $type, $duration)
{ {
$pause = $pause;
$xfade = GreenBox::_secsToPlTime($duration/1000);
if ($id) {
// just change fade between 2 clips
$curr = $this->getCurrElement($id); $curr = $this->getCurrElement($id);
$prev = $this->getPrevElement($id); $prev = $this->getPrevElement($id);
$next = $this->getNextElement($id); $next = $this->getNextElement($id);
@ -265,24 +270,30 @@ class uiPlaylist
case "fadeX": case "fadeX":
$item[$prev['attrs']['id']] = $item[$prev['attrs']['id']] =
array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]), array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($duration/1000)); UI_PL_ELEM_FADEOUT => $xfade
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($duration/1000), );
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])); $item[$id] = array(UI_PL_ELEM_FADEIN => $xfade,
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])
);
break; break;
case "pause": case "pause":
$item[$prev['attrs']['id']] = $item[$prev['attrs']['id']] =
array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]), array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($prev[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime(-$duration/1000)); UI_PL_ELEM_FADEOUT => $pause
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime(-$duration/1000), );
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])); $item[$id] = array(UI_PL_ELEM_FADEIN => $pause,
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])
);
break; break;
case "fadeIn": case "fadeIn":
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($duration/1000), $item[$id] = array(UI_PL_ELEM_FADEIN => $xfade,
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])); UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEOUT])
);
break; break;
case "fadeOut": case "fadeOut":
$item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEIN]), $item[$id] = array(UI_PL_ELEM_FADEIN => GreenBox::_secsToPlTime($curr[UI_PL_ELEM_FADEIN]),
UI_PL_ELEM_FADEOUT => GreenBox::_secsToPlTime($duration/1000)); UI_PL_ELEM_FADEOUT => $xfade
);
break; break;
} }
#print_r($item); #print_r($item);
@ -295,6 +306,18 @@ class uiPlaylist
return FALSE; 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) function getCurrElement($id)
{ {
$arr = $this->getFlat($id); $arr = $this->getFlat($this->activeId);
while ($val = current($arr)) { while ($val = current($arr)) {
if ($val['attrs']['id'] == $id) { if ($val['attrs']['id'] == $id) {
return current($arr); return current($arr);
@ -324,7 +347,7 @@ class uiPlaylist
function getPrevElement($id) function getPrevElement($id)
{ {
$arr = $this->getFlat($id); $arr = $this->getFlat($this->activeId);
while ($val = current($arr)) { while ($val = current($arr)) {
if ($val['attrs']['id'] == $id) { if ($val['attrs']['id'] == $id) {
return prev($arr); return prev($arr);
@ -336,7 +359,7 @@ class uiPlaylist
function getNextElement($id) function getNextElement($id)
{ {
$arr = $this->getFlat($id); $arr = $this->getFlat($this->activeId);
while ($val = current($arr)) { while ($val = current($arr)) {
if ($val['attrs']['id'] == $id) { if ($val['attrs']['id'] == $id) {
return next($arr); return next($arr);
@ -367,8 +390,6 @@ class uiPlaylist
$form->setConstants(array('headline' => '<b>'.$s['title'].'</b>')); $form->setConstants(array('headline' => '<b>'.$s['title'].'</b>'));
break; break;
} }
$form->setConstants(array('id' => $id, $form->setConstants(array('id' => $id,
'duration' => $duration) 'duration' => $duration)
); );
@ -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) function metaDataForm($langid)
{ {
include dirname(__FILE__).'/formmask/metadata.inc.php'; include dirname(__FILE__).'/formmask/metadata.inc.php';

View file

@ -489,7 +489,7 @@ class uiScheduler extends uiCalendar
if ($this->_isError($r)) if ($this->_isError($r))
return FALSE; return FALSE;
if (isset($r['scheduleEntryId'])) 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']);
} }