*** empty log message ***

This commit is contained in:
sebastian 2005-03-19 22:03:29 +00:00
parent 63ee21174a
commit daef9b152e
22 changed files with 99 additions and 64 deletions

View file

@ -14,17 +14,20 @@
* Author: Media Development Loan Fund
* -------------------------------------------------------------
*/
function smarty_postfiler_localizer_tra($matches)
## format: ##phrase to translate##
function smarty_tra($matches)
{
foreach ($matches as $match) {
$key = substr($match, 2, strpos(substr($match, 2), '#'));
return tra(preg_replace('/%%/', '', $match));
#$key = substr($match, 2, strpos(substr($match, 2), '#'));
return tra(preg_replace('/##/', '', $match));
}
}
function smarty_postfilter_localizer($compiled, &$smarty)
function smarty_outputfilter_localizer($compiled, &$smarty)
{
$pattern = '/%%.*%%/U';
return preg_replace_callback($pattern, 'smarty_postfiler_localizer_tra', $compiled);
$pattern = '/##.*##/U';
return preg_replace_callback($pattern, 'smarty_tra', $compiled);
}
?>

View file

@ -392,7 +392,6 @@ $ui_fmask = array(
'type' => 'select',
'label' => 'Rows per Page',
'options' => array(
5 => 5,
10 => 10,
25 => 25,
50 => 50,
@ -510,7 +509,6 @@ $ui_fmask = array(
'type' => 'select',
'label' => 'Rows per Page',
'options' => array(
5 => 5,
10 => 10,
25 => 25,
50 => 50,
@ -649,7 +647,7 @@ $ui_fmask = array(
array(
'element' => 'act',
'type' => 'hidden',
'constant' => 'SCHEDULER.uploadPlaylistMethod'
'constant' => 'SCHEDULER.addItem'
),
'date' => array(
'element' => 'date',

View file

@ -46,8 +46,17 @@ if (is_array($_REQUEST['popup'])){
$Smarty->display('playlist/changeTransition.tpl');
break;
case "SCHEDULER.schedule":
$Smarty->display('scheduler/schedule.tpl');
case "SCHEDULER.addItem":
$Smarty->display('scheduler/addItem.tpl');
break;
case "SCHEDULER.removeItem":
$Smarty->assign('gunid', $_REQUEST['gunid']);
$Smarty->display('scheduler/removeItem.tpl');
break;
case "PL.deleteActive":
$Smarty->display('playlist/deleteActive.tpl');
break;
}
}

View file

@ -235,17 +235,23 @@ switch($_REQUEST['act']){
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
break;
case "PL.deleteActive":
if (($ui_tmpid = $uiHandler->PLAYLIST->deleteActive()) !== FALSE)
$uiHandler->SCRATCHPAD->removeItems($ui_tmpid);
$uiHandler->PLAYLIST->setReload();
break;
case "SCHEDULER.set":
$uiHandler->SCHEDULER->set($_REQUEST);
$uiHandler->SCHEDULER->setReload();
break;
case "SCHEDULER.uploadPlaylistMethod":
case "SCHEDULER.addItem":
$uiHandler->SCHEDULER->uploadPlaylistMethod($_REQUEST);
$uiHandler->SCHEDULER->setReload();
break;
case "SCHEDULER.removeFromScheduleMethod":
case "SCHEDULER.removeItem":
$uiHandler->SCHEDULER->removeFromScheduleMethod($_REQUEST);
$uiHandler->SCHEDULER->setReload();
break;

View file

@ -1,13 +1,5 @@
{include file="library/search.js.tpl"}
{include file="library/searchForm.js.tpl"}
{literal}
<style type="text/css">
.dynformelement {
width : 800px;
}
</style>
{/literal}
<div id="searchform">
{include file="sub/x.tpl"}
<center>

View file

@ -1,5 +1,3 @@
{*Smarty template*}
<div id="masterpanel">
{include file="statusbar.tpl"}

View file

@ -7,7 +7,7 @@
<a href="{$UI_BROWSER}?id={$START.id}&act=SEARCH">[Search]</a>
<a href="{$UI_BROWSER}?id={$START.id}&act=BROWSE">[Browse]</a>
<a href="{$UI_BROWSER}?act=SCHEDULER">[Scheduler]</a>
<a href="{$UI_BROWSER}?id={$START.id}&act=subjects">{tra 0='[User/Groups]'}</a>
<a href="{$UI_BROWSER}?id={$START.id}&act=subjects">[User/Groups]</a>
<!-- <a href="{$UI_BROWSER}?act=MetaDataValues&Main=1">[Metadata]</a> -->
<a href="{$UI_BROWSER}?act=changeStationPrefs">[StationPrefs]</a>
</div>

View file

@ -0,0 +1,11 @@
{include file="header.tpl"}
<center>
<b>Are you sure to delete active Playlist?</b>
<br>
<input type="button" onClick="window.close()" value="Cancel">
<input type="button" onClick="location.href='{$UI_HANDLER}?act=PL.deleteActive'" value="OK">
</center>
</body>
</html>

View file

@ -34,7 +34,7 @@
{/if}
<tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<td><input type="checkbox" name="all" onClick="collector_switchAll('PL')"></th>
<td><input type="checkbox" name="all" onClick="collector_switchAll('PL')"></td>
<td align="center" colspan="2"><a href="#" onClick="collector_submit('PL', 'PL.removeItem')">[Remove Selected]</a></th>
<td align="center" colspan="2"><a href="#" onClick="collector_clearAll('PL', 'PL.removeItem')">[Clear]</a></th>
</tr>
@ -44,6 +44,7 @@
<td><input type="button" value="Revert" onClick="hpopup('{$UI_HANDLER}?act=PL.revert')"></td>
<td><input type="button" value="Release" onClick="hpopup('{$UI_HANDLER}?act=PL.release')"></td>
<td><input type="button" value="MData" onClick="location.href='{$UI_BROWSER}?act=PL.editMetaData'"></td>
<td><input type="button" value="Delete" onClick="popup('{$UI_BROWSER}?popup[]=PL.deleteActive', 'PL.deleteActive', 400, 200)"></td>
</tr>
</table>
</form>

View file

@ -1,7 +0,0 @@
onMouseOver="highlight()"
onMouseOut="darklight()"
onContextmenu="return menu('year={$_year}&month={$_month}&day={$_day}&hour={$_hour}', {$moreContextBefore} 'SCHEDULER.schedule' {$moreContextAfter})"
{assign var="moreContextBefore" value=""}
{assign var="moreContextAfter" value=""}

View file

@ -16,7 +16,7 @@
{assign var="_hour" value=$_Hour.hour}
<tr>
<td {include file="scheduler/contextmenu.tpl"} bgcolor="#d4d0c8" height="50" valign="top">
<td onContextmenu="return menu('year={$_year}&month={$_month}&day={$_day}&hour={$_hour}', 'SCHEDULER.addItem')" bgcolor="grey" height="50" valign="top">
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.set&hour={$_Hour.hour}')">{$_Hour.hour}</a>
</td>
@ -41,13 +41,11 @@
{foreach from=$_usage item="_entry"}
{if $_entry.pos >= $_Hour.timestamp && $_entry.pos < $_Hour.timestamp+3600}
<td rowspan="{$_entry.span}" valign="top" bgcolor="#ffcacb">
<td rowspan="{$_entry.span}" onContextmenu="return menu('gunid={$_entry.id}', 'SCHEDULER.removeItem')" valign="top" bgcolor="#ffcacb">
<b>{$_entry.title}</b>
{$_entry.start|regex_replace:"/[0-9]+T/":""|truncate:5:""}-{$_entry.end|regex_replace:"/[0-9]+T/":""|truncate:5:""}
<br>
{$_entry.creator}
<br>
<a href="#" onClick="hpopup('{$UI_HANDLER}?act=SCHEDULER.removeFromScheduleMethod&gunid={$_entry.id}');"><b>X</b></a>
</td>
{/if}
{/foreach}

View file

@ -0,0 +1,11 @@
{include file="header.tpl"}
<center>
<b>Are you sure to remove this entry?</b>
<br>
<input type="button" onClick="window.close()" value="Cancel">
<input type="button" onClick="location.href='{$UI_HANDLER}?act=SCHEDULER.removeItem&gunid={$gunid}'" value="OK">
</center>
</body>
</html>

View file

@ -35,7 +35,7 @@
<table border="1" cellspacing="0" cellpadding="0">
{foreach from=$_scale item="_hour"}
<tr height="20" style="font-family: monospace;" valign="top">
<td bgcolor="grey" {include file="scheduler/contextmenu.tpl"}>
<td bgcolor="grey" onContextmenu="return menu('year={$_year}&month={$_month}&day={$_day}&hour={$_hour}', 'SCHEDULER.addItem')">
<div style="padding: 1px">{$_hour|string_format:'%02d'}</div>
</td>
</tr>
@ -55,9 +55,9 @@
<tr height="{$SCHEDULER->_oneOrMore($i.length/$_divisor)}" style="font-family: monospace;" valign="top">
{if is_array($i.entry)}
{if $i.length/$_divisor > $_minwidth}
<td bgcolor="#ffcacb" width="70"><div style="padding: 1px"><small><b>{$_title}</b><br>{$_period}<br>{$_creator}</small></div></td>
<td bgcolor="#ffcacb" width="70" onContextmenu="return menu('gunid={$i.entry.id}', 'SCHEDULER.removeItem')"><div style="padding: 1px"><small><b>{$_title}</b><br>{$_period}<br>{$_creator}</small></div></td>
{else}
<td bgcolor="#ffcacb" width="70" onMouseover="mouseoverShow('<small><b>{$_title}</b><br>{$_period}<br>{$_creator}</small>')" onMouseout="mouseoverHide()"></td>
<td bgcolor="#ffcacb" width="70" onContextmenu="return menu('gunid={$i.entry.id}', 'SCHEDULER.removeItem')" onMouseover="mouseoverShow('<small><b>{$_title}</b><br>{$_period}<br>{$_creator}</small>')" onMouseout="mouseoverHide()"></td>
{/if}
{else}
<td bgcolor="#97bacf" width="70"></td>

View file

@ -1,16 +1,16 @@
{assign var="_PL_activeId" value=$PL->getActiveId()}
<div id="scratchpad">
<center><b>%%ScratchPad%%</b>
<center><b>ScratchPad</b>
{if is_array($SCRATCHPAD)}
<form name="SP">
<input type="hidden" name="act">
<table>
<tr style="background-color: {cycle values='#eeeeee, #dadada'}">
<th></th>
<td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reOrder&by=title', 'order');">[{tra 0=Title}]</a></td>
<td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reOrder&by=duration', 'order');">[{tra 0=Duration}]</a></td>
<td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reOrder&by=type', 'order');">[{tra 0=Type}]</a></td>
<td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reOrder&by=title', 'order');">[Title]</a></td>
<td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reOrder&by=duration', 'order');">[Duration]</a></td>
<td align="center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reOrder&by=type', 'order');">[Type]</a></td>
<td align="center">Remove</td>
</tr>

View file

@ -84,9 +84,12 @@ function menu(param) {
menuHtml = menuHtml + "<tr><td><a class='menu' href='{/literal}{$UI_BROWSER}{literal}?act=fileList&id="+param+"'"+oF+">&nbsp;List Folder&nbsp;</a></td></tr>";
break;
case "SCHEDULER.schedule":
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' {/literal}onClick=\"hpopup('{$UI_HANDLER}?act=SCHEDULER.set&"+param+"'); popup('{$UI_BROWSER}?popup[]=SCHEDULER.schedule', 'Schedule', 600, 400)\"'){literal}"+oF+">&nbsp;Schedule Playlist&nbsp;</a></td></tr>";
case "SCHEDULER.addItem":
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' {/literal}onClick=\"hpopup('{$UI_HANDLER}?act=SCHEDULER.set&"+param+"'); popup('{$UI_BROWSER}?popup[]=SCHEDULER.addItem', 'Schedule', 600, 400)\"'){literal}"+oF+">&nbsp;Insert Playlist here&nbsp;</a></td></tr>";
break;
case "SCHEDULER.removeItem":
menuHtml = menuHtml + "<tr><td><a class='menu' href='#' {/literal}onClick=\"popup('{$UI_BROWSER}?popup[]=SCHEDULER.removeItem&"+param+"', 'Schedule', 600, 400)\"'){literal}"+oF+">&nbsp;Remove Playlist&nbsp;</a></td></tr>";
break;
}
}

View file

@ -3,9 +3,9 @@
{if $USER.userid}
Login: {$USER.login}
<br>
<a href='javascript: popup("{$UI_BROWSER}?popup[]=logout", "name", "350", "100");'>[{tra 0=logout}]</a>
<a href='javascript: popup("{$UI_BROWSER}?popup[]=signover_1", "name", "350", "160");'>[{tra 0='sign over'}]</a>
<a href='javascript: popup("{$UI_BROWSER}?popup[]=logout", "name", "350", "100");'>[logout]</a>
<a href='javascript: popup("{$UI_BROWSER}?popup[]=signover_1", "name", "350", "160");'>[sign over]</a>
{else}
<a href='javascript: popup("{$UI_BROWSER}?popup[]=login", "name", "350", "160");'>{tra 0=login}</a>
<a href='javascript: popup("{$UI_BROWSER}?popup[]=login", "name", "350", "160");'>[login]</a>
{/if}

View file

@ -18,8 +18,8 @@ $uiBase =& $uiBrowser;
## load Smarty+filters ##############################################
require_once dirname(__FILE__).'/SmartyExtensions.inc.php';
#$Smarty->load_filter('output', 'trimwhitespace');
#$Smarty->load_filter('post', 'template_marker');
$Smarty->load_filter('post', 'localizer');
$Smarty->load_filter('post', 'template_marker');
$Smarty->load_filter('output', 'localizer');
## some basic things ################################################

View file

@ -401,7 +401,6 @@ class uiPlaylist
## first remove old entrys
#$this->gb->replaceMetaData($id, $this->_analyzeFile($id, 'xml'), 'string', $this->sessid);
foreach ($mask['playlist'] as $k=>$v) {
$formdata[$this->Base->_formElementEncode($v['element'])] ? $mData[$this->Base->_formElementDecode($v['element'])] = $formdata[$this->Base->_formElementEncode($v['element'])] : NULL;
}
@ -419,6 +418,17 @@ class uiPlaylist
}
function deleteActive()
{
$id = $this->activeId;
$this->release(FALSE);
if ($this->Base->delete($id))
return TRUE;
$this->Base->_retMsg('Cannot delete this Playlist');
return FALSE;
}
function _plTimeToSecs($plt, $length=4)
{
$arr = split(':', $plt);

View file

@ -207,12 +207,12 @@ class uiScheduler extends uiCalendar
function _copyPlFromSP()
{
if (!count($this->Base->SCRATCHPAD->get()))
return FALSE;
foreach ($this->Base->SCRATCHPAD->get() as $val) {
if (strtolower($val['type'])=='playlist' && $val['id']!=$this->Base->PLAYLIST->activeId)
$this->playlists[] = $val;
}
if (!count($this->playlists))
return FALSE;
return TRUE;
}
@ -318,14 +318,14 @@ class uiScheduler extends uiCalendar
function uploadPlaylistMethod(&$formdata)
{ print_r($formdata);
{
#$gunid = $formdata['gunid'];
#$datetime = $this->curr['year'].$this->curr['month'].$this->curr['day'].'T'.$formdata['time'];
$gunid = $formdata['playlist'];
$datetime = $formdata['date']['Y'].sprintf('%02d', $formdata['date']['m']).sprintf('%02d', $formdata['date']['d']).'T'.sprintf('%02d', $formdata['time']['H']).':'.sprintf('%02d', $formdata['time']['i']).':'.sprintf('%02d', $formdata['time']['s']);
echo "Schedule Gunid: $gunid At: ".$datetime;
#echo "Schedule Gunid: $gunid At: ".$datetime;
$r = $this->spc->UploadPlaylistMethod($this->Base->sessid, $gunid, $datetime.UI_TIMEZONE);
#print_r($r);
if ($this->_isError($r))
@ -359,11 +359,11 @@ class uiScheduler extends uiCalendar
function GeneratePlayReportMethod($from, $to)
{
echo $from.$to;
#echo $from.$to;
$r = $this->spc->GeneratePlayReportMethod($this->Base->sessid, $from, $to);
if ($this->_isError($r))
return FALSE;
print_r($r);
#print_r($r);
return $r;
}
}

View file

@ -73,11 +73,13 @@ class uiSearch
$this->results = NULL;
$this->criteria['conditions'] = NULL;
$this->criteria['offset'] = NULL;
$this->criteria['form'] = NULL;
$this->criteria['operator'] = $formdata['operator'];
$this->criteria['filetype'] = $formdata['filetype'];
$this->criteria['limit'] = $formdata['limit'];
$this->criteria['counter'] = 0;
$this->criteria['form']['operator'] = $formdata['operator']; ## $criteria['form'] is used for retransfer to form ##
$this->criteria['form']['filetype'] = $formdata['filetype'];
$this->criteria['form']['limit'] = $formdata['limit'];