From 9d3ff15b652d9282e955bddf0bf54390c4ca7aa3 Mon Sep 17 00:00:00 2001 From: sebastian Date: Fri, 15 Apr 2005 09:30:04 +0000 Subject: [PATCH] *** empty log message *** --- livesupport/modules/htmlUI/var/html/ui_handler.php | 2 +- .../modules/htmlUI/var/templates/file/objects.tpl | 12 ++++++------ .../htmlUI/var/templates/library/actionhandler.tpl | 12 ++++-------- .../htmlUI/var/templates/library/results.tpl | 2 +- .../var/templates/playlist/actionhandler.tpl | 7 +------ .../htmlUI/var/templates/playlist/editor.tpl | 2 +- .../htmlUI/var/templates/playlist/metadata.tpl | 7 +++++-- .../var/templates/scheduler/actionhandler.tpl | 7 +------ .../var/templates/scratchpad/actionhandler.tpl | 12 ++++-------- .../htmlUI/var/templates/scratchpad/main.tpl | 2 +- .../htmlUI/var/templates/sub/contextmenu.tpl | 8 ++++---- .../modules/htmlUI/var/templates/sub/mouseover.tpl | 4 ++++ livesupport/modules/htmlUI/var/ui_conf.php | 7 +++++++ .../modules/htmlUI/var/ui_handler.class.php | 14 ++++++++++++++ .../modules/htmlUI/var/ui_playlist.class.php | 7 +++++-- .../modules/htmlUI/var/ui_scheduler.class.php | 6 ++++-- 16 files changed, 63 insertions(+), 48 deletions(-) create mode 100755 livesupport/modules/htmlUI/var/templates/sub/mouseover.tpl diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index 92a9c21a5..5900e457b 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -29,7 +29,7 @@ switch($_REQUEST['act']){ break; case "uploadFile": - if ($ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $ui_fmask["file"])) + if (($ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $ui_fmask["file"])) !== FALSE) $uiHandler->SCRATCHPAD->addItem($ui_tmpid); break; diff --git a/livesupport/modules/htmlUI/var/templates/file/objects.tpl b/livesupport/modules/htmlUI/var/templates/file/objects.tpl index cfbfe5b9e..2b7245cdf 100755 --- a/livesupport/modules/htmlUI/var/templates/file/objects.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/objects.tpl @@ -21,7 +21,7 @@ - {if $i.type eq 'Folder'} + {if $i.type|lower eq 'folder'} [{$i.title|truncate:30}] {else} {if $_PL_activeId == $i.id} @@ -32,7 +32,7 @@ {/if} - {$i.type} + {$i.type|lower|capitalize}  ##move## @@ -46,12 +46,12 @@ [DEL] {/if} --> - {if $i.type != 'Folder'} + {if $i.type|lower != 'folder'}  ##MDataXML## - {if $i.type eq 'webstream'} + {if $i.type|lower eq 'webstream'}  ##Edit## - {elseif $i.type eq 'audioclip'} + {elseif $i.type|lower eq 'audioclip'}  ##Edit##  ##Access##  ##RawAnalyze## @@ -66,4 +66,4 @@ ##No objects## {/if} - \ No newline at end of file + diff --git a/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl b/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl index a9b072af7..afa55d1bc 100755 --- a/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl +++ b/livesupport/modules/htmlUI/var/templates/library/actionhandler.tpl @@ -1,11 +1,8 @@ -{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"} - -onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}
{/foreach}')" -onMouseout="hidealttext()" +{include file="sub/mouseover.tpl"} onClick="return contextmenu('{$i.id}' , 'SP.addItem' - {if $i.type == 'audioclip'} + {if $i.type|lower == 'audioclip'} , 'listen', '{$i.gunid}' {if $_PL_activeId} , 'PL.addItem' @@ -15,7 +12,7 @@ onClick="return contextmenu('{$i.id}' , 'edit', 'delete' {/if} - {if $i.type == 'webstream'} + {if $i.type|lower == 'webstream'} {if $_PL_activeId} , 'PL.addItem' {else} @@ -24,7 +21,7 @@ onClick="return contextmenu('{$i.id}' , 'edit', 'delete' {/if} - {if $i.type == 'playlist'} + {if $i.type|lower == 'playlist'} {if $_PL_activeId} {if $_PL_activeId == $i.id} , 'PL.release' @@ -37,4 +34,3 @@ onClick="return contextmenu('{$i.id}' {/if} )" -{assign var="_metaarr" value=NULL} diff --git a/livesupport/modules/htmlUI/var/templates/library/results.tpl b/livesupport/modules/htmlUI/var/templates/library/results.tpl index 01030f8dc..2bfc01251 100755 --- a/livesupport/modules/htmlUI/var/templates/library/results.tpl +++ b/livesupport/modules/htmlUI/var/templates/library/results.tpl @@ -26,7 +26,7 @@ {$i.creator} {$i.duration} - {$i.type} + {$i.type|lower|capitalize} {/foreach} diff --git a/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl b/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl index 7e603ba21..cf7694ef5 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/actionhandler.tpl @@ -1,7 +1,2 @@ -{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"} - -onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}
{/foreach}')" -onMouseout="hidealttext()" +{include file="sub/mouseover.tpl"} onClick="return contextmenu('{$i.attrs.id}', {if $i.type|lower == "audioclip"}'listen', '{$i.gunid}', {/if} 'PL.removeItem')" - -{assign var="_metaarr" value=NULL} diff --git a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl index ad100f682..fe7a370bc 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/editor.tpl @@ -36,7 +36,7 @@ {$i.title} {$i.duration} {$i.creator} - {$i.type} + {$i.type|lower|capitalize} ##move up## ##move down## diff --git a/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl b/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl index bb9902d00..3cdda06c6 100755 --- a/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl +++ b/livesupport/modules/htmlUI/var/templates/playlist/metadata.tpl @@ -8,15 +8,17 @@ {assign var="dynform" value=$_form.main} {include file="sub/dynForm_plain.tpl"} + + diff --git a/livesupport/modules/htmlUI/var/templates/scheduler/actionhandler.tpl b/livesupport/modules/htmlUI/var/templates/scheduler/actionhandler.tpl index 766916993..075dd8adc 100755 --- a/livesupport/modules/htmlUI/var/templates/scheduler/actionhandler.tpl +++ b/livesupport/modules/htmlUI/var/templates/scheduler/actionhandler.tpl @@ -1,7 +1,2 @@ -{UIBROWSER->getMDataArr id=$i.plid assign="_metaarr"} - -onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}
{/foreach}')" *} -onMouseout="hidealttext()" +{include file="sub/mouseover.tpl"} onClick="return contextmenu('scheduleId={$i.scheduleid}', 'SCHEDULER.removeItem')" - -{assign var="_metaarr" value=NULL} diff --git a/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl b/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl index aff403335..8de2463a3 100755 --- a/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl +++ b/livesupport/modules/htmlUI/var/templates/scratchpad/actionhandler.tpl @@ -1,11 +1,8 @@ -{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"} - -onMouseover="showalttext('{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}
{/foreach}')" -onMouseout="hidealttext()" +{include file="sub/mouseover.tpl"} onClick="hidealttextnow(); return contextmenu('{$i.id}' , 'SP.removeItem' - {if $i.type == 'audioclip'} + {if $i.type|lower == 'audioclip'} , 'listen', '{$i.gunid}' {if $_PL_activeId} , 'PL.addItem' @@ -15,7 +12,7 @@ onClick="hidealttextnow(); return contextmenu('{$i.id}' , 'edit', 'delete' {/if} - {if $i.type == 'webstream'} + {if $i.type|lower == 'webstream'} {if $_PL_activeId} , 'PL.addItem' {else} @@ -24,7 +21,7 @@ onClick="hidealttextnow(); return contextmenu('{$i.id}' , 'edit', 'delete' {/if} - {if $i.type == 'playlist'} + {if $i.type|lower == 'playlist'} {if $_PL_activeId} {if $_PL_activeId == $i.id} , 'PL.release' @@ -37,4 +34,3 @@ onClick="hidealttextnow(); return contextmenu('{$i.id}' {/if} )" -{assign var="_metaarr" value=NULL} diff --git a/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl b/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl index 377087b24..10b3b1922 100755 --- a/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl +++ b/livesupport/modules/htmlUI/var/templates/scratchpad/main.tpl @@ -29,7 +29,7 @@ {/if} {$i.duration} - {$i.type} + {$i.type|lower|capitalize} {/foreach} diff --git a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl index b1bd05eb5..462dae793 100755 --- a/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl +++ b/livesupport/modules/htmlUI/var/templates/sub/contextmenu.tpl @@ -2,7 +2,7 @@ onClick="return contextmenu('{$i.id}' {$moreContextBefore} - {if $i.type == 'audioclip'} + {if $i.type|lower == 'audioclip'} , 'listen', '{$i.gunid}' {if $_PL_activeId} , 'PL.addItem' @@ -12,7 +12,7 @@ onClick="return contextmenu('{$i.id}' , 'edit', 'delete' {/if} - {if $i.type == 'webstream'} + {if $i.type|lower == 'webstream'} {if $_PL_activeId} , 'PL.addItem' {else} @@ -21,7 +21,7 @@ onClick="return contextmenu('{$i.id}' , 'edit', 'delete' {/if} - {if $i.type == 'playlist'} + {if $i.type|lower == 'playlist'} {if $_PL_activeId} {if $_PL_activeId == $i.id} , 'PL.release' @@ -33,7 +33,7 @@ onClick="return contextmenu('{$i.id}' {/if} {/if} - {if ($i.type == 'Folder')} + {if ($i.type|lower == 'folder')} , 'fileList', 'delete' {/if} {$moreContextAfter} diff --git a/livesupport/modules/htmlUI/var/templates/sub/mouseover.tpl b/livesupport/modules/htmlUI/var/templates/sub/mouseover.tpl new file mode 100755 index 000000000..51d83177b --- /dev/null +++ b/livesupport/modules/htmlUI/var/templates/sub/mouseover.tpl @@ -0,0 +1,4 @@ +{UIBROWSER->getMDataArr id=$i.id assign="_metaarr"} +onMouseover="showalttext('

##{$i.type|lower|capitalize}## {if $_PL_activeId == $i.id}##(activated)##{/if}

{foreach from=$_metaarr.metadata key=_key item=_item}{$_key}: {$_item}
{/foreach}')" +onMouseout="hidealttext()" +{assign var="_metaarr" value=NULL} diff --git a/livesupport/modules/htmlUI/var/ui_conf.php b/livesupport/modules/htmlUI/var/ui_conf.php index 39bd0ce95..5e6e807b6 100755 --- a/livesupport/modules/htmlUI/var/ui_conf.php +++ b/livesupport/modules/htmlUI/var/ui_conf.php @@ -39,6 +39,7 @@ define('UI_MDATA_KEY_CREATOR', 'dc:creator'); define('UI_MDATA_KEY_DURATION', 'dcterms:extent'); define('UI_MDATA_KEY_URL', 'ls:url'); define('UI_MDATA_KEY_FORMAT', 'dc:format'); +define('UI_MDATA_KEY_DESCRIPTION','dc:description'); define('UI_MDATA_VALUE_FORMAT_FILE', 'File'); define('UI_MDATA_VALUE_FORMAT_STREAM', 'live stream'); @@ -77,4 +78,10 @@ require_once 'HTML/QuickForm.php'; #PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errCallBack'); PEAR::setErrorHandling(PEAR_ERROR_RETURN); #PEAR::setErrorHandling(PEAR_ERROR_PRINT); + +## extent config +$config['audiofiles'] = array('.mp3' => TRUE, + '.wav' => TRUE, + '.ogg' => TRUE + ); ?> \ No newline at end of file diff --git a/livesupport/modules/htmlUI/var/ui_handler.class.php b/livesupport/modules/htmlUI/var/ui_handler.class.php index 468e89665..b1f7f7540 100644 --- a/livesupport/modules/htmlUI/var/ui_handler.class.php +++ b/livesupport/modules/htmlUI/var/ui_handler.class.php @@ -145,6 +145,12 @@ class uiHandler extends uiBase { */ function uploadFile(&$formdata, &$mask, $replace=NULL) { + if ($this->test4audioType($formdata['mediafile']['name']) === FALSE) { + if (UI_ERROR) $this->_retMsg('$1 is unsupportet file type.', $formdata['mediafile']['name']); + $this->redirUrl = UI_BROWSER."?act=editFile&folderId=".$formdata['folderId']; + return FALSE; + } + $id = $formdata['id']; $folderId = $formdata['folderId']; @@ -179,6 +185,14 @@ class uiHandler extends uiBase { } + function test4audioType($filename) + { + if (array_key_exists(strrchr($filename, "."), $this->config['audiofiles'])) + return TRUE; + return FALSE; + } + + function transMData($id) { include dirname(__FILE__).'/formmask/metadata.inc.php'; diff --git a/livesupport/modules/htmlUI/var/ui_playlist.class.php b/livesupport/modules/htmlUI/var/ui_playlist.class.php index bb4bd60fd..16100dca3 100755 --- a/livesupport/modules/htmlUI/var/ui_playlist.class.php +++ b/livesupport/modules/htmlUI/var/ui_playlist.class.php @@ -189,13 +189,16 @@ class uiPlaylist $this->Base->_retMsg('Already active Playlist'); return FALSE; } - $datetime = date('Y-m-d H:i:s'); + $datetime = strftime('%Y-%m-%d %H:%M:%S'); $plid = $this->Base->gb->createPlaylist($this->Base->homeid, $datetime, $this->Base->sessid); if (!$plid) { $this->Base->_retMsg('Cannot create Playlist'); return FALSE; } - $this->Base->_setMDataValue($plid, UI_MDATA_KEY_TITLE, $datetime); + + $this->Base->_setMDataValue($plid, UI_MDATA_KEY_CREATOR, $this->Base->login); + $this->Base->_setMDataValue($plid, UI_MDATA_KEY_DESCRIPTION, tra('created at $1', $datetime)); + if ($this->activate($plid)===FALSE) { return FALSE; } diff --git a/livesupport/modules/htmlUI/var/ui_scheduler.class.php b/livesupport/modules/htmlUI/var/ui_scheduler.class.php index 1c3f242e6..ab741ff7b 100755 --- a/livesupport/modules/htmlUI/var/ui_scheduler.class.php +++ b/livesupport/modules/htmlUI/var/ui_scheduler.class.php @@ -89,12 +89,13 @@ class uiScheduler extends uiCalendar foreach ($arr as $key => $val) { $items[strftime('%d', $this->_datetime2timestamp($val['start']))][number_format(strftime('%H', $this->_datetime2timestamp($val['start'])))][]= array ( + 'id' => $this->Base->gb->_idFromGunid($val['playlistId']), 'scheduleid'=> $val['id'], - 'plid' => $this->Base->gb->_idFromGunid($val['playlistId']), 'start' => substr($val['start'], strpos($val['start'], 'T')+1), 'end' => substr($val['end'], strpos($val['end'], 'T') + 1), '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), + 'type' => 'Playlist' ); } @@ -116,12 +117,13 @@ class uiScheduler extends uiCalendar foreach ($arr as $key => $val) { $items[number_format(strftime('%H', $this->_datetime2timestamp($val['start'])))][]= array ( - 'plid' => $this->Base->gb->_idFromGunid($val['playlistId']), + 'id' => $this->Base->gb->_idFromGunid($val['playlistId']), 'scheduleid'=> $val['id'], 'start' => substr($val['start'], strpos($val['start'], 'T')+1), 'end' => substr($val['end'], strpos($val['end'], 'T') + 1), '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), + 'type' => 'Playlist' ); }