parent
899a387d39
commit
5f26e925db
11 changed files with 132 additions and 133 deletions
|
@ -133,20 +133,23 @@ if ($uiBrowser->userid) {
|
||||||
$Smarty->assign('uploadform', $uiBrowser->uploadFileM($ui_fmask['uploadFileM'], $uiBrowser->id));
|
$Smarty->assign('uploadform', $uiBrowser->uploadFileM($ui_fmask['uploadFileM'], $uiBrowser->id));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "addFileData":
|
||||||
|
case "addFileMData":
|
||||||
|
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
||||||
|
$Smarty->assign('editItem', array('type' => 'audioclip', 'id' => $_REQUEST['id'], 'folderId' => $uiBrowser->fid, 'curr_langid' => $_REQUEST['curr_langid']));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "addWebstreamData":
|
||||||
|
case "addWebstreamMData":
|
||||||
|
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
||||||
|
$Smarty->assign('editItem', array('type' => 'webstream', 'id' => $_REQUEST['id'], 'folderId' => $uiBrowser->fid, 'curr_langid' => $_REQUEST['curr_langid']));
|
||||||
|
break;
|
||||||
|
|
||||||
case "editItem":
|
case "editItem":
|
||||||
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
||||||
$Smarty->assign('editItem', array('type' => $uiBrowser->type, 'id' => $_REQUEST['id'], 'folderId' => $uiBrowser->fid, 'curr_langid' => $_REQUEST['curr_langid']));
|
$Smarty->assign('editItem', array('type' => $uiBrowser->type, 'id' => $_REQUEST['id'], 'folderId' => $uiBrowser->fid, 'curr_langid' => $_REQUEST['curr_langid']));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "editFile":
|
|
||||||
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
|
||||||
$Smarty->assign('editItem', array('type' => 'file', 'id' => $_REQUEST['id'], 'folderId' => $uiBrowser->fid, 'curr_langid' => $_REQUEST['curr_langid']));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "editWebstream":
|
|
||||||
$Smarty->assign('structure', $uiBrowser->getStructure($uiBrowser->id));
|
|
||||||
$Smarty->assign('editItem', array('type' => 'webstream', 'id' => $_REQUEST['id'], 'folderId' => $uiBrowser->fid, 'curr_langid' => $_REQUEST['curr_langid']));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "SEARCH":
|
case "SEARCH":
|
||||||
$Smarty->assign('searchForm', $uiBrowser->SEARCH->searchForm($uiBrowser->id, $ui_fmask));
|
$Smarty->assign('searchForm', $uiBrowser->SEARCH->searchForm($uiBrowser->id, $ui_fmask));
|
||||||
|
|
|
@ -23,32 +23,27 @@ switch($_REQUEST['act']){
|
||||||
$uiHandler->logout(TRUE);
|
$uiHandler->logout(TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "uploadFileM":
|
|
||||||
if ($ui_tmpid = $uiHandler->uploadFileM(array_merge($_REQUEST, $_FILES), $uiHandler->id, $ui_fmask["uploadFileM"]))
|
|
||||||
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "uploadFile":
|
## file/webstream handling
|
||||||
|
case "addFileData":
|
||||||
if (($ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $ui_fmask["file"])) !== FALSE)
|
if (($ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $ui_fmask["file"])) !== FALSE)
|
||||||
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "replaceFile":
|
case "addWebstreamData":
|
||||||
$ui_tmpgunid = $uiHandler->gb->_gunidFromId($uiHandler->id);
|
|
||||||
if ($uiHandler->delete($uiHandler->id) === TRUE) {
|
|
||||||
$ui_tmpid = $uiHandler->uploadFile(array_merge($_REQUEST, $_FILES), $uiHandler->pid, $ui_fmask["file"], $ui_tmpgunid);
|
|
||||||
$uiHandler->SCRATCHPAD->removeItems($uiHandler->id);
|
|
||||||
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "editWebstream":
|
|
||||||
if ($_REQUEST['id']) {
|
|
||||||
$uiHandler->editWebstream($_REQUEST, $ui_fmask['webstream']);
|
|
||||||
} else {
|
|
||||||
$ui_tmpid = $uiHandler->addWebstream($_REQUEST, $ui_fmask['webstream']);
|
$ui_tmpid = $uiHandler->addWebstream($_REQUEST, $ui_fmask['webstream']);
|
||||||
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
$uiHandler->SCRATCHPAD->addItem($ui_tmpid);
|
||||||
}
|
break;
|
||||||
|
|
||||||
|
case "addWebstreamMData":
|
||||||
|
case "editWebstreamData":
|
||||||
|
$uiHandler->editWebstream($_REQUEST, $ui_fmask['webstream']);
|
||||||
|
$uiHandler->SCRATCHPAD->reLoadM();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "editMetaData":
|
||||||
|
$uiHandler->editMetaData($_REQUEST);
|
||||||
|
$uiHandler->SCRATCHPAD->reLoadM();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "newFolder":
|
case "newFolder":
|
||||||
|
@ -105,11 +100,6 @@ switch($_REQUEST['act']){
|
||||||
$uiHandler->changeStationPrefs(array_merge($_REQUEST, $_FILES), $ui_fmask["stationPrefs"]);
|
$uiHandler->changeStationPrefs(array_merge($_REQUEST, $_FILES), $ui_fmask["stationPrefs"]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "editMetaData":
|
|
||||||
$uiHandler->editMetaData($_REQUEST);
|
|
||||||
$uiHandler->SCRATCHPAD->reLoadM();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "SP.addItem":
|
case "SP.addItem":
|
||||||
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
|
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
|
||||||
$uiHandler->SCRATCHPAD->setReload();
|
$uiHandler->SCRATCHPAD->setReload();
|
||||||
|
@ -268,7 +258,7 @@ switch($_REQUEST['act']){
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "SCHEDULER.startDaemon":
|
case "SCHEDULER.startDaemon":
|
||||||
$uiHandler->SCHEDULER->startDaemon();
|
$uiHandler->SCHEDULER->startDaemon(TRUE);
|
||||||
$uiHandler->SCHEDULER->setReload();
|
$uiHandler->SCHEDULER->setReload();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1,70 +1,74 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- start editor -->
|
|
||||||
<div class="container_elements" style="width: 607px;">
|
<div class="container_elements" style="width: 607px;">
|
||||||
<h1>
|
<h1>
|
||||||
{if $editItem.id}
|
{if $_REQUEST.act == addFileData || $_REQUEST.act == addFileMData || $_REQUEST.act == addWebstreamData || $_REQUEST.act == addWebstreamMData}
|
||||||
##Edit##
|
|
||||||
{else}
|
|
||||||
##New##
|
##New##
|
||||||
|
{else}
|
||||||
|
##Edit##
|
||||||
{/if}
|
{/if}
|
||||||
{$editItem.type|capitalize}
|
{$editItem.type|capitalize}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
{if $editItem.type == 'audioclip' || $editItem.type == 'file'}
|
{if $editItem.type == 'audioclip' || $editItem.type == 'file'}
|
||||||
<div id="div_Data"> {include file="file/fileform.tpl"} </div>
|
<div id="div_Data">
|
||||||
<div id="div_MData"> {include file="file/metadataform.tpl"} </div>
|
{if $_REQUEST.act == 'addFileData'}
|
||||||
<input type="button" class="button" onClick="showData()" value="##Data##">
|
|
||||||
<input type="button" class="button" onClick="showMData()" value="##Metadata##">
|
{UIBROWSER->fileForm id=$editItem.id folderId=$editItem.folderId assign="dynform"}
|
||||||
|
{include file="sub/dynForm_plain.tpl}
|
||||||
|
{assign var="_uploadform" value=null}
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="div_MData">
|
||||||
|
{include file="file/metadataform.tpl"}
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $editItem.type == 'webstream'}
|
{if $editItem.type == 'webstream'}
|
||||||
<div id="div_Data"> {include file="file/webstreamform.tpl"} </div>
|
<div id="div_Data">
|
||||||
<div id="div_MData"> {include file="file/metadataform.tpl"} </div>
|
{UIBROWSER->webstreamForm id=$editItem.id folderId=$editItem.folderId assign="dynform"}
|
||||||
<input type="button" class="button" onClick="showData()" value="##Data##">
|
{include file="sub/dynForm_plain.tpl}
|
||||||
<input type="button" class="button" onClick="showMData()" value="##Metadata##">
|
{assign var="_uploadform" value=null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="div_MData">
|
||||||
|
{include file="file/metadataform.tpl"}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{if $editItem.id}
|
||||||
|
<input type="button" class="button" onClick="showData()" value="##Stream Data##">
|
||||||
|
<input type="button" class="button" onClick="showMData()" value="##Description##">
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{if $editItem.type == 'playlist'}
|
{if $editItem.type == 'playlist'}
|
||||||
{include file="file/metadataform.tpl"}
|
{include file="file/metadataform.tpl"}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- end editor -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function showData()
|
function showData()
|
||||||
{literal}
|
{literal}
|
||||||
{
|
{
|
||||||
{/literal}
|
|
||||||
{if $editItem.id && $editItem.type == 'file'}
|
|
||||||
alert('Sorry, function temporary disabled');
|
|
||||||
return false;
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
document.getElementById('div_Data').style.display = 'inherit';
|
document.getElementById('div_Data').style.display = 'inherit';
|
||||||
document.getElementById('div_MData').style.display = 'none';
|
document.getElementById('div_MData').style.display = 'none';
|
||||||
{literal}
|
|
||||||
}
|
}
|
||||||
{/literal}
|
|
||||||
|
|
||||||
{if $editItem.id}
|
|
||||||
{literal}
|
|
||||||
function showMData()
|
function showMData()
|
||||||
{
|
{
|
||||||
document.getElementById('div_MData').style.display = 'inherit';
|
document.getElementById('div_MData').style.display = 'inherit';
|
||||||
document.getElementById('div_Data').style.display = 'none';
|
document.getElementById('div_Data').style.display = 'none';
|
||||||
}
|
}
|
||||||
document.getElementById('div_Data').style.display = 'none';
|
|
||||||
{/literal}
|
|
||||||
{else}
|
|
||||||
{literal}
|
|
||||||
function showMData()
|
|
||||||
{
|
|
||||||
alert ('Data first!');
|
|
||||||
}
|
|
||||||
{/literal}
|
{/literal}
|
||||||
|
|
||||||
|
{if $_REQUEST.act == addFileData || $_REQUEST.act == addWebstreamData}
|
||||||
document.getElementById('div_MData').style.display = 'none';
|
document.getElementById('div_MData').style.display = 'none';
|
||||||
|
{else}
|
||||||
|
document.getElementById('div_Data').style.display = 'none';
|
||||||
{/if}
|
{/if}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
{UIBROWSER->fileForm id=$editItem.id folderId=$editItem.folderId assign="dynform"}
|
|
||||||
{include file="sub/dynForm_plain.tpl}
|
|
||||||
{assign var="_uploadform" value=null}
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
<div id="tabnav">
|
<div id="tabnav">
|
||||||
<ul>
|
<ul>
|
||||||
<!--li><a href="#" class="active">Search</a></li-->
|
|
||||||
<li><a href="#" onClick="javascript:showMain();" id="switch_Main">##Main##</a></li>
|
<li><a href="#" onClick="javascript:showMain();" id="switch_Main">##Main##</a></li>
|
||||||
<li><a href="#" onClick="javascript:showMusic();" id="switch_Music">##Music##</a></li>
|
<li><a href="#" onClick="javascript:showMusic();" id="switch_Music">##Music##</a></li>
|
||||||
<li><a href="#" onClick="javascript:showTalk();" id="switch_Talk">##Talk##</a></li>
|
<li><a href="#" onClick="javascript:showTalk();" id="switch_Talk">##Talk##</a></li>
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{UIBROWSER->webstreamForm id=$editItem.id folderId=$editItem.folderId assign="dynform"}
|
|
||||||
{include file="sub/dynForm_plain.tpl}
|
|
||||||
{assign var="_uploadform" value=null}
|
|
||||||
|
|
|
@ -1,19 +1,31 @@
|
||||||
<!-- start nav -->
|
<!-- start nav -->
|
||||||
<div class="container_nav">
|
<div class="container_nav">
|
||||||
<ul id="nav">
|
<ul id="nav">
|
||||||
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=editFile">##Add Audio##</a>
|
<li><a>##Add Audio##</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=editFile" >##File##</a></li>
|
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=addFileData" >##File##</a></li>
|
||||||
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=editWebstream">##Stream##</a></li>
|
<li><a href="{$UI_BROWSER}?folderId={$START.fid}&act=addWebstreamData">##Stream##</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="{$UI_BROWSER}?id={$START.id}&act=BROWSE">##Media Library##</a>
|
<li><a>##Media Library##</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{$UI_BROWSER}?id={$START.id}&act=BROWSE">##Browse##</a></li>
|
<li><a href="{$UI_BROWSER}?id={$START.id}&act=BROWSE">##Browse##</a></li>
|
||||||
<li><a href="{$UI_BROWSER}?id={$START.id}&act=SEARCH">##Search##</a></li>
|
<li><a href="{$UI_BROWSER}?id={$START.id}&act=SEARCH">##Search##</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">##Playlist Editor##</a></li>
|
<li><a>##Playlists##</a>
|
||||||
|
<ul>
|
||||||
|
{if $PL->getActiveArr()}
|
||||||
|
<li><a href="{$UI_BROWSER}?id={$START.fid}&act=PL.simpleManagement">##Edit Playlist##</a></li>
|
||||||
|
{else}
|
||||||
|
{if $PL->reportLookedPL()}
|
||||||
|
<li><a onClick="hpopup('{$UI_HANDLER}?act=PL.unlook')">##Open last Playlist##</a></li>
|
||||||
|
{else}
|
||||||
|
<li><a onClick="hpopup('{$UI_HANDLER}?act=PL.create')">##New empty Playlist##</a></li>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li><a href="{$UI_BROWSER}?act=SCHEDULER">##Scheduler##</a>
|
<li><a href="{$UI_BROWSER}?act=SCHEDULER">##Scheduler##</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="javascript: hpopup('{$UI_HANDLER}?act=SCHEDULER.set&view=month'); location.href='{$UI_BROWSER}?act=SCHEDULER'">##Month##</a></li>
|
<li><a href="javascript: hpopup('{$UI_HANDLER}?act=SCHEDULER.set&view=month'); location.href='{$UI_BROWSER}?act=SCHEDULER'">##Month##</a></li>
|
||||||
|
@ -24,7 +36,7 @@
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{if $SUBJECTS->Base->gb->checkPerm($SUBJECTS->Base->userid, 'subjects')}
|
{if $SUBJECTS->Base->gb->checkPerm($SUBJECTS->Base->userid, 'subjects')}
|
||||||
<li><a href="{$UI_BROWSER}?act=changeStationPrefs">##Station Settings##</a>
|
<li><a href="{$UI_BROWSER}?act=changeStationPrefs">##Preferences##</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{$UI_BROWSER}?act=changeStationPrefs" >##Station Settings##</a></li>
|
<li><a href="{$UI_BROWSER}?act=changeStationPrefs" >##Station Settings##</a></li>
|
||||||
<li><a href="{$UI_BROWSER}?act=SUBJECTS" >##User/Groups##</a></li>
|
<li><a href="{$UI_BROWSER}?act=SUBJECTS" >##User/Groups##</a></li>
|
||||||
|
|
|
@ -138,27 +138,7 @@ class uiBrowser extends uiBase {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uploadFileM
|
* fileForm
|
||||||
*
|
|
||||||
* create a form for file-upload
|
|
||||||
*
|
|
||||||
* @param int local $id of directory to store file in
|
|
||||||
*
|
|
||||||
* @eturn string (html)
|
|
||||||
*/
|
|
||||||
function uploadFileM(&$mask, $id)
|
|
||||||
{
|
|
||||||
$form = new HTML_QuickForm('uploadFileM', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
|
||||||
$form->setMaxFileSize($this->STATIONPREFS['stationMaxfilesize']);
|
|
||||||
$form->setConstants(array('id' => $id,
|
|
||||||
'act' => 'uploadFileM'));
|
|
||||||
$this->_parseArr2Form($form, $mask);
|
|
||||||
return $form->toHTML();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* uploadFile
|
|
||||||
*
|
*
|
||||||
* create a form for file-upload
|
* create a form for file-upload
|
||||||
*
|
*
|
||||||
|
@ -175,7 +155,7 @@ class uiBrowser extends uiBase {
|
||||||
$form->setMaxFileSize($this->STATIONPREFS['stationMaxfilesize']);
|
$form->setMaxFileSize($this->STATIONPREFS['stationMaxfilesize']);
|
||||||
$form->setConstants(array('folderId' => $folderId,
|
$form->setConstants(array('folderId' => $folderId,
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'act' => $id ? 'editFile' : 'uploadFile'));
|
'act' => $id ? 'editItem' : 'addFileData'));
|
||||||
$this->_parseArr2Form($form, $mask);
|
$this->_parseArr2Form($form, $mask);
|
||||||
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
$renderer =& new HTML_QuickForm_Renderer_Array(true, true);
|
||||||
$form->accept($renderer);
|
$form->accept($renderer);
|
||||||
|
@ -184,7 +164,7 @@ class uiBrowser extends uiBase {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* addWebstream
|
* webstreamForm
|
||||||
*
|
*
|
||||||
* create a form to add Webstream
|
* create a form to add Webstream
|
||||||
*
|
*
|
||||||
|
@ -200,7 +180,7 @@ class uiBrowser extends uiBase {
|
||||||
$form = new HTML_QuickForm('addWebstream', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
$form = new HTML_QuickForm('addWebstream', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
$const = array('folderId' => $folderId,
|
$const = array('folderId' => $folderId,
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'act' => 'editWebstream',
|
'act' => $id ? 'editWebstreamData' : 'addWebstreamData',
|
||||||
'title' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_TITLE) : NULL,
|
'title' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_TITLE) : NULL,
|
||||||
'url' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_URL) : 'http://',
|
'url' => $id ? $this->_getMDataValue($id, UI_MDATA_KEY_URL) : 'http://',
|
||||||
'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->_getMDataValue($id, UI_MDATA_KEY_DURATION)) : NULL
|
'length' => $id ? preg_replace("/\.[0-9]{1,6}/", "", $this->_getMDataValue($id, UI_MDATA_KEY_DURATION)) : NULL
|
||||||
|
|
|
@ -147,7 +147,7 @@ class uiHandler extends uiBase {
|
||||||
$this->transMData($r, UI_UPLOAD_LANGID);
|
$this->transMData($r, UI_UPLOAD_LANGID);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->redirUrl = UI_BROWSER."?act=editFile&id=$r";
|
$this->redirUrl = UI_BROWSER."?act=addFileMData&id=$r";
|
||||||
if (UI_VERBOSE) $this->_retMsg('Audioclip Data saved');
|
if (UI_VERBOSE) $this->_retMsg('Audioclip Data saved');
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,9 @@ class uiHandler extends uiBase {
|
||||||
$this->redirUrl = UI_BROWSER."?act=editWebstream&id=".$id;
|
$this->redirUrl = UI_BROWSER."?act=editWebstream&id=".$id;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = $this->gb->storeWebstream($folderId, $formdata['title'], NULL, $this->sessid, NULL, $formdata['url']);
|
$r = $this->gb->storeWebstream($folderId, $formdata['title'], NULL, $this->sessid, NULL, $formdata['url']);
|
||||||
|
|
||||||
if(PEAR::isError($r)) {
|
if(PEAR::isError($r)) {
|
||||||
$this->_retMsg($r->getMessage());
|
$this->_retMsg($r->getMessage());
|
||||||
$this->redirUrl = UI_BROWSER."?act=editWebstream&id=".$id;
|
$this->redirUrl = UI_BROWSER."?act=editWebstream&id=".$id;
|
||||||
|
@ -227,7 +229,7 @@ class uiHandler extends uiBase {
|
||||||
$this->_setMDataValue($r, UI_MDATA_KEY_DURATION, $extent);
|
$this->_setMDataValue($r, UI_MDATA_KEY_DURATION, $extent);
|
||||||
$this->_setMDataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
|
$this->_setMDataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
|
||||||
|
|
||||||
$this->redirUrl = UI_BROWSER."?act=editWebstream&id=$r";
|
$this->redirUrl = UI_BROWSER."?act=addWebstreamMData&id=$r";
|
||||||
if (UI_VERBOSE) $this->_retMsg('Stream Data saved');
|
if (UI_VERBOSE) $this->_retMsg('Stream Data saved');
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
@ -240,12 +242,14 @@ class uiHandler extends uiBase {
|
||||||
$this->redirUrl = UI_BROWSER."?act=editWebstream&id=".$id;
|
$this->redirUrl = UI_BROWSER."?act=editWebstream&id=".$id;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
$length = sprintf('%02d', $formdata['length']['H']).':'.sprintf('%02d', $formdata['length']['i']).':'.sprintf('%02d', $formdata['length']['s']).'.000000';
|
$extent = sprintf('%02d', $formdata['length']['H']).':'.sprintf('%02d', $formdata['length']['i']).':'.sprintf('%02d', $formdata['length']['s']).'.000000';
|
||||||
$this->_setMDataValue($id, UI_MDATA_KEY_TITLE, $this->sessid, $formdata['title']);
|
|
||||||
$this->_setMDataValue($id, UI_MDATA_KEY_URL, $this->sessid, $formdata['url']);
|
$this->_setMDataValue($id, UI_MDATA_KEY_TITLE, $formdata['title']);
|
||||||
$this->_setMDataValue($id, UI_MDATA_KEY_DURATION, $this->sessid, $length);
|
$this->_setMDataValue($id, UI_MDATA_KEY_URL, $formdata['url']);
|
||||||
|
$this->_setMDataValue($id, UI_MDATA_KEY_DURATION, $extent);
|
||||||
|
|
||||||
|
$this->redirUrl = UI_BROWSER.'?act=editItem&id='.$formdata['id'];
|
||||||
if (UI_VERBOSE) $this->_retMsg('Stream Data changed');
|
if (UI_VERBOSE) $this->_retMsg('Stream Data changed');
|
||||||
$this->redirUrl = UI_BROWSER.'?act=editWebstream&id='.$formdata['id'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@ class uiScheduler extends uiCalendar
|
||||||
|
|
||||||
$this->uiCalendar();
|
$this->uiCalendar();
|
||||||
$this->initXmlRpc();
|
$this->initXmlRpc();
|
||||||
|
|
||||||
|
$this->startDaemon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,18 +43,30 @@ class uiScheduler extends uiCalendar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function startDaemon()
|
function startDaemon($msg=FALSE)
|
||||||
{
|
{
|
||||||
|
if ($this->testDaemon($msg) === TRUE)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
exec(UI_SCHEDULER_DAEMON_CMD);
|
exec(UI_SCHEDULER_DAEMON_CMD);
|
||||||
sleep(5);
|
sleep(5);
|
||||||
|
|
||||||
|
if ($this->testDaemon($msg)===FALSE) {
|
||||||
|
if ($msg) $this->Base->_retMsg('Scheduler did not start. Check setting of "UI_SCHEDULER_DAEMON_CMD" in ui_conf.php. File "/tmp/scheduler.log" could be helpful.');
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function testDaemon($msg=FALSE)
|
||||||
|
{
|
||||||
exec('ps -A', $output);
|
exec('ps -A', $output);
|
||||||
foreach ($output as $l) {
|
foreach ($output as $l) {
|
||||||
if (preg_match("/ ".UI_SCHEDULER_DAEMON_NAME."$/", $l)) {
|
if (preg_match("/ ".UI_SCHEDULER_DAEMON_NAME."$/", $l)) {
|
||||||
$this->Base->_retMsg('Scheduler started sucessfully.');
|
if ($msg) $this->Base->_retMsg('Scheduler is running.');
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->Base->_retMsg('Scheduler did not start. Check setting of "UI_SCHEDULER_DAEMON_CMD" in ui_conf.php. File "/tmp/scheduler.log" could be helpful.');
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue