*** empty log message ***

This commit is contained in:
sebastian 2005-03-10 00:19:53 +00:00
parent b818d6b0d6
commit ef8067a20f
18 changed files with 219 additions and 112 deletions

View file

@ -564,14 +564,14 @@ $ui_fmask = array(
'element' => 'switchdown', 'element' => 'switchdown',
'type' => 'button', 'type' => 'button',
'label' => '-', 'label' => '-',
'attributes'=> array('onClick' => 'switchDown()'), 'attributes'=> array('onClick' => 'pl_switchDown()', 'onMousedown' => 'pl_start("Down")', 'onMouseUp' => "pl_stop()", 'onMouseOut' => "pl_stop()"),
'groupit' => TRUE 'groupit' => TRUE
), ),
array( array(
'element' => 'switchup', 'element' => 'switchup',
'type' => 'button', 'type' => 'button',
'label' => '+', 'label' => '+',
'attributes'=> array('onClick' => 'switchUp()'), 'attributes'=> array('onClick' => 'pl_switchUp()', 'onMousedown' => 'pl_start("Up")', 'onMouseUp' => "pl_stop()", 'onMouseOut' => "pl_stop()"),
'groupit' => TRUE 'groupit' => TRUE
), ),
array( array(

View file

@ -43,7 +43,7 @@ if (is_array($_REQUEST['popup'])){
case "PL.changeTransition"; case "PL.changeTransition";
$Smarty->assign('dynform', $uiBrowser->PLAYLIST->changeTransitionForm($_REQUEST['id'], $_REQUEST['type'], $ui_fmask['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; break;
} }
} }

View file

@ -173,18 +173,15 @@ switch($_REQUEST['act']){
break; break;
case "PL.activate": 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->SCRATCHPAD->addItem($_REQUEST['id']);
} $uiHandler->PLAYLIST->setReload();
break; break;
case "PL.create": 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->SCRATCHPAD->addItem($ui_tmpid);
} $uiHandler->PLAYLIST->setReload();
break; break;
case "PL.addItem": case "PL.addItem":
@ -203,7 +200,8 @@ switch($_REQUEST['act']){
break; break;
case "PL.save": case "PL.save":
$uiHandler->PLAYLIST->save(); if (($ui_tmpid = $uiHandler->PLAYLIST->save()) !== FALSE)
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
break; break;
@ -217,6 +215,11 @@ switch($_REQUEST['act']){
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
break; break;
case "PL.moveItem":
$uiHandler->PLAYLIST->moveItem($_REQUEST['id'], $_REQUEST['pos']);
$uiHandler->PLAYLIST->setReload();
break;
case "SCHEDULER.set": case "SCHEDULER.set":
$uiHandler->SCHEDULER->set($_REQUEST); $uiHandler->SCHEDULER->set($_REQUEST);
$uiHandler->SCHEDULER->setReload(); $uiHandler->SCHEDULER->setReload();

View file

@ -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> <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'} {PL->getFlat assign='FLAT'}
{foreach from=$FLAT item='i'} {foreach from=$FLAT key='pos' item='i'}
<!-- {$n++} --> <!-- {$n++} -->
<tr onMouseOver="highlight()" <tr onMouseOver="highlight()"
onMouseOut="darklight()" onMouseOut="darklight()"
@ -12,7 +12,13 @@
<tr onMouseOver="highlight()" <tr onMouseOver="highlight()"
onMouseOut="darklight()" onMouseOut="darklight()"
onContextmenu="return menu('{$i.attrs.id}', 'PL.removeItem')" style="background-color: {cycle values='#eeeeee, #dadada'}"> 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}')">&uarr;</a>
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=PL.moveItem&id={$i.attrs.id}&pos={$pos+1}')">&darr;</a>
</font>
</td>
<td>{$i.title}</td> <td>{$i.title}</td>
<td>{$i.duration}</td> <td>{$i.duration}</td>
<td>{$i.type}</td> <td>{$i.type}</td>
@ -28,7 +34,7 @@
<tr style="background-color: {cycle values='#eeeeee, #dadada'}"> <tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<td><input type="checkbox" name="all" onClick="form_switchAll('PL')"></th> <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> <td align="center" colspan="2"><a href="#" onClick="form_clearAll('PL')">[Clear]</a></th>
</tr> </tr>

View file

@ -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>

View file

@ -47,12 +47,12 @@
{if $_Day.isEmpty} {if $_Day.isEmpty}
<div> <div>
{elseif $_Day.isSelected} {elseif $_Day.isCurrent}
<div style="background-color: lightblue"> <div style="background-color: lightblue">
{else} {else}
<div style="background-color: white"> <div style="background-color: white">
{/if} {/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> <b><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')">{$_Day.day}</a></b>
{else} {else}
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')">{$_Day.day}</a> <a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&day={$_Day.day}&month={$_Day.month}&year={$_Day.year}')">{$_Day.day}</a>

View file

@ -3,8 +3,13 @@
<table border=1> <table border=1>
{foreach from=$SCHEDULER->Day item="_Hour"} {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} {/foreach}

View file

@ -10,7 +10,11 @@
</tr> </tr>
{foreach from=$SCHEDULER->Month item="_Day"} {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} {if $_Day.isFirst}
<tr> <tr>

View file

@ -7,11 +7,11 @@
{/foreach} {/foreach}
</select> </select>
<input type="hidden" name="sc_last"> <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="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)"> <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="#" onClick="sc_change('-')" 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>
<br> <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)"> <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) function sc_start(direction)
{ {
sc_loop = setInterval("sc_change('" + direction + "')", 80); sc_loop = setInterval("sc_change('" + direction + "')", 150);
} }
function sc_stop() function sc_stop()

View file

@ -3,39 +3,31 @@
<table border=1> <table border=1>
<tr> <tr>
<td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=--')"><<</a> </td>
{foreach from=$SCHEDULER->Week item="_Weekday"} {foreach from=$SCHEDULER->Week item="_Weekday"}
<td>{$_Weekday.label.full}</td> <td>{$_Weekday.label.full}</td>
{/foreach} {/foreach}
<td rowspan="2"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&week=%2B%2B')">>></a></td>
</tr> </tr>
<tr>
{foreach from=$SCHEDULER->Week item="_Day"} {foreach from=$SCHEDULER->Week item="_Day"}
{if $_Day.isFirst} <td valign="top">
<tr> <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} {if $_Day.isSelected}
{if $_Day.isEmpty}
<td>&nbsp;</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>
{assign var="_oneday" value=$SCHEDULER->getDayUsage($_Day.year, $_Day.month, $_Day.day)} {assign var="_oneday" value=$SCHEDULER->getDayUsage($_Day.year, $_Day.month, $_Day.day)}
{if is_array($_oneday)} <table border="1" style="font-family : monospace">
<table border="1" style="font-family : monospace"> {foreach from=$_oneday item="i"}
{foreach from=$_oneday item="i"} <tr><td>
<tr><td> Start:{$i.start|regex_replace:"/[0-9]+T/":""}
Start:{$i.start|regex_replace:"/[0-9]+T/":""} <br>
<br> End:&nbsp;&nbsp;{$i.end|regex_replace:"/[0-9]+T/":""}
End:&nbsp;&nbsp;{$i.end|regex_replace:"/[0-9]+T/":""} </td></tr>
</td></tr> {/foreach}
{/foreach} </table>
</table> {/if}
{/if} </td>
</td>
{/if}
{if $_Day.isLast}
</tr>
{/if}
{/foreach} {/foreach}
</tr>
</table> </table>

View file

@ -31,8 +31,14 @@
{/foreach} {/foreach}
<tr style="background-color: {cycle values='#eeeeee, #dadada'}"> <tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<td><input type="checkbox" name="all" onClick="form_switchAll('SP')"></th> <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">
<td align="center" colspan="2"><a href="#" onClick="form_clearAll('SP')">[Clear]</a></th> <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> </tr>
</table> </table>
</form> </form>

View file

@ -1,6 +1,6 @@
<script type="text/javascript"> <script type="text/javascript">
{literal} {literal}
function switchUp() function pl_switchUp()
{ {
if (Number(document.forms['PL_changeTransition'].elements['duration'].value) < 5000) { 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; 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) { 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; 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; 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} {/literal}
</script> </script>

View file

@ -2,13 +2,13 @@
{literal} {literal}
<script type="text/javascript"> <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; var n;
for (n=0; n < (document.forms[formname].elements.length-1); n++) { for (n=0; n < (document.forms[formname].elements.length); n++) {
if (document.forms[formname].elements[n].checked) { if (document.forms[formname].elements[n].checked && document.forms[formname].elements[n].name!='all') {
href = href + '&id[]=' + document.forms[formname].elements[n].name; href = href + '&id[]=' + document.forms[formname].elements[n].name;
} }
} }
@ -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}")) { if (confirm("{/literal}{tra 0='Are you sure to remove all Items?'}{literal}")) {
document.forms[formname].elements['all'].checked = true; document.forms[formname].elements['all'].checked = true;
form_switchAll(formname); form_switchAll(formname);
form_submit(formname); form_submit(formname, action);
} }
} }
</script> </script>

View file

@ -79,6 +79,10 @@ function menu(id) {
case "fileList": case "fileList":
menuHtml = menuHtml + "<tr><td><a class='menu' href='{/literal}{$UI_BROWSER}{literal}?act=fileList&id="+id+"'"+oF+">&nbsp;List Folder&nbsp;</a></td></tr>"; menuHtml = menuHtml + "<tr><td><a class='menu' href='{/literal}{$UI_BROWSER}{literal}?act=fileList&id="+id+"'"+oF+">&nbsp;List Folder&nbsp;</a></td></tr>";
break; 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+">&nbsp;Schedule Playlist&nbsp;</a></td></tr>";
break;
} }
} }
document.getElementById('menucontainer').innerHTML = menuHeader + menuHtml + menuFooter; document.getElementById('menucontainer').innerHTML = menuHeader + menuHtml + menuFooter;

View file

@ -44,16 +44,11 @@ class uiCalendar
{ {
if (is_array($this->Month)) return FALSE; if (is_array($this->Month)) return FALSE;
require_once 'Calendar/Calendar.php';
require_once 'Calendar/Month/Weekdays.php'; require_once 'Calendar/Month/Weekdays.php';
require_once 'Calendar/Day.php'; require_once 'Calendar/Day.php';
$Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], $this->firstDayOfWeek); $Month = new Calendar_Month_Weekdays($this->curr['year'], $this->curr['month'], $this->firstDayOfWeek);
# mark today # $Month->build($this->_scheduledDays('month')); ## scheduled days are selected
$sel = new Calendar_Day($this->curr['year'], $this->curr['month'], $this->curr['day']);
$selections = array($sel);
$Month->build($selections);
while ($Day = $Month->fetch()) { while ($Day = $Month->fetch()) {
$corrMonth = $Day->thisMonth()<=12 ? $this->Base->_twoDigits($Day->thisMonth()) : '01'; ## due to bug in $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 $corrYear = $Day->thisMonth()<=12 ? $Day->thisYear() : $Day->thisYear()+1; ## Calendar_Month_Weekdays
@ -67,7 +62,7 @@ class uiCalendar
'isFirst' => $Day->isFirst(), 'isFirst' => $Day->isFirst(),
'isLast' => $Day->isLast(), 'isLast' => $Day->isLast(),
'isSelected' => $Day->isSelected(), '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'; require_once 'Calendar/Week.php';
$Week = new Calendar_Week ($this->curr['year'], $this->curr['month'], $this->curr['day'], $this->firstDayOfWeek); $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()) { while ($Day = $Week->fetch()) {
$this->Week[] = array( $this->Week[] = array(
'day' => $this->Base->_twoDigits($Day->thisDay()), 'day' => $this->Base->_twoDigits($Day->thisDay()),
@ -88,9 +83,10 @@ class uiCalendar
'month' => $this->Base->_twoDigits($Day->thisMonth()), 'month' => $this->Base->_twoDigits($Day->thisMonth()),
'year' => $Day->thisYear(), 'year' => $Day->thisYear(),
'label' => $this->_getDayName($Day), 'label' => $this->_getDayName($Day),
'isSelected' => $Day->isSelected(),
'isCurrent' => $Day->thisDay()==$this->curr['day'] ? TRUE : FALSE
); );
} }
} }

View file

@ -82,7 +82,7 @@ class uiPlaylist
$this->activate($tmpid, FALSE); $this->activate($tmpid, FALSE);
$this->Base->_retMsg('Playlist "$1" saved', $this->Base->_getMDataValue($tmpid, UI_MDATA_KEY_TITLE)); $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; return FALSE;
} }
function addItem($id) function addItem($elemIds)
{ {
$r = $this->Base->gb->addAudioClipToPlaylist($this->token, $id, $this->Base->sessid); if (!$elemIds) {
if (PEAR::isError($r)) { $this->Base->_retMsg('No Item(s) given');
print_r($r);
$this->Base->_retMsg('Cannot add Item to Playlist');
return FALSE; 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; return TRUE;
} }
@ -239,8 +248,17 @@ class uiPlaylist
break; break;
} }
#print_r($item); #print_r($item);
foreach ($item as $i=>$val) foreach ($item as $i=>$val) {
$this->Base->gb->changeFadeInfo($this->token, $i, $val['fadeIn'], $val['fadeOut'], $this->Base->sessid); 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);
} }

View file

@ -9,6 +9,7 @@ class uiScheduler extends uiCalendar
$this->curr['year'] = date("Y"); $this->curr['year'] = date("Y");
$this->curr['month'] = date("m"); $this->curr['month'] = date("m");
$this->curr['day'] = date('d'); $this->curr['day'] = date('d');
$this->curr['hour'] = date('H');
} }
$this->Base =& $uiBase; $this->Base =& $uiBase;
@ -29,32 +30,34 @@ class uiScheduler extends uiCalendar
extract($arr); extract($arr);
if ($view) $this->curr['view'] = $view; if ($view) $this->curr['view'] = $view;
if ($year) $this->curr['year'] = $year; if ($year) $this->curr['year'] = $year;
if (is_numeric($month)) $this->curr['month'] = $month; if ($day) $this->curr['day'] = $this->Base->_twoDigits($day);
if ($month=='++') { if ($hour) $this->curr['hour'] = $this->Base->_twoDigits($hour);
if ($this->curr['month']==12) { if (is_numeric($month))
$this->curr['month'] = '01'; $this->curr['month'] = $this->Base->_twoDigits($month);
$this->curr['year']++;
} else { $stampNow = $this->_datetime2timestamp($this->curr['year'].$this->curr['month'].$this->curr['day']);
$this->curr['month'] = $this->Base->_twoDigits(++$this->curr['month']); $stampTarget = $stampNow;
}
} if ($month=='++')
if ($month=='--') { $stampTarget = strtotime("+1 month", $stampNow);
if ($this->curr['month']=='01') { if ($month=='--')
$this->curr['month'] = 12; $stampTarget = strtotime("-1 month", $stampNow);
$this->curr['year']--;
} else { if ($week=='++')
$this->curr['month'] = $this->Base->_twoDigits(--$this->curr['month']); $stampTarget = strtotime("+1 week", $stampNow);
} if ($week=='--')
} $stampTarget = strtotime("-1 week", $stampNow);
if ($day) $this->curr['day'] = $day;
if ($hour) $this->curr['hour'] = $hour; $this->curr['year'] = strftime("%Y", $stampTarget);
$this->curr['month'] = strftime("%m", $stampTarget);
$this->curr['day'] = strftime("%d", $stampTarget);
} }
function _datetime2timestamp($i) function _datetime2timestamp($i)
{ {
$formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T'); $formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T');
#echo $formatted; #echo "iiiii: $i ffff:".$formatted;
return strtotime($formatted); return strtotime($formatted);
} }
@ -87,11 +90,75 @@ class uiScheduler extends uiCalendar
return $this->_duration[$year.$month.$day]; 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() function copyPlFromSP()
{ {
foreach ($this->Base->SCRATCHPAD->get() as $val) { foreach ($this->Base->SCRATCHPAD->get() as $val) {
@ -112,18 +179,19 @@ class uiScheduler extends uiCalendar
{ {
$gunid = $formdata['gunid']; $gunid = $formdata['gunid'];
$datetime = $this->curr['year'].$this->curr['month'].$this->curr['day'].'T'.$formdata['time']; $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); $r = $this->spc->UploadPlaylistMethod($this->Base->sessid, $gunid, $datetime.UI_TIMEZONE);
#print_r($r); #print_r($r);
if (is_array($r['error'])) 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'])) if (isset($r['scheduleEntryId']))
$this->Base->_retMsg('ScheduleId: $1', $r['scheduleEntryId']); $this->Base->_retMsg('ScheduleId: $1', $r['scheduleEntryId']);
} }
function displayScheduleMethod($from, $to) function displayScheduleMethod($from, $to)
{ #echo $from.$to; {
#echo $from.$to;
$r = $this->spc->displayScheduleMethod($this->Base->sessid, $from, $to); $r = $this->spc->displayScheduleMethod($this->Base->sessid, $from, $to);
return $r; return $r;
} }

View file

@ -18,6 +18,7 @@ class uiScratchPad
{ {
if (!is_array($this->items)) if (!is_array($this->items))
$this->_load(); $this->_load();
#print_r($this->items);
return $this->items; return $this->items;
} }