*** empty log message ***
This commit is contained in:
parent
9e8ab83dca
commit
089134adf2
20 changed files with 218 additions and 261 deletions
|
@ -435,19 +435,7 @@ $ui_fmask = array(
|
||||||
'element' => 'langid',
|
'element' => 'langid',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Language',
|
'label' => 'Language',
|
||||||
'options' => array(
|
'options' => _getLanguages(),
|
||||||
'ar_JO' => 'Arabic(JO)',
|
|
||||||
'am_AM' => 'Armenian(AM)',
|
|
||||||
'en_GB' => 'English (GB)',
|
|
||||||
'en_US' => 'English (US)',
|
|
||||||
'es_CO' => 'Español (CO)',
|
|
||||||
'cz_CZ' => 'Česky (CZ)',
|
|
||||||
'de_DE' => 'Deutsch (DE)',
|
|
||||||
'hu_HU' => 'Magyar (HU)',
|
|
||||||
'nl_NL' => 'Nederlands (NL)',
|
|
||||||
'sr_CS' => 'Srpski (CS)',
|
|
||||||
'ru_RU' => 'Russia(RU)'
|
|
||||||
),
|
|
||||||
'default' => UI_DEFAULT_LANGID
|
'default' => UI_DEFAULT_LANGID
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
|
@ -58,15 +58,7 @@ $mask = array(
|
||||||
'element' => 'target_langid',
|
'element' => 'target_langid',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Language',
|
'label' => 'Language',
|
||||||
'options' => array(
|
'options' => _getLanguages(),
|
||||||
'en_GB' => 'English (GB)',
|
|
||||||
'nl_NL' => 'Nederlands (NL)',
|
|
||||||
'cz_CZ' => 'ÄŒesky (CZ)',
|
|
||||||
'de_DE' => 'Deutsch (DE)',
|
|
||||||
'hu_HU' => 'Magyar (HU)',
|
|
||||||
'sr_CS' => 'Srpski (CS)',
|
|
||||||
'es_CO' => "Español (CO)"
|
|
||||||
),
|
|
||||||
'attributes'=> array('onChange' => 'MData_switchLang()')
|
'attributes'=> array('onChange' => 'MData_switchLang()')
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -250,17 +242,17 @@ $mask = array(
|
||||||
'label' => 'Channels',
|
'label' => 'Channels',
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'' => '',
|
'' => '',
|
||||||
'mono' => 'Mono',
|
1 => 'Mono',
|
||||||
'stereo' => 'Stereo',
|
2 => 'Stereo',
|
||||||
'5.1' => '5.1'
|
6 => '5.1'
|
||||||
),
|
),
|
||||||
'id3' => 'Channels'
|
'id3' => 'Channels'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'element' => 'ls:samplerate',
|
'element' => 'ls:samplerate',
|
||||||
'type' => 'select',
|
'type' => 'text',
|
||||||
'label' => 'Sample rate',
|
'label' => 'Sample rate',
|
||||||
'options' => array(), ## vervollständigen!
|
'rule' => 'numeric',
|
||||||
'id3' => 'Samplerate'
|
'id3' => 'Samplerate'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -57,7 +57,6 @@ if (is_array($_REQUEST['popup'])){
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "deleteItem":
|
case "deleteItem":
|
||||||
$Smarty->assign('id', $_REQUEST['id']);
|
|
||||||
$Smarty->assign('filename', $uiBrowser->_getMDataValue($_REQUEST['id'], UI_MDATA_KEY_TITLE));
|
$Smarty->assign('filename', $uiBrowser->_getMDataValue($_REQUEST['id'], UI_MDATA_KEY_TITLE));
|
||||||
$Smarty->display('popup/deleteItem.tpl');
|
$Smarty->display('popup/deleteItem.tpl');
|
||||||
break;
|
break;
|
||||||
|
@ -84,13 +83,11 @@ if (is_array($_REQUEST['popup'])){
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "SCHEDULER.removeItem":
|
case "SCHEDULER.removeItem":
|
||||||
$Smarty->assign('scheduleId', $_REQUEST['scheduleId']);
|
|
||||||
$Smarty->assign('playlistName', $uiBrowser->_getMDataValue($_REQUEST['playlistId'], UI_MDATA_KEY_TITLE));
|
$Smarty->assign('playlistName', $uiBrowser->_getMDataValue($_REQUEST['playlistId'], UI_MDATA_KEY_TITLE));
|
||||||
$Smarty->display('popup/SCHEDULER.removeItem.tpl');
|
$Smarty->display('popup/SCHEDULER.removeItem.tpl');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "SUBJECTS.confirmRemoveSubj":
|
case "SUBJECTS.confirmRemoveSubj":
|
||||||
$Smarty->assign('lgoin', $_REQUEST['login']);
|
|
||||||
$Smarty->display('popup/SUBJECTS.confirmRemoveSubj.tpl');
|
$Smarty->display('popup/SUBJECTS.confirmRemoveSubj.tpl');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -253,8 +253,8 @@ switch($_REQUEST['act']){
|
||||||
$uiHandler->SCHEDULER->setReload();
|
$uiHandler->SCHEDULER->setReload();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "SCHEDULER.setScheduleTime":
|
case "SCHEDULER.setScheduleAtTime":
|
||||||
$uiHandler->SCHEDULER->setScheduleAt($_REQUEST);
|
$uiHandler->SCHEDULER->setScheduleAtTime($_REQUEST);
|
||||||
$uiHandler->SCHEDULER->setClose();
|
$uiHandler->SCHEDULER->setClose();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ switch($_REQUEST['act']){
|
||||||
if ($uiHandler->alertMsg) $_SESSION['alertMsg'] = $uiHandler->alertMsg;
|
if ($uiHandler->alertMsg) $_SESSION['alertMsg'] = $uiHandler->alertMsg;
|
||||||
#header('Location: '.$uiHandler->redirUrl);
|
#header('Location: '.$uiHandler->redirUrl);
|
||||||
if (ob_get_contents()) {
|
if (ob_get_contents()) {
|
||||||
$ui_wait = 5;
|
$ui_wait = 10;
|
||||||
}
|
}
|
||||||
ob_end_clean;
|
ob_end_clean;
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -25,10 +25,10 @@ onClick="return contextmenu('{$i.id}'
|
||||||
{if $_PL_activeId == $i.id}
|
{if $_PL_activeId == $i.id}
|
||||||
, 'PL.release'
|
, 'PL.release'
|
||||||
{else}
|
{else}
|
||||||
, 'PL.addItem', 'delete'
|
, 'SCHEDULER.addPL', 'PL.addItem', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{else}
|
{else}
|
||||||
, 'PL.activate', 'PL.create', 'delete'
|
, 'SCHEDULER.addPL', 'PL.activate', 'PL.create', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
)"
|
)"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{include file="popup/header.tpl"}
|
{include file="popup/header.tpl"}
|
||||||
|
|
||||||
{if $SCHEDULER->copyPlFromSP()}
|
{if $SCHEDULER->getPLtoSchedule($_REQUEST.playlistId)}
|
||||||
{assign var="dynform" value=$SCHEDULER->getScheduleForm()}
|
{assign var="dynform" value=$SCHEDULER->getScheduleForm()}
|
||||||
<table height="100%" width="100%">
|
<table height="100%" width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -32,7 +32,7 @@ function SCHEDULE_submit()
|
||||||
function SCHEDULE_snap2Hour()
|
function SCHEDULE_snap2Hour()
|
||||||
{
|
{
|
||||||
{/literal}
|
{/literal}
|
||||||
document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->scheduleAt.hour|string_format:'%d'}";
|
document.forms["schedule"].elements["time[H]"].value = "{$SCHEDULER->scheduleAtTime.hour|string_format:'%d'}";
|
||||||
document.forms["schedule"].elements["time[i]"].value = "0";
|
document.forms["schedule"].elements["time[i]"].value = "0";
|
||||||
document.forms["schedule"].elements["time[s]"].value = "0";
|
document.forms["schedule"].elements["time[s]"].value = "0";
|
||||||
{literal}
|
{literal}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{tra 0='Are you sure to remove playlist "$1"?' 1=$playlistName}
|
{tra 0='Are you sure to remove playlist "$1"?' 1=$playlistName}
|
||||||
<br><br>
|
<br><br>
|
||||||
<input type="button" class="button" onClick="window.close()" value="Cancel">
|
<input type="button" class="button" onClick="window.close()" value="Cancel">
|
||||||
<input type="button" class="button" onClick="location.href='{$UI_HANDLER}?act=SCHEDULER.removeItem&scheduleId={$scheduleId}'" value="OK">
|
<input type="button" class="button" onClick="location.href='{$UI_HANDLER}?act=SCHEDULER.removeItem&scheduleId={$_REQUEST.scheduleId}'" value="OK">
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{tra 0='Are you sure to delete file "$1"?' 1=$filename}
|
{tra 0='Are you sure to delete file "$1"?' 1=$filename}
|
||||||
<br><br>
|
<br><br>
|
||||||
<input type="button" class="button" onClick="window.close()" value="Cancel">
|
<input type="button" class="button" onClick="window.close()" value="Cancel">
|
||||||
<input type="button" class="button" onClick="location.href='{$UI_HANDLER}?act=delete&id={$id}'" value="OK">
|
<input type="button" class="button" onClick="location.href='{$UI_HANDLER}?act=delete&id={$_REQUEST.id}'" value="OK">
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
onClick="hidealttext(); return contextmenu('scheduleId={$i.scheduleid}&playlistId={$i.id}', 'SCHEDULER.removeItem')"
|
onClick="return contextmenu('scheduleId={$i.scheduleid}&playlistId={$i.id}', 'SCHEDULER.removeItem')"
|
||||||
|
|
|
@ -25,10 +25,10 @@ onClick="return contextmenu('{$i.id}'
|
||||||
{if $_PL_activeId == $i.id}
|
{if $_PL_activeId == $i.id}
|
||||||
, 'PL.release'
|
, 'PL.release'
|
||||||
{elseif $PL->isAvailable($i.id) == true}
|
{elseif $PL->isAvailable($i.id) == true}
|
||||||
, 'PL.addItem', 'PL.activate', 'delete'
|
, 'SCHEDULER.addPL', 'PL.addItem', 'PL.activate', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{elseif $PL->isAvailable($i.id) == true}
|
{elseif $PL->isAvailable($i.id) == true}
|
||||||
, 'PL.activate', 'PL.create', 'delete'
|
, 'SCHEDULER.addPL', 'PL.activate', 'PL.create', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
)"
|
)"
|
|
@ -50,19 +50,20 @@
|
||||||
Pheight = window.innerHeight;
|
Pheight = window.innerHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
url = url + '&is_popup=1';
|
|
||||||
screenX = (Xpos + Pwidth/2 - width/2);
|
screenX = (Xpos + Pwidth/2 - width/2);
|
||||||
screenY = (Ypos + Pheight/2 - height/2);
|
screenY = (Ypos + Pheight/2 - height/2);
|
||||||
|
url = url + '&is_popup=1';
|
||||||
arg = 'width='+width+', height='+height+', scrollbars=no, menubar=no, depend=yes, left='+screenX+', top='+screenY;
|
arg = 'width='+width+', height='+height+', scrollbars=no, menubar=no, depend=yes, left='+screenX+', top='+screenY;
|
||||||
|
|
||||||
popupwin = window.open(url, name, arg);
|
popupwin = window.open(url, name, arg);
|
||||||
window.popupwin.focus();
|
window.popupwin.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function hpopup(url, name)
|
function hpopup(url)
|
||||||
{
|
{
|
||||||
var width = 160;
|
var width = 160;
|
||||||
var height = 120;
|
var height = 120;
|
||||||
|
var name = Math.random();
|
||||||
var screenX;
|
var screenX;
|
||||||
var screenY;
|
var screenY;
|
||||||
var Xpos;
|
var Xpos;
|
||||||
|
@ -81,9 +82,10 @@
|
||||||
Pwidth = window.innerWidth;
|
Pwidth = window.innerWidth;
|
||||||
Pheight = window.innerHeight;
|
Pheight = window.innerHeight;
|
||||||
}
|
}
|
||||||
url = url + '&is_popup=1';
|
|
||||||
screenX = (Xpos + Pwidth/2 - width/2);
|
screenX = (Xpos + Pwidth/2 - width/2);
|
||||||
screenY = (Ypos + Pheight/2 - height/2);
|
screenY = (Ypos + Pheight/2 - height/2);
|
||||||
|
url = url + '&is_popup=1';
|
||||||
arg = 'width='+width+', height='+height+', scrollbars=no, menubar=no, depend=yes, left='+screenX+', top='+screenY;
|
arg = 'width='+width+', height='+height+', scrollbars=no, menubar=no, depend=yes, left='+screenX+', top='+screenY;
|
||||||
|
|
||||||
popupwin = window.open(url, name, arg);
|
popupwin = window.open(url, name, arg);
|
||||||
|
|
|
@ -8,7 +8,7 @@ function twoDigit(i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function pre0_myClock(y, m, d, h, i ,s, interval) {
|
function pre0_myClock(y, m, d, h, i, s, interval) {
|
||||||
pre0_clock = new Array();
|
pre0_clock = new Array();
|
||||||
pre0_clock['interval'] = interval;
|
pre0_clock['interval'] = interval;
|
||||||
pre0_clock['time'] = new Date(y, m, d, h, i ,s);
|
pre0_clock['time'] = new Date(y, m, d, h, i ,s);
|
||||||
|
@ -21,35 +21,42 @@ function pre0_incClock() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function elapsed_myClock(y, m, d, h, i, s, interval) {
|
|
||||||
elapsed_clock = new Array();
|
|
||||||
elapsed_clock['interval'] = interval;
|
function myClock(eh, ei, es, dh, di, ds, next, interval) {
|
||||||
elapsed_clock['time'] = new Date(y, m, d, h, i, s);
|
clock = new Array();
|
||||||
elapsed_clock['run'] = setInterval("elapsed_incClock();", elapsed_clock['interval']);
|
clock['next'] = next;
|
||||||
|
clock['interval'] = interval;
|
||||||
|
clock['correction'] = new Date();
|
||||||
|
//clock['correction'].setTime(0);
|
||||||
|
//clock['corr_h'] = clock['correction'].getHours();
|
||||||
|
|
||||||
|
clock['elapsed'] = new Date();
|
||||||
|
clock['duration'] = new Date();
|
||||||
|
clock['remaining'] = new Date();
|
||||||
|
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']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function elapsed_incClock() {
|
function incClock() {
|
||||||
elapsed_clock['time'].setTime(elapsed_clock['time'].getTime() + elapsed_clock['interval']);
|
if (clock['remaining'].getTime() <= clock['interval']) stopClock();
|
||||||
document.getElementById("statusbar_elapsed").innerHTML = twoDigit(elapsed_clock['time'].getHours()) + ":" + twoDigit(elapsed_clock['time'].getMinutes()) + ":" + twoDigit(elapsed_clock['time'].getSeconds());
|
|
||||||
|
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_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()) + "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stopClock() {
|
||||||
|
clearInterval(clock['run']);
|
||||||
|
|
||||||
function remaining_myClock(y, m, d, h, i, s, interval) {
|
if (clock['next'] == 0) {
|
||||||
remaining_clock = new Array();
|
// just if no next item to play
|
||||||
remaining_clock['interval'] = interval;
|
|
||||||
remaining_clock['time'] = new Date(y, m, d, h, i, s);
|
|
||||||
remaining_clock['run'] = setInterval("remaining_incClock();", remaining_clock['interval']);
|
|
||||||
}
|
|
||||||
|
|
||||||
function remaining_incClock() {
|
|
||||||
remaining_clock['time'].setTime(remaining_clock['time'].getTime() - remaining_clock['interval']);
|
|
||||||
document.getElementById("statusbar_remaining").innerHTML = twoDigit(remaining_clock['time'].getHours()) + ":" + twoDigit(remaining_clock['time'].getMinutes()) + ":" + twoDigit(remaining_clock['time'].getSeconds());
|
|
||||||
|
|
||||||
if (remaining_clock['time'].getHours() == 0 && remaining_clock['time'].getMinutes() == 0 && remaining_clock['time'].getSeconds() == 0) {
|
|
||||||
clearInterval(elapsed_clock['run']);
|
|
||||||
clearInterval(remaining_clock['run']);
|
|
||||||
document.getElementById("statusbar_indicator").innerHTML = '<img src="img/el_offair.gif" alt="off air">';
|
document.getElementById("statusbar_indicator").innerHTML = '<img src="img/el_offair.gif" alt="off air">';
|
||||||
document.getElementById("statusbar_whatsplaying").innerHTML = '';
|
document.getElementById("statusbar_whatsplaying").innerHTML = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +65,7 @@ function remaining_incClock() {
|
||||||
pre0_myClock({$smarty.now|date_format:"%Y, %m, %d, %H, %M, %S"}, 1000);
|
pre0_myClock({$smarty.now|date_format:"%Y, %m, %d, %H, %M, %S"}, 1000);
|
||||||
|
|
||||||
{if (is_array($_nowplaying.duration))}
|
{if (is_array($_nowplaying.duration))}
|
||||||
elapsed_myClock ({$smarty.now|date_format:"%Y, %m, %d"}, {$_nowplaying.elapsed.h}, {$_nowplaying.elapsed.m}, {$_nowplaying.elapsed.s|truncate:2:""}, 100);
|
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);
|
||||||
remaining_myClock({$smarty.now|date_format:"%Y, %m, %d"}, {$_nowplaying.remaining.h}, {$_nowplaying.remaining.m}, {$_nowplaying.remaining.s|truncate:2:""}, 100);
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
switch (contextmenu.arguments[i]) {
|
switch (contextmenu.arguments[i]) {
|
||||||
{/literal}
|
{/literal}
|
||||||
case "PL.release":
|
case "PL.release":
|
||||||
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.confirmRelease', 'PL.confirmRelease', 400, 50)\" "+oF+"> ##Close playlist## </a></li>";
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=PL.confirmRelease', 'PL.confirmRelease', 400, 50)\" "+oF+"> ##Close Playlist## </a></li>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "PL.addItem":
|
case "PL.addItem":
|
||||||
|
@ -86,13 +86,21 @@
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "SCHEDULER.addItem":
|
case "SCHEDULER.addItem":
|
||||||
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SCHEDULER.setScheduleTime&"+param+"'); popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem', 'Schedule', 420, 200)\" "+oF+"> ##Insert Playlist here## </a></li>";
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SCHEDULER.setScheduleAtTime&"+param+"'); popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem', 'Schedule', 420, 200)\" "+oF+"> ##Insert Playlist here## </a></li>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "SCHEDULER.removeItem":
|
case "SCHEDULER.removeItem":
|
||||||
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=SCHEDULER.removeItem&"+param+"', 'Schedule', 400, 50)\" "+oF+"> ##Remove Playlist## </a></li>";
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: popup('{$UI_BROWSER}?popup[]=SCHEDULER.removeItem&"+param+"', 'Schedule', 400, 50)\" "+oF+"> ##Remove Playlist## </a></li>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "SCHEDULER.addPL":
|
||||||
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href=\"javascript: hpopup('{$UI_HANDLER}?act=SCHEDULER.set&view=day&today=1');"+
|
||||||
|
"hpopup('{$UI_HANDLER}?act=SCHEDULER.setScheduleAtTime&today=1&hour=0&minute=0');"+
|
||||||
|
"location.href='ui_browser.php?act=SCHEDULER';"+
|
||||||
|
"popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem&playlistId="+param+"', 'Schedule', 420, 200)\" "+oF+
|
||||||
|
"> ##Schedule Playlist## </a></li>";
|
||||||
|
break;
|
||||||
|
|
||||||
case "SUBJECTS.chgPasswd":
|
case "SUBJECTS.chgPasswd":
|
||||||
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='{$UI_BROWSER}?act=SUBJECTS.chgPasswd&"+param+"' "+oF+"> ##Change password## </a></li>";
|
contextmenuHtml = contextmenuHtml + "<li><a class='contextmenu' href='{$UI_BROWSER}?act=SUBJECTS.chgPasswd&"+param+"' "+oF+"> ##Change password## </a></li>";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<!-- start what playing -->
|
<!-- start what playing -->
|
||||||
<div class="whatplaying" id="statusbar_whatsplaying">
|
<div class="whatplaying" id="statusbar_whatsplaying">
|
||||||
{if $_nowplaying}
|
{if $_nowplaying}
|
||||||
<div class="nowplaying">Now Playing: {$_nowplaying.title}</div>
|
<div class="nowplaying">Now Playing: {$_nowplaying.title|truncate:33}</div>
|
||||||
<div class="scala">
|
<div class="scala">
|
||||||
<div class="scala_in" id="statusbar_scala" style="width: {$_nowplaying.percentage}%;"> </div>
|
<div class="scala_in" id="statusbar_scala" style="width: {$_nowplaying.percentage}%;"> </div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
<div class="clearer"></div>
|
<div class="clearer"></div>
|
||||||
{if $_nextplaying}
|
{if $_nextplaying}
|
||||||
<p>Playing Next: {$_nextplaying.title} {$_nextplaying.duration|truncate:8:""}</p>
|
<p>Playing Next: {$_nextplaying.title|truncate:22} {$_nextplaying.duration.h}:{$_nextplaying.duration.m}:{$_nextplaying.duration.s|truncate:2:""}</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<!-- end what playing -->
|
<!-- end what playing -->
|
||||||
|
|
|
@ -26,10 +26,10 @@ onClick="return contextmenu('{$i.id}'
|
||||||
{if $_PL_activeId == $i.id}
|
{if $_PL_activeId == $i.id}
|
||||||
, 'PL.release'
|
, 'PL.release'
|
||||||
{else}
|
{else}
|
||||||
, 'PL.addItem', 'delete'
|
, 'SCHEDULER.addPL', 'PL.addItem', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{else}
|
{else}
|
||||||
, 'PL.activate', 'PL.create', 'delete'
|
, 'SCHEDULER.addPL', 'PL.activate', 'PL.create', 'delete'
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,13 @@ function _getNumArr($start, $end, $step=1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function _getLanguages()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
return $config['languages'];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uiBase class
|
* uiBase class
|
||||||
*
|
*
|
||||||
|
|
|
@ -73,7 +73,6 @@ class uiBrowser extends uiBase {
|
||||||
function login(&$mask)
|
function login(&$mask)
|
||||||
{
|
{
|
||||||
$form = new HTML_QuickForm('login', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
$form = new HTML_QuickForm('login', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
#$form->setRequiredNote(file_get_contents(UI_QFORM_REQUIREDNOTE));
|
|
||||||
$this->_parseArr2Form($form, $mask['languages']);
|
$this->_parseArr2Form($form, $mask['languages']);
|
||||||
$this->_parseArr2Form($form, $mask['login']);
|
$this->_parseArr2Form($form, $mask['login']);
|
||||||
|
|
||||||
|
@ -274,6 +273,8 @@ class uiBrowser extends uiBase {
|
||||||
*
|
*
|
||||||
* Get file's metadata as XML
|
* Get file's metadata as XML
|
||||||
*
|
*
|
||||||
|
* Note: this does not work right with multiple languages
|
||||||
|
*
|
||||||
* @param id int, local id of stored file
|
* @param id int, local id of stored file
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
@ -297,10 +298,15 @@ class uiBrowser extends uiBase {
|
||||||
$handler =& new XML_Unserializer;
|
$handler =& new XML_Unserializer;
|
||||||
$handler->unserialize($this->getMdata($id));
|
$handler->unserialize($this->getMdata($id));
|
||||||
$arr = $handler->getUnserializedData();
|
$arr = $handler->getUnserializedData();
|
||||||
if (!is_array($arr))
|
|
||||||
return FALSE;
|
if (!is_array($arr)) return FALSE;
|
||||||
|
|
||||||
foreach ($arr['metadata'] as $key=>$val) {
|
foreach ($arr['metadata'] as $key=>$val) {
|
||||||
|
|
||||||
|
if (is_array($val)) { ## just workaround
|
||||||
|
$val = current($val);
|
||||||
|
}
|
||||||
|
|
||||||
if ($relations[$key]) {
|
if ($relations[$key]) {
|
||||||
unset($arr['metadata'][$key]);
|
unset($arr['metadata'][$key]);
|
||||||
$arr['metadata'][$relations[tra($key)]] = $val;
|
$arr['metadata'][$relations[tra($key)]] = $val;
|
||||||
|
@ -326,7 +332,7 @@ class uiBrowser extends uiBase {
|
||||||
include dirname(__FILE__).'/formmask/metadata.inc.php';
|
include dirname(__FILE__).'/formmask/metadata.inc.php';
|
||||||
|
|
||||||
extract ($parms);
|
extract ($parms);
|
||||||
$langid = $langid ? $langid : UI_DEFAULT_LANGID;
|
$langid = $langid ? $langid : $this->langid;
|
||||||
|
|
||||||
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER);
|
$form = new HTML_QuickForm('langswitch', UI_STANDARD_FORM_METHOD, UI_BROWSER);
|
||||||
$this->_parseArr2Form($form, $mask['langswitch']);
|
$this->_parseArr2Form($form, $mask['langswitch']);
|
||||||
|
|
|
@ -44,6 +44,10 @@ define('UI_MDATA_KEY_DURATION', 'dcterms:extent');
|
||||||
define('UI_MDATA_KEY_URL', 'ls:url');
|
define('UI_MDATA_KEY_URL', 'ls:url');
|
||||||
define('UI_MDATA_KEY_FORMAT', 'dc:format');
|
define('UI_MDATA_KEY_FORMAT', 'dc:format');
|
||||||
define('UI_MDATA_KEY_DESCRIPTION', 'dc:description');
|
define('UI_MDATA_KEY_DESCRIPTION', 'dc:description');
|
||||||
|
define('UI_MDATA_KEY_CHANNELS', 'ls:channels');
|
||||||
|
define('UI_MDATA_KEY_SAMPLERATE', 'ls:samplerate');
|
||||||
|
define('UI_MDATA_KEY_BITRATE', 'ls:bitrate');
|
||||||
|
define('UI_MDATA_KEY_ENCODER', 'ls:encoder');
|
||||||
define('UI_MDATA_VALUE_FORMAT_FILE', 'File');
|
define('UI_MDATA_VALUE_FORMAT_FILE', 'File');
|
||||||
define('UI_MDATA_VALUE_FORMAT_STREAM', 'live stream');
|
define('UI_MDATA_VALUE_FORMAT_STREAM', 'live stream');
|
||||||
|
|
||||||
|
@ -89,6 +93,33 @@ define('UI_PL_ELEM_FADEOUT', 'fadeOut');
|
||||||
|
|
||||||
## LS stuff
|
## LS stuff
|
||||||
require_once dirname(__FILE__).'/../../storageServer/var/conf.php';
|
require_once dirname(__FILE__).'/../../storageServer/var/conf.php';
|
||||||
|
## extent config
|
||||||
|
$config = array_merge($config,
|
||||||
|
array(
|
||||||
|
'file_types' => array(
|
||||||
|
'.mp3',
|
||||||
|
'.wav',
|
||||||
|
'.ogg'
|
||||||
|
),
|
||||||
|
'stream_types' => array(
|
||||||
|
'application/ogg',
|
||||||
|
'audio/mpeg'
|
||||||
|
),
|
||||||
|
'languages' => array(
|
||||||
|
'ar_JO' => 'Arabic(JO)',
|
||||||
|
'am_AM' => 'Armenian(AM)',
|
||||||
|
'en_GB' => 'English (GB)',
|
||||||
|
'en_US' => 'English (US)',
|
||||||
|
'es_CO' => 'Español (CO)',
|
||||||
|
'cz_CZ' => 'Česky (CZ)',
|
||||||
|
'de_DE' => 'Deutsch (DE)',
|
||||||
|
'hu_HU' => 'Magyar (HU)',
|
||||||
|
'nl_NL' => 'Nederlands (NL)',
|
||||||
|
'sr_CS' => 'Srpski (CS)',
|
||||||
|
'ru_RU' => 'Russia(RU)'
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
require_once dirname(__FILE__).'/ui_base.inc.php';
|
require_once dirname(__FILE__).'/ui_base.inc.php';
|
||||||
require_once dirname(__FILE__).'/ui_scratchpad.class.php';
|
require_once dirname(__FILE__).'/ui_scratchpad.class.php';
|
||||||
require_once dirname(__FILE__).'/ui_playlist.class.php';
|
require_once dirname(__FILE__).'/ui_playlist.class.php';
|
||||||
|
@ -108,20 +139,4 @@ require_once 'HTML/QuickForm.php';
|
||||||
#PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack');
|
#PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack');
|
||||||
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
||||||
#PEAR::setErrorHandling(PEAR_ERROR_PRINT);
|
#PEAR::setErrorHandling(PEAR_ERROR_PRINT);
|
||||||
|
|
||||||
## extent config
|
|
||||||
$config = array_merge($config,
|
|
||||||
array(
|
|
||||||
'file_types' => array(
|
|
||||||
'.mp3',
|
|
||||||
'.wav',
|
|
||||||
'.ogg'
|
|
||||||
),
|
|
||||||
'stream_types' => array(
|
|
||||||
'application/ogg',
|
|
||||||
'audio/mpeg'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -97,50 +97,6 @@ class uiHandler extends uiBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- files ---
|
// --- files ---
|
||||||
/**
|
|
||||||
* uploadFileM
|
|
||||||
*
|
|
||||||
* Provides file upload and store it to the storage
|
|
||||||
*
|
|
||||||
* @param filename string, name for the uploaded file
|
|
||||||
* @param mediafile file uploded by HTTP, raw binary media file
|
|
||||||
* @param mdatafile file uploded by HTTP, metadata XML file
|
|
||||||
* @param id int, destination folder id
|
|
||||||
*/
|
|
||||||
function uploadFileM(&$formdata, $id, &$mask)
|
|
||||||
{
|
|
||||||
if (!$this->_isFolder($id)) {
|
|
||||||
$this->_retMsg('Target is not Folder');
|
|
||||||
$this->redirUrl = UI_BROWSER.'?act=fileList&id='.$id;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (!$this->_validateForm($formdata, $mask)) {
|
|
||||||
$this->redirUrl = UI_BROWSER."?act=uploadFileM&id=".$id;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
$tmpgunid = md5(microtime().$_SERVER['SERVER_ADDR'].rand()."org.mdlf.livesupport");
|
|
||||||
$ntmp = $this->gb->bufferDir.'/'.$tmpgunid;
|
|
||||||
move_uploaded_file($formdata['mediafile']['tmp_name'], $ntmp);
|
|
||||||
chmod($ntmp, 0664);
|
|
||||||
if($formdata['mdatafile']['tmp_name']){
|
|
||||||
$mdtmp = "$ntmp.xml";
|
|
||||||
if(move_uploaded_file($formdata['mdatafile']['tmp_name'], $mdtmp)){
|
|
||||||
chmod($mdtmp, 0664);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$r = $this->gb->putFile($id, $formdata['mediafile']['name'], $ntmp, $mdtmp, $this->sessid);
|
|
||||||
@unlink($ntmp);
|
|
||||||
@unlink($mdtmp);
|
|
||||||
if(PEAR::isError($r)) {
|
|
||||||
$this->_retMsg($r->getMessage());
|
|
||||||
$this->redirUrl = UI_BROWSER."?act=uploadFileM&id=".$id;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
$this->redirUrl = UI_BROWSER."?act=fileList&id=".$id;
|
|
||||||
return $r;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uploadFile
|
* uploadFile
|
||||||
*
|
*
|
||||||
|
@ -213,6 +169,13 @@ class uiHandler extends uiBase {
|
||||||
$this->_setMdataValue($id, UI_MDATA_KEY_DURATION, $this->gb->_secsToPlTime($ia['playtime_seconds']));
|
$this->_setMdataValue($id, UI_MDATA_KEY_DURATION, $this->gb->_secsToPlTime($ia['playtime_seconds']));
|
||||||
$this->_setMDataValue($id, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_FILE);
|
$this->_setMDataValue($id, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_FILE);
|
||||||
|
|
||||||
|
// some data from raw audio
|
||||||
|
if ($ia['audio']['channels']) $this->_setMDataValue($id, UI_MDATA_KEY_CHANNELS, $ia['audio']['channels']);
|
||||||
|
if ($ia['audio']['sample_rate'])$this->_setMDataValue($id, UI_MDATA_KEY_SAMPLERATE, $ia['audio']['sample_rate']);
|
||||||
|
if ($ia['audio']['bitrate']) $this->_setMDataValue($id, UI_MDATA_KEY_BITRATE, $ia['audio']['bitrate']);
|
||||||
|
if ($ia['audio']['codec']) $this->_setMDataValue($id, UI_MDATA_KEY_ENCODER, $ia['audio']['codec']);
|
||||||
|
|
||||||
|
// from id3 Tags
|
||||||
foreach ($mask['pages'] as $key=>$val) {
|
foreach ($mask['pages'] as $key=>$val) {
|
||||||
foreach ($mask['pages'][$key] as $k=>$v) {
|
foreach ($mask['pages'][$key] as $k=>$v) {
|
||||||
if ($v['id3'] != FALSE) {
|
if ($v['id3'] != FALSE) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ class uiScheduler extends uiCalendar
|
||||||
function uiScheduler(&$uiBase)
|
function uiScheduler(&$uiBase)
|
||||||
{
|
{
|
||||||
$this->curr =& $_SESSION[UI_CALENDAR_SESSNAME]['current'];
|
$this->curr =& $_SESSION[UI_CALENDAR_SESSNAME]['current'];
|
||||||
$this->scheduleAt =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAt'];
|
$this->scheduleAtTime =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleAtTime'];
|
||||||
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
|
$this->schedulePrev =& $_SESSION[UI_CALENDAR_SESSNAME]['schedulePrev'];
|
||||||
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
|
$this->scheduleNext =& $_SESSION[UI_CALENDAR_SESSNAME]['scheduleNext'];
|
||||||
|
|
||||||
|
@ -44,10 +44,10 @@ class uiScheduler extends uiCalendar
|
||||||
function set($arr)
|
function set($arr)
|
||||||
{
|
{
|
||||||
extract($arr);
|
extract($arr);
|
||||||
#print_r($arr);
|
|
||||||
if (isset($view)) $this->curr['view'] = $view;
|
|
||||||
|
|
||||||
if (is_numeric($year)) $this->curr['year'] = $year;
|
if (isset($view)) $this->curr['view'] = $view;
|
||||||
|
if (isset($today)) list($year, $month, $day) = explode("-", strftime("%Y-%m-%d"));
|
||||||
|
if (is_numeric($year)) $this->curr['year'] = sprintf('%04d', $year);
|
||||||
if (is_numeric($month)) $this->curr['month'] = sprintf('%02d', $month);
|
if (is_numeric($month)) $this->curr['month'] = sprintf('%02d', $month);
|
||||||
if (is_numeric($day)) $this->curr['day'] = sprintf('%02d', $day);
|
if (is_numeric($day)) $this->curr['day'] = sprintf('%02d', $day);
|
||||||
if (is_numeric($hour)) $this->curr['hour'] = sprintf('%02d', $hour);
|
if (is_numeric($hour)) $this->curr['hour'] = sprintf('%02d', $hour);
|
||||||
|
@ -55,21 +55,12 @@ class uiScheduler extends uiCalendar
|
||||||
$stampNow = $this->_datetime2timestamp($this->curr['year'].$this->curr['month'].$this->curr['day'].'T'.$this->curr['hour'].':00:00');
|
$stampNow = $this->_datetime2timestamp($this->curr['year'].$this->curr['month'].$this->curr['day'].'T'.$this->curr['hour'].':00:00');
|
||||||
$stampTarget = $stampNow;
|
$stampTarget = $stampNow;
|
||||||
|
|
||||||
if ($month==='++')
|
if ($month==='++') $stampTarget = strtotime("+1 month", $stampNow);
|
||||||
$stampTarget = strtotime("+1 month", $stampNow);
|
if ($month==='--') $stampTarget = strtotime("-1 month", $stampNow);
|
||||||
if ($month==='--')
|
if ($week==='++') $stampTarget = strtotime("+1 week", $stampNow);
|
||||||
$stampTarget = strtotime("-1 month", $stampNow);
|
if ($week==='--') $stampTarget = strtotime("-1 week", $stampNow);
|
||||||
if ($week==='++')
|
if ($day==='++') $stampTarget = strtotime("+1 day", $stampNow);
|
||||||
$stampTarget = strtotime("+1 week", $stampNow);
|
if ($day==='--') $stampTarget = strtotime("-1 day", $stampNow);
|
||||||
if ($week==='--')
|
|
||||||
$stampTarget = strtotime("-1 week", $stampNow);
|
|
||||||
if ($day==='++')
|
|
||||||
$stampTarget = strtotime("+1 day", $stampNow);
|
|
||||||
if ($day==='--')
|
|
||||||
$stampTarget = strtotime("-1 day", $stampNow);
|
|
||||||
|
|
||||||
if ($today)
|
|
||||||
$stampTarget = time();
|
|
||||||
|
|
||||||
$this->curr['year'] = strftime("%Y", $stampTarget);
|
$this->curr['year'] = strftime("%Y", $stampTarget);
|
||||||
$this->curr['month'] = strftime("%m", $stampTarget);
|
$this->curr['month'] = strftime("%m", $stampTarget);
|
||||||
|
@ -87,29 +78,44 @@ class uiScheduler extends uiCalendar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function setScheduleAt($arr)
|
/**
|
||||||
|
* setScheduleAtTime
|
||||||
|
*
|
||||||
|
* set the schedule time given by parameters,
|
||||||
|
* calculate previous and next clip to snap with it
|
||||||
|
*
|
||||||
|
* @param input array, contains date and time
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
|
||||||
|
function setScheduleAtTime($arr)
|
||||||
{
|
{
|
||||||
extract($arr);
|
extract($arr);
|
||||||
#print_r($arr);
|
|
||||||
|
|
||||||
if (is_numeric($year)) $this->scheduleAt['year'] = $year;
|
if (isset($today)) list($year, $month, $day) = explode("-", strftime("%Y-%m-%d"));
|
||||||
if (is_numeric($month)) $this->scheduleAt['month'] = sprintf('%02d', $month);
|
if (is_numeric($year)) $this->scheduleAtTime['year'] = sprintf('%04d', $year);
|
||||||
if (is_numeric($day)) $this->scheduleAt['day'] = sprintf('%02d', $day);
|
if (is_numeric($month)) $this->scheduleAtTime['month'] = sprintf('%02d', $month);
|
||||||
if (is_numeric($hour)) $this->scheduleAt['hour'] = sprintf('%02d', $hour);
|
if (is_numeric($day)) $this->scheduleAtTime['day'] = sprintf('%02d', $day);
|
||||||
if (is_numeric($minute)) $this->scheduleAt['minute'] = sprintf('%02d', $minute);
|
if (is_numeric($hour)) $this->scheduleAtTime['hour'] = sprintf('%02d', $hour);
|
||||||
if (is_numeric($second)) $this->scheduleAt['second'] = sprintf('%02d', $second);
|
if (is_numeric($minute)) $this->scheduleAtTime['minute'] = sprintf('%02d', $minute);
|
||||||
|
if (is_numeric($second)) $this->scheduleAtTime['second'] = sprintf('%02d', $second);
|
||||||
|
|
||||||
|
$this->scheduleAtTime['stamp'] = $this->_datetime2timestamp($this->scheduleAtTime['year'].$this->scheduleAtTime['month'].$this->scheduleAtTime['day'].'T'.
|
||||||
|
$this->scheduleAtTime['hour'].':'.$this->scheduleAtTime['minute'].':'.$this->scheduleAtTime['second']);
|
||||||
|
|
||||||
$week = $this->getWeekEntrys();
|
$week = $this->getWeekEntrys();
|
||||||
|
|
||||||
## search for previous entry
|
## search for previous entry
|
||||||
if (count($week[$this->scheduleAt['day']]) >= 1) {
|
if (count($week[$this->scheduleAtTime['day']]) >= 1) {
|
||||||
foreach (array_reverse($week[$this->scheduleAt['day']]) as $entry) {
|
foreach (array_reverse($week[$this->scheduleAtTime['day']]) as $hourly) {
|
||||||
if (strtotime($entry[0]['end']) <= strtotime($this->scheduleAt['hour'].':'.$this->scheduleAt['minute'].':'.$this->scheduleAt['second'])) {
|
foreach (array_reverse($hourly) as $entry) {
|
||||||
|
if ($entry['end_stamp'] <= $this->scheduleAtTime['stamp']) {
|
||||||
$prev = TRUE;
|
$prev = TRUE;
|
||||||
list ($this->schedulePrev['hour'], $this->schedulePrev['minute'], $this->schedulePrev['second'])
|
list ($this->schedulePrev['hour'], $this->schedulePrev['minute'], $this->schedulePrev['second']) =
|
||||||
= explode (':', strftime('%H:%M:%S', strtotime('+'.UI_SCHEDULER_PAUSE_PL2PL, strtotime($entry[0]['end'])))
|
explode (':', strftime('%H:%M:%S', strtotime('+'.UI_SCHEDULER_PAUSE_PL2PL, strtotime($entry['end'])))
|
||||||
);
|
);
|
||||||
break;
|
break 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,26 +129,28 @@ class uiScheduler extends uiCalendar
|
||||||
reset ($week);
|
reset ($week);
|
||||||
|
|
||||||
## search for next entry
|
## search for next entry
|
||||||
if (count($week[$this->scheduleAt['day']]) >= 1) {
|
if (count($week[$this->scheduleAtTime['day']]) >= 1) {
|
||||||
foreach ($week[$this->scheduleAt['day']] as $entry) {
|
foreach ($week[$this->scheduleAtTime['day']] as $hourly) {
|
||||||
if (strtotime($entry[0]['start']) >= strtotime($this->scheduleAt['hour'].':'.$this->scheduleAt['minute'].':'.$this->scheduleAt['second'])) {
|
foreach (array_reverse($hourly) as $entry) {
|
||||||
|
if ($entry['start_stamp'] >= $this->scheduleAtTime['stamp']) {
|
||||||
$next = TRUE;
|
$next = TRUE;
|
||||||
list ($this->scheduleNext['hour'], $this->scheduleNext['minute'], $this->scheduleNext['second'])
|
list ($this->scheduleNext['hour'], $this->scheduleNext['minute'], $this->scheduleNext['second']) =
|
||||||
= explode (':', strftime('%H:%M:%S', strtotime('-'.UI_SCHEDULER_PAUSE_PL2PL, strtotime($entry[0]['start']))));
|
explode (':', strftime('%H:%M:%S', strtotime('-'.UI_SCHEDULER_PAUSE_PL2PL, strtotime($entry['start']))));
|
||||||
break;
|
break 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($next !== TRUE) {
|
if ($next !== TRUE) {
|
||||||
## end at midnight
|
## end one sec. before midnight
|
||||||
$thisDay = $this->scheduleAt['year']."-".$this->scheduleAt['month']."-".$this->scheduleAt['day'];
|
$thisDay = $this->scheduleAtTime['year']."-".$this->scheduleAtTime['month']."-".$this->scheduleAtTime['day'];
|
||||||
$nextDayStamp = strtotime('+1 day', $thisDay);
|
$nextDayStamp = strtotime('+1 day', $thisDay);
|
||||||
$this->scheduleNext['year'] = strftime('%Y', $nextDayStamp);
|
$this->scheduleNext['year'] = strftime('%Y', $nextDayStamp);
|
||||||
$this->scheduleNext['month'] = strftime('%m', $nextDayStamp);;
|
$this->scheduleNext['month'] = strftime('%m', $nextDayStamp);;
|
||||||
$this->scheduleNext['day'] = strftime('%d', $nextDayStamp);
|
$this->scheduleNext['day'] = strftime('%d', $nextDayStamp);
|
||||||
$this->scheduleNext['hour'] = 0;
|
$this->scheduleNext['hour'] = 23;
|
||||||
$this->scheduleNext['minute'] = 0;
|
$this->scheduleNext['minute'] = 59;
|
||||||
$this->scheduleNext['second'] = 0;
|
$this->scheduleNext['second'] = 59;
|
||||||
}
|
}
|
||||||
|
|
||||||
#print_r($this->schedulePrev);
|
#print_r($this->schedulePrev);
|
||||||
|
@ -169,6 +177,8 @@ class uiScheduler extends uiCalendar
|
||||||
'scheduleid'=> $val['id'],
|
'scheduleid'=> $val['id'],
|
||||||
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
|
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
|
||||||
'end' => substr($val['end'], strpos($val['end'], 'T')+1),
|
'end' => substr($val['end'], strpos($val['end'], 'T')+1),
|
||||||
|
'start_stamp' => $this->_datetime2timestamp($val['start']),
|
||||||
|
'end_stamp' => $this->_datetime2timestamp($val['end']),
|
||||||
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||||
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||||
'type' => 'Playlist'
|
'type' => 'Playlist'
|
||||||
|
@ -257,58 +267,6 @@ class uiScheduler extends uiCalendar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
function getDayTiming($year, $month, $day)
|
|
||||||
{
|
|
||||||
#echo $year.$month.$day;
|
|
||||||
$day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00');
|
|
||||||
$day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59');
|
|
||||||
|
|
||||||
if (!$arr = $this->getDayUsage($year, $month, $day))
|
|
||||||
return array(array( ## empty day
|
|
||||||
'type' => 'gap',
|
|
||||||
'length' => $day_end - $day_start
|
|
||||||
));
|
|
||||||
|
|
||||||
$curr = current($arr);
|
|
||||||
if ($this->_strtotime($curr['start']) > $day_start) ## insert gap if first entry start after 00:00:00
|
|
||||||
$list[] = array(
|
|
||||||
'type' => 'gap',
|
|
||||||
#'pos' => 0,
|
|
||||||
'length' => $this->_strtotime($curr['start']) - $day_start
|
|
||||||
);
|
|
||||||
|
|
||||||
while ($curr = current($arr)) {
|
|
||||||
$list[] = array(
|
|
||||||
'type' => 'entry',
|
|
||||||
#'pos' => $this->_strtotime($curr['start']) - $day_start,
|
|
||||||
'length' => $this->_strtotime($curr['end']) - $this->_strtotime($curr['start']),
|
|
||||||
'entry' => $curr
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($next = next($arr)) {
|
|
||||||
if ($this->_strtotime($next['start']) > $this->_strtotime($curr['end'])+1) ## insert gap between entrys
|
|
||||||
$list[] = array(
|
|
||||||
'type' => 'gap',
|
|
||||||
#'pos' => $this->_strtotime($curr['start'])-$day_start,
|
|
||||||
'length' => $this->_strtotime($next['start']) - $this->_strtotime($curr['end']),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ($this->_strtotime($curr['end']) < $day_end) ## insert gap if prev entry was not until midnight
|
|
||||||
$list[] = array(
|
|
||||||
'type' => 'gap',
|
|
||||||
#'pos' => $this->_strtotime($curr['end']) - $day_start,
|
|
||||||
'length' => $day_end - $this->_strtotime($curr['end']),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
#print_r($list);
|
|
||||||
return $list;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
function getDayTimingScale()
|
function getDayTimingScale()
|
||||||
{
|
{
|
||||||
for ($n = 0; $n <= 23; $n++) {
|
for ($n = 0; $n <= 23; $n++) {
|
||||||
|
@ -331,13 +289,13 @@ class uiScheduler extends uiCalendar
|
||||||
|
|
||||||
$form = new HTML_QuickForm('schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
$form = new HTML_QuickForm('schedule', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
$this->Base->_parseArr2Form($form, $ui_fmask['schedule']);
|
$this->Base->_parseArr2Form($form, $ui_fmask['schedule']);
|
||||||
$settime = array('H' => $this->scheduleAt['hour'],
|
$settime = array('H' => $this->scheduleAtTime['hour'],
|
||||||
'i' => $this->scheduleAt['minute'],
|
'i' => $this->scheduleAtTime['minute'],
|
||||||
's' => $this->scheduleAt['second']
|
's' => $this->scheduleAtTime['second']
|
||||||
);
|
);
|
||||||
$setdate = array('Y' => $this->scheduleAt['year'],
|
$setdate = array('Y' => $this->scheduleAtTime['year'],
|
||||||
'm' => $this->scheduleAt['month'],
|
'm' => $this->scheduleAtTime['month'],
|
||||||
'd' => $this->scheduleAt['day']
|
'd' => $this->scheduleAtTime['day']
|
||||||
);
|
);
|
||||||
$form->setDefaults(array('time' => $settime,
|
$form->setDefaults(array('time' => $settime,
|
||||||
'date' => $setdate,
|
'date' => $setdate,
|
||||||
|
@ -351,8 +309,23 @@ class uiScheduler extends uiCalendar
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getPLtoSchedule($id)
|
||||||
|
{
|
||||||
|
if ($id) {
|
||||||
|
$this->Base->SCRATCHPAD->addItem($id);
|
||||||
|
$this->availablePlaylists[] = array(
|
||||||
|
'gunid' => $this->Base->gb->_gunidFromId($id),
|
||||||
|
'title' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_TITLE),
|
||||||
|
'duration' => $this->Base->_getMDataValue($id, UI_MDATA_KEY_DURATION),
|
||||||
|
);
|
||||||
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
return $this->copyPLfromSP();
|
||||||
|
}
|
||||||
|
|
||||||
function copyPlFromSP()
|
}
|
||||||
|
|
||||||
|
function copyPlfromSP()
|
||||||
{
|
{
|
||||||
foreach ($this->Base->SCRATCHPAD->get() as $val) {
|
foreach ($this->Base->SCRATCHPAD->get() as $val) {
|
||||||
if ($val['type'] === 'playlist' && $this->Base->gb->playlistIsAvailable($val['id'], $this->Base->sessid) === TRUE && $val['id'] != $this->Base->PLAYLIST->activeId)
|
if ($val['type'] === 'playlist' && $this->Base->gb->playlistIsAvailable($val['id'], $this->Base->sessid) === TRUE && $val['id'] != $this->Base->PLAYLIST->activeId)
|
||||||
|
@ -371,10 +344,10 @@ class uiScheduler extends uiCalendar
|
||||||
$xmldatetime = str_replace('-', '', $datetime);
|
$xmldatetime = str_replace('-', '', $datetime);
|
||||||
$pl = $this->displayScheduleMethod($xmldatetime, $xmldatetime);
|
$pl = $this->displayScheduleMethod($xmldatetime, $xmldatetime);
|
||||||
|
|
||||||
if(!is_array($pl) || !count($pl)) return FALSE;
|
if (!is_array($pl) || !count($pl)) return FALSE;
|
||||||
|
|
||||||
$pl = current($pl);
|
$pl = current($pl);
|
||||||
$offset = strftime('%H:%M:%S', time() - $this->_datetime2timestamp($pl['start']) - 3600); ## subtract 3600 sec. becausefor some reason strftime('%H:%M:%S', 0) is 01:00:00
|
$offset = strftime('%H:%M:%S', time() - $this->_datetime2timestamp($pl['start']) - 3600 * strftime('%H', 0)); ## subtract difference to UTC
|
||||||
|
|
||||||
$clip = $this->Base->gb->displayPlaylistClipAtOffset($this->Base->sessid, $pl['playlistId'], $offset, $distance);
|
$clip = $this->Base->gb->displayPlaylistClipAtOffset($this->Base->sessid, $pl['playlistId'], $offset, $distance);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue