*** empty log message ***
This commit is contained in:
parent
b818d6b0d6
commit
ef8067a20f
18 changed files with 219 additions and 112 deletions
|
@ -564,14 +564,14 @@ $ui_fmask = array(
|
|||
'element' => 'switchdown',
|
||||
'type' => 'button',
|
||||
'label' => '-',
|
||||
'attributes'=> array('onClick' => 'switchDown()'),
|
||||
'attributes'=> array('onClick' => 'pl_switchDown()', 'onMousedown' => 'pl_start("Down")', 'onMouseUp' => "pl_stop()", 'onMouseOut' => "pl_stop()"),
|
||||
'groupit' => TRUE
|
||||
),
|
||||
array(
|
||||
'element' => 'switchup',
|
||||
'type' => 'button',
|
||||
'label' => '+',
|
||||
'attributes'=> array('onClick' => 'switchUp()'),
|
||||
'attributes'=> array('onClick' => 'pl_switchUp()', 'onMousedown' => 'pl_start("Up")', 'onMouseUp' => "pl_stop()", 'onMouseOut' => "pl_stop()"),
|
||||
'groupit' => TRUE
|
||||
),
|
||||
array(
|
||||
|
|
|
@ -43,7 +43,7 @@ if (is_array($_REQUEST['popup'])){
|
|||
|
||||
case "PL.changeTransition";
|
||||
$Smarty->assign('dynform', $uiBrowser->PLAYLIST->changeTransitionForm($_REQUEST['id'], $_REQUEST['type'], $ui_fmask['PL.changeTransition']));
|
||||
$Smarty->display('popup/PL.changeTransition.tpl');
|
||||
$Smarty->display('playlist/changeTransition.tpl');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,18 +173,15 @@ switch($_REQUEST['act']){
|
|||
break;
|
||||
|
||||
case "PL.activate":
|
||||
$uiHandler->PLAYLIST->setReload();
|
||||
if ($uiHandler->PLAYLIST->activate($_REQUEST['id']) === TRUE) {
|
||||
if ($uiHandler->PLAYLIST->activate($_REQUEST['id']) === TRUE)
|
||||
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
|
||||
}
|
||||
$uiHandler->PLAYLIST->setReload();
|
||||
break;
|
||||
|
||||
case "PL.create":
|
||||
$uiHandler->PLAYLIST->setReload();
|
||||
if (($ui_tmpid = $uiHandler->PLAYLIST->create($_REQUEST['id'])) !== FALSE) {
|
||||
if (($ui_tmpid = $uiHandler->PLAYLIST->create($_REQUEST['id'])) !== FALSE)
|
||||
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
||||
}
|
||||
|
||||
$uiHandler->PLAYLIST->setReload();
|
||||
break;
|
||||
|
||||
case "PL.addItem":
|
||||
|
@ -203,7 +200,8 @@ switch($_REQUEST['act']){
|
|||
break;
|
||||
|
||||
case "PL.save":
|
||||
$uiHandler->PLAYLIST->save();
|
||||
if (($ui_tmpid = $uiHandler->PLAYLIST->save()) !== FALSE)
|
||||
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
||||
$uiHandler->PLAYLIST->setReload();
|
||||
break;
|
||||
|
||||
|
@ -217,12 +215,17 @@ switch($_REQUEST['act']){
|
|||
$uiHandler->PLAYLIST->setReload();
|
||||
break;
|
||||
|
||||
case "PL.moveItem":
|
||||
$uiHandler->PLAYLIST->moveItem($_REQUEST['id'], $_REQUEST['pos']);
|
||||
$uiHandler->PLAYLIST->setReload();
|
||||
break;
|
||||
|
||||
case "SCHEDULER.set":
|
||||
$uiHandler->SCHEDULER->set($_REQUEST);
|
||||
$uiHandler->SCHEDULER->setReload();
|
||||
break;
|
||||
|
||||
case "SCHEDULER.uploadPlaylistMethod":
|
||||
case "SCHEDULER.uploadPlaylistMethod":
|
||||
$uiHandler->SCHEDULER->uploadPlaylistMethod($_REQUEST);
|
||||
$uiHandler->SCHEDULER->setReload();
|
||||
break;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<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=$FLAT item='i'}
|
||||
{foreach from=$FLAT key='pos' item='i'}
|
||||
<!-- {$n++} -->
|
||||
<tr onMouseOver="highlight()"
|
||||
onMouseOut="darklight()"
|
||||
|
@ -12,7 +12,13 @@
|
|||
<tr onMouseOver="highlight()"
|
||||
onMouseOut="darklight()"
|
||||
onContextmenu="return menu('{$i.attrs.id}', 'PL.removeItem')" style="background-color: {cycle values='#eeeeee, #dadada'}">
|
||||
<td><input type="checkbox" name="{$i.attrs.id}"></td>
|
||||
<td>
|
||||
<input type="checkbox" name="{$i.attrs.id}">
|
||||
<font size="+1">
|
||||
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=PL.moveItem&id={$i.attrs.id}&pos={$pos-1}')">↑</a>
|
||||
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=PL.moveItem&id={$i.attrs.id}&pos={$pos+1}')">↓</a>
|
||||
</font>
|
||||
</td>
|
||||
<td>{$i.title}</td>
|
||||
<td>{$i.duration}</td>
|
||||
<td>{$i.type}</td>
|
||||
|
@ -28,7 +34,7 @@
|
|||
|
||||
<tr style="background-color: {cycle values='#eeeeee, #dadada'}">
|
||||
<td><input type="checkbox" name="all" onClick="form_switchAll('PL')"></th>
|
||||
<td align="center" colspan="2"><a href="#" onClick="form_submit('PL')">[Remove Selected]</a></th>
|
||||
<td align="center" colspan="2"><a href="#" onClick="form_submit('PL', 'PL.removeItem')">[Remove Selected]</a></th>
|
||||
<td align="center" colspan="2"><a href="#" onClick="form_clearAll('PL')">[Clear]</a></th>
|
||||
</tr>
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
{*Smarty template*}
|
||||
|
||||
{include file="header.tpl"}
|
||||
{include file="script/PL.changeTransition.js.tpl"}
|
||||
{include file="sub/dynForm_plain.tpl"}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -47,12 +47,12 @@
|
|||
|
||||
{if $_Day.isEmpty}
|
||||
<div>
|
||||
{elseif $_Day.isSelected}
|
||||
{elseif $_Day.isCurrent}
|
||||
<div style="background-color: lightblue">
|
||||
{else}
|
||||
<div style="background-color: white">
|
||||
{/if}
|
||||
{if $_Day.isScheduled}
|
||||
{if $_Day.isSelected}
|
||||
<b><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')">{$_Day.day}</a></b>
|
||||
{else}
|
||||
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')">{$_Day.day}</a>
|
||||
|
|
|
@ -3,8 +3,13 @@
|
|||
<table border=1>
|
||||
|
||||
{foreach from=$SCHEDULER->Day item="_Hour"}
|
||||
{assign var="_hour" value=$_Hour.hour}
|
||||
<tr>
|
||||
<td {include file="scheduler/contextmenu.tpl"}>
|
||||
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}')">{$_Hour.hour}
|
||||
</td>
|
||||
|
||||
<tr><td><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}')">{$_Hour.hour}</td></tr>
|
||||
</tr>
|
||||
|
||||
{/foreach}
|
||||
|
||||
|
|
|
@ -10,7 +10,11 @@
|
|||
</tr>
|
||||
|
||||
{foreach from=$SCHEDULER->Month item="_Day"}
|
||||
{assign var="percentage" value=$SCHEDULER->getDayUsagePercentage($_Day.year, $_Day.month, $_Day.day)}
|
||||
{if $_Day.isSelected}
|
||||
{assign var="percentage" value=$SCHEDULER->getDayUsagePercentage($_Day.year, $_Day.month, $_Day.day)}
|
||||
{else}
|
||||
{assign var="percentage" value="0"}
|
||||
{/if}
|
||||
|
||||
{if $_Day.isFirst}
|
||||
<tr>
|
||||
|
@ -20,7 +24,7 @@
|
|||
<td> </td>
|
||||
{else}
|
||||
<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&day={$_Day.day}')">{$_Day.day}
|
||||
<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>
|
||||
{/if}
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
{/foreach}
|
||||
</select>
|
||||
<input type="hidden" name="sc_last">
|
||||
<input value="00" type="text" size="2" name="hour" onClick="sc_act(this)" onChange="sc_checkrange(); sc_twodigits()" onBlur="sc_check_int(this)"> :
|
||||
<input value="{$SCHEDULER->curr.hour}" type="text" size="2" name="hour" onClick="sc_act(this)" onChange="sc_checkrange(); sc_twodigits()" onBlur="sc_check_int(this)"> :
|
||||
<input value="00" type="text" size="2" name="min" onClick="sc_act(this)" onChange="sc_checkrange(); sc_twodigits()" onBlur="sc_check_int(this)"> :
|
||||
<input value="00" type="text" size="2" name="sec" onClick="sc_act(this)" onChange="sc_checkrange(); sc_twodigits()" onBlur="sc_check_int(this)">
|
||||
<a href="#" onMouseDown="sc_start('-')" onMouseUp="sc_stop()" onMouseOut="sc_stop()">-</a>
|
||||
<a href="#" onMouseDown="sc_start('+')" onMouseUp="sc_stop()" onMouseOut="sc_stop()">+</a>
|
||||
<a href="#" onClick="sc_change('-')" onMouseDown="sc_start('-')" onMouseUp="sc_stop()" onMouseOut="sc_stop()">-</a>
|
||||
<a href="#" onClick="sc_change('+')" onMouseDown="sc_start('+')" onMouseUp="sc_stop()" onMouseOut="sc_stop()">+</a>
|
||||
|
||||
<br>
|
||||
<input type="button" value="schedule" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.uploadPlaylistMethod&gunid='+schedule_it.gunid.value+'&time='+schedule_it.hour.value+':'+schedule_it.min.value+':'+schedule_it.sec.value)">
|
||||
|
@ -25,7 +25,7 @@ var sc_loop;
|
|||
|
||||
function sc_start(direction)
|
||||
{
|
||||
sc_loop = setInterval("sc_change('" + direction + "')", 80);
|
||||
sc_loop = setInterval("sc_change('" + direction + "')", 150);
|
||||
}
|
||||
|
||||
function sc_stop()
|
||||
|
|
|
@ -3,39 +3,31 @@
|
|||
<table border=1>
|
||||
|
||||
<tr>
|
||||
<td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=--')"><<</a> </td>
|
||||
{foreach from=$SCHEDULER->Week item="_Weekday"}
|
||||
<td>{$_Weekday.label.full}</td>
|
||||
{/foreach}
|
||||
<td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=%2B%2B')">>></a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
{foreach from=$SCHEDULER->Week item="_Day"}
|
||||
{if $_Day.isFirst}
|
||||
<tr>
|
||||
{/if}
|
||||
|
||||
{if $_Day.isEmpty}
|
||||
<td> </td>
|
||||
{else}
|
||||
<td valign="top">
|
||||
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')"><b>{$_Day.day}</b></a>
|
||||
<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>
|
||||
{if $_Day.isSelected}
|
||||
{assign var="_oneday" value=$SCHEDULER->getDayUsage($_Day.year, $_Day.month, $_Day.day)}
|
||||
{if is_array($_oneday)}
|
||||
<table border="1" style="font-family : monospace">
|
||||
{foreach from=$_oneday item="i"}
|
||||
<tr><td>
|
||||
Start:{$i.start|regex_replace:"/[0-9]+T/":""}
|
||||
<br>
|
||||
End: {$i.end|regex_replace:"/[0-9]+T/":""}
|
||||
</td></tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
{/if}
|
||||
</td>
|
||||
{/if}
|
||||
|
||||
{if $_Day.isLast}
|
||||
</tr>
|
||||
{/if}
|
||||
<table border="1" style="font-family : monospace">
|
||||
{foreach from=$_oneday item="i"}
|
||||
<tr><td>
|
||||
Start:{$i.start|regex_replace:"/[0-9]+T/":""}
|
||||
<br>
|
||||
End: {$i.end|regex_replace:"/[0-9]+T/":""}
|
||||
</td></tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
{/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
|
|
@ -31,8 +31,14 @@
|
|||
{/foreach}
|
||||
<tr style="background-color: {cycle values='#eeeeee, #dadada'}">
|
||||
<td><input type="checkbox" name="all" onClick="form_switchAll('SP')"></th>
|
||||
<td align="center" colspan="2"><a href="#" onClick="form_submit('SP')">[Remove Selected]</a></th>
|
||||
<td align="center" colspan="2"><a href="#" onClick="form_clearAll('SP')">[Clear]</a></th>
|
||||
<td align="center" colspan="2">
|
||||
<select>
|
||||
<option>Multiple Action:</option>
|
||||
<option onClick="form_submit('SP', 'SP.removeItem')">Remove</option>
|
||||
<option onClick="form_submit('SP', 'PL.addItem')">Add to Playlist</option>
|
||||
</select>
|
||||
</th>
|
||||
<td align="center" colspan="2"><a href="#" onClick="form_clearAll('SP', 'SP.removeItem')">[Clear]</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script type="text/javascript">
|
||||
{literal}
|
||||
function switchUp()
|
||||
function pl_switchUp()
|
||||
{
|
||||
if (Number(document.forms['PL_changeTransition'].elements['duration'].value) < 5000) {
|
||||
document.forms['PL_changeTransition'].elements['duration'].value = Number(document.forms['PL_changeTransition'].elements['duration'].value) + 100;
|
||||
|
@ -9,7 +9,7 @@ function switchUp()
|
|||
}
|
||||
}
|
||||
|
||||
function switchDown()
|
||||
function pl_switchDown()
|
||||
{
|
||||
if (Number(document.forms['PL_changeTransition'].elements['duration'].value) > 99) {
|
||||
document.forms['PL_changeTransition'].elements['duration'].value = Number(document.forms['PL_changeTransition'].elements['duration'].value) - 100;
|
||||
|
@ -19,5 +19,18 @@ function switchDown()
|
|||
else document.forms['PL_changeTransition'].elements['type'][0].checked = true;
|
||||
} */
|
||||
}
|
||||
|
||||
var pl_loop;
|
||||
|
||||
function pl_start(direction)
|
||||
{
|
||||
pl_loop = setInterval("pl_switch"+ direction + "()", 100);
|
||||
}
|
||||
|
||||
function pl_stop()
|
||||
{
|
||||
clearInterval(pl_loop);
|
||||
}
|
||||
|
||||
{/literal}
|
||||
</script>
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
function form_submit(formname)
|
||||
function form_submit(formname, action)
|
||||
{
|
||||
var href = '{/literal}{$UI_HANDLER}?act='+formname+'.removeItem{literal}';
|
||||
var href = '{/literal}{$UI_HANDLER}{literal}?act='+action;
|
||||
var n;
|
||||
|
||||
for (n=0; n < (document.forms[formname].elements.length-1); n++) {
|
||||
if (document.forms[formname].elements[n].checked) {
|
||||
for (n=0; n < (document.forms[formname].elements.length); n++) {
|
||||
if (document.forms[formname].elements[n].checked && document.forms[formname].elements[n].name!='all') {
|
||||
href = href + '&id[]=' + document.forms[formname].elements[n].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
hpopup(href);
|
||||
}
|
||||
|
||||
|
@ -26,12 +26,12 @@ function form_switchAll(formname)
|
|||
}
|
||||
}
|
||||
|
||||
function form_clearAll(formname)
|
||||
function form_clearAll(formname, action)
|
||||
{
|
||||
if (confirm("{/literal}{tra 0='Are you sure to remove all Items?'}{literal}")) {
|
||||
document.forms[formname].elements['all'].checked = true;
|
||||
form_switchAll(formname);
|
||||
form_submit(formname);
|
||||
form_submit(formname, action);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -79,6 +79,10 @@ function menu(id) {
|
|||
case "fileList":
|
||||
menuHtml = menuHtml + "<tr><td><a class='menu' href='{/literal}{$UI_BROWSER}{literal}?act=fileList&id="+id+"'"+oF+"> List Folder </a></td></tr>";
|
||||
break;
|
||||
|
||||
case "SCHEDULER.schedule":
|
||||
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' onClick=\"hpopup('{/literal}{$UI_HANDLER}{literal}?act=SCHEDULER.set&view=schedule&hour="+id+"')\" "+oF+"> Schedule Playlist </a></td></tr>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
document.getElementById('menucontainer').innerHTML = menuHeader + menuHtml + menuFooter;
|
||||
|
|
|
@ -44,16 +44,11 @@ class uiCalendar
|
|||
{
|
||||
if (is_array($this->Month)) return FALSE;
|
||||
|
||||
require_once 'Calendar/Calendar.php';
|
||||
require_once 'Calendar/Month/Weekdays.php';
|
||||
require_once 'Calendar/Day.php';
|
||||
|
||||
$Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], $this->firstDayOfWeek);
|
||||
# mark today #
|
||||
$sel = new Calendar_Day($this->curr['year'], $this->curr['month'], $this->curr['day']);
|
||||
$selections = array($sel);
|
||||
|
||||
$Month->build($selections);
|
||||
$Month->build($this->_scheduledDays('month')); ## scheduled days are selected
|
||||
while ($Day = $Month->fetch()) {
|
||||
$corrMonth = $Day->thisMonth()<=12 ? $this->Base->_twoDigits($Day->thisMonth()) : '01'; ## due to bug in
|
||||
$corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1; ## Calendar_Month_Weekdays
|
||||
|
@ -67,7 +62,7 @@ class uiCalendar
|
|||
'isFirst' => $Day->isFirst(),
|
||||
'isLast' => $Day->isLast(),
|
||||
'isSelected' => $Day->isSelected(),
|
||||
'isScheduled' => $this->getDayUsagePercentage($corrYear, $corrMonth, $this->Base->_twoDigits($Day->thisDay()))
|
||||
'isCurrent' => $Day->thisDay()==$this->curr['day'] ? TRUE : FALSE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +75,7 @@ class uiCalendar
|
|||
require_once 'Calendar/Week.php';
|
||||
|
||||
$Week = new Calendar_Week ($this->curr['year'], $this->curr['month'], $this->curr['day'], $this->firstDayOfWeek);
|
||||
$Week->build();
|
||||
$Week->build($this->_scheduledDays('week'));
|
||||
while ($Day = $Week->fetch()) {
|
||||
$this->Week[] = array(
|
||||
'day' => $this->Base->_twoDigits($Day->thisDay()),
|
||||
|
@ -88,9 +83,10 @@ class uiCalendar
|
|||
'month' => $this->Base->_twoDigits($Day->thisMonth()),
|
||||
'year' => $Day->thisYear(),
|
||||
'label' => $this->_getDayName($Day),
|
||||
'isSelected' => $Day->isSelected(),
|
||||
'isCurrent' => $Day->thisDay()==$this->curr['day'] ? TRUE : FALSE
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ class uiPlaylist
|
|||
$this->activate($tmpid, FALSE);
|
||||
$this->Base->_retMsg('Playlist "$1" saved', $this->Base->_getMDataValue($tmpid, UI_MDATA_KEY_TITLE));
|
||||
|
||||
return TRUE;
|
||||
return $this->activeId;
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,14 +120,23 @@ class uiPlaylist
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
function addItem($id)
|
||||
function addItem($elemIds)
|
||||
{
|
||||
$r = $this->Base->gb->addAudioClipToPlaylist($this->token, $id, $this->Base->sessid);
|
||||
if (PEAR::isError($r)) {
|
||||
print_r($r);
|
||||
$this->Base->_retMsg('Cannot add Item to Playlist');
|
||||
if (!$elemIds) {
|
||||
$this->Base->_retMsg('No Item(s) given');
|
||||
return FALSE;
|
||||
}
|
||||
if (!is_array($elemIds))
|
||||
$elemIds = array($elemIds);
|
||||
|
||||
foreach ($elemIds as $elemId) {
|
||||
$r = $this->Base->gb->addAudioClipToPlaylist($this->token, $elemId, $this->Base->sessid);
|
||||
if (PEAR::isError($r)) {
|
||||
print_r($r);
|
||||
$this->Base->_retMsg('Cannot add Item to Playlist');
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -239,8 +248,17 @@ class uiPlaylist
|
|||
break;
|
||||
}
|
||||
#print_r($item);
|
||||
foreach ($item as $i=>$val)
|
||||
$this->Base->gb->changeFadeInfo($this->token, $i, $val['fadeIn'], $val['fadeOut'], $this->Base->sessid);
|
||||
foreach ($item as $i=>$val) {
|
||||
if ($this->Base->gb->changeFadeInfo($this->token, $i, $val['fadeIn'], $val['fadeOut'], $this->Base->sessid) === FALSE)
|
||||
$this->Base->_retMsg('Feiled: changeFadeInfo');
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function moveItem($id, $pos)
|
||||
{
|
||||
$this->Base->gb->moveAudioClipInPlaylist($this->token, $id, $pos, $this->Base->sessid);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ class uiScheduler extends uiCalendar
|
|||
$this->curr['year'] = date("Y");
|
||||
$this->curr['month'] = date("m");
|
||||
$this->curr['day'] = date('d');
|
||||
$this->curr['hour'] = date('H');
|
||||
}
|
||||
|
||||
$this->Base =& $uiBase;
|
||||
|
@ -29,32 +30,34 @@ class uiScheduler extends uiCalendar
|
|||
extract($arr);
|
||||
if ($view) $this->curr['view'] = $view;
|
||||
if ($year) $this->curr['year'] = $year;
|
||||
if (is_numeric($month)) $this->curr['month'] = $month;
|
||||
if ($month=='++') {
|
||||
if ($this->curr['month']==12) {
|
||||
$this->curr['month'] = '01';
|
||||
$this->curr['year']++;
|
||||
} else {
|
||||
$this->curr['month'] = $this->Base->_twoDigits(++$this->curr['month']);
|
||||
}
|
||||
}
|
||||
if ($month=='--') {
|
||||
if ($this->curr['month']=='01') {
|
||||
$this->curr['month'] = 12;
|
||||
$this->curr['year']--;
|
||||
} else {
|
||||
$this->curr['month'] = $this->Base->_twoDigits(--$this->curr['month']);
|
||||
}
|
||||
}
|
||||
if ($day) $this->curr['day'] = $day;
|
||||
if ($hour) $this->curr['hour'] = $hour;
|
||||
if ($day) $this->curr['day'] = $this->Base->_twoDigits($day);
|
||||
if ($hour) $this->curr['hour'] = $this->Base->_twoDigits($hour);
|
||||
if (is_numeric($month))
|
||||
$this->curr['month'] = $this->Base->_twoDigits($month);
|
||||
|
||||
$stampNow = $this->_datetime2timestamp($this->curr['year'].$this->curr['month'].$this->curr['day']);
|
||||
$stampTarget = $stampNow;
|
||||
|
||||
if ($month=='++')
|
||||
$stampTarget = strtotime("+1 month", $stampNow);
|
||||
if ($month=='--')
|
||||
$stampTarget = strtotime("-1 month", $stampNow);
|
||||
|
||||
if ($week=='++')
|
||||
$stampTarget = strtotime("+1 week", $stampNow);
|
||||
if ($week=='--')
|
||||
$stampTarget = strtotime("-1 week", $stampNow);
|
||||
|
||||
$this->curr['year'] = strftime("%Y", $stampTarget);
|
||||
$this->curr['month'] = strftime("%m", $stampTarget);
|
||||
$this->curr['day'] = strftime("%d", $stampTarget);
|
||||
}
|
||||
|
||||
|
||||
function _datetime2timestamp($i)
|
||||
{
|
||||
$formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T');
|
||||
#echo $formatted;
|
||||
#echo "iiiii: $i ffff:".$formatted;
|
||||
return strtotime($formatted);
|
||||
}
|
||||
|
||||
|
@ -87,11 +90,75 @@ class uiScheduler extends uiCalendar
|
|||
return $this->_duration[$year.$month.$day];
|
||||
}
|
||||
|
||||
function getPeriodicUsage($start, $end)
|
||||
{
|
||||
|
||||
function _scheduledDays($period)
|
||||
{
|
||||
if ($period=='month') {
|
||||
require_once 'Calendar/Month/Weekdays.php';
|
||||
$Period = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], $this->firstDayOfWeek);
|
||||
$Period->build();
|
||||
}
|
||||
if ($period=='week') {
|
||||
require_once 'Calendar/Week.php';
|
||||
$Period = new Calendar_Week ($this->curr['year'], $this->curr['month'], $this->curr['day'], $this->firstDayOfWeek);
|
||||
$Period->build();
|
||||
}
|
||||
$d = $Period->fetch();
|
||||
$corrMonth = $d->thisMonth()<=12 ? $this->Base->_twoDigits($d->thisMonth()) : '01'; ## due to bug in
|
||||
$corrYear = $d->thisMonth()<=12 ? $d->thisYear() : $d->thisYear()+1; ## Calendar_Month_Weekdays
|
||||
$first = array('day' => $this->Base->_twoDigits($d->thisDay()),
|
||||
'month' => $corrMonth,
|
||||
'year' => $corrYear
|
||||
);
|
||||
|
||||
while ($l = $Period->fetch()) {
|
||||
$d = $l;
|
||||
}
|
||||
$corrMonth = $d->thisMonth()<=12 ? $this->Base->_twoDigits($d->thisMonth()) : '01'; ## due to bug in
|
||||
$corrYear = $d->thisMonth()<=12 ? $d->thisYear() : $d->thisYear()+1; ## Calendar_Month_Weekdays
|
||||
$last = array('day' => $this->Base->_twoDigits($d->thisDay()),
|
||||
'month' => $corrMonth,
|
||||
'year' => $corrYear
|
||||
);
|
||||
|
||||
|
||||
#echo "F:".$first['year'].$first['month'].$first['day']." L:".$last['year'].$last['month'].$last['day'];
|
||||
$days = $this->_reciveScheduledDays($first['year'].$first['month'].$first['day'], $last['year'].$last['month'].$last['day']);
|
||||
foreach ($days as $val) {
|
||||
$selections[] = new Calendar_Day($val['year'], $val['month'], $val['day']);
|
||||
}
|
||||
return $selections;
|
||||
}
|
||||
|
||||
|
||||
function _reciveScheduledDays($dfrom, $dto)
|
||||
{
|
||||
$dfrom = $dfrom.'T00:00:00';
|
||||
$dto = $dto.'T23:59:59';
|
||||
$pArr = $this->displayScheduleMethod($dfrom, $dto);
|
||||
#print_r($pArr);
|
||||
foreach ($pArr as $val) {
|
||||
#print_r($val);
|
||||
$pStampArr[] = array('start' => $this->_datetime2timestamp($val['start']),
|
||||
'end' => $this->_datetime2timestamp($val['end']));
|
||||
}
|
||||
if (is_array($pStampArr)) {
|
||||
#print_r($pStampArr);
|
||||
for ($n=$this->_datetime2timestamp($dfrom); $n<=$this->_datetime2timestamp($dto); $n+=86400) {
|
||||
foreach ($pStampArr as $val) {
|
||||
if ($val['start'] < $n+86400 && $val['end'] >= $n) {
|
||||
$days[date('Ymd', $n)] = array('year' => date('Y', $n),
|
||||
'month' => date('m', $n),
|
||||
'day' => date('d', $n));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $days;
|
||||
}
|
||||
return array(FALSE);
|
||||
}
|
||||
|
||||
|
||||
function copyPlFromSP()
|
||||
{
|
||||
foreach ($this->Base->SCRATCHPAD->get() as $val) {
|
||||
|
@ -112,18 +179,19 @@ class uiScheduler extends uiCalendar
|
|||
{
|
||||
$gunid = $formdata['gunid'];
|
||||
$datetime = $this->curr['year'].$this->curr['month'].$this->curr['day'].'T'.$formdata['time'];
|
||||
#echo $datetime;
|
||||
#echo "Schedule Gunid: $gunid At: ".$datetime;
|
||||
$r = $this->spc->UploadPlaylistMethod($this->Base->sessid, $gunid, $datetime.UI_TIMEZONE);
|
||||
#print_r($r);
|
||||
if (is_array($r['error']))
|
||||
$this->Base->_retMsg('Eroor: $1', $r['error']['message']);
|
||||
$this->Base->_retMsg('Error: $1', $r['error']['message']);
|
||||
if (isset($r['scheduleEntryId']))
|
||||
$this->Base->_retMsg('ScheduleId: $1', $r['scheduleEntryId']);
|
||||
}
|
||||
|
||||
|
||||
function displayScheduleMethod($from, $to)
|
||||
{ #echo $from.$to;
|
||||
{
|
||||
#echo $from.$to;
|
||||
$r = $this->spc->displayScheduleMethod($this->Base->sessid, $from, $to);
|
||||
return $r;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ class uiScratchPad
|
|||
{
|
||||
if (!is_array($this->items))
|
||||
$this->_load();
|
||||
#print_r($this->items);
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue