diff --git a/livesupport/modules/htmlUI/var/html/ui_browser.php b/livesupport/modules/htmlUI/var/html/ui_browser.php index 000e5f2af..30fd76d8d 100644 --- a/livesupport/modules/htmlUI/var/html/ui_browser.php +++ b/livesupport/modules/htmlUI/var/html/ui_browser.php @@ -133,20 +133,23 @@ if ($uiBrowser->userid) { $Smarty->assign('uploadform', $uiBrowser->uploadFileM($ui_fmask['uploadFileM'], $uiBrowser->id)); 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": $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'])); 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": $Smarty->assign('searchForm', $uiBrowser->SEARCH->searchForm($uiBrowser->id, $ui_fmask)); diff --git a/livesupport/modules/htmlUI/var/html/ui_handler.php b/livesupport/modules/htmlUI/var/html/ui_handler.php index a1c66abeb..28223e9e8 100644 --- a/livesupport/modules/htmlUI/var/html/ui_handler.php +++ b/livesupport/modules/htmlUI/var/html/ui_handler.php @@ -23,32 +23,27 @@ switch($_REQUEST['act']){ $uiHandler->logout(TRUE); 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) $uiHandler->SCRATCHPAD->addItem($ui_tmpid); break; - case "replaceFile": - $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); - } + case "addWebstreamData": + $ui_tmpid = $uiHandler->addWebstream($_REQUEST, $ui_fmask['webstream']); + $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']); - $uiHandler->SCRATCHPAD->addItem($ui_tmpid); - } + case "addWebstreamMData": + case "editWebstreamData": + $uiHandler->editWebstream($_REQUEST, $ui_fmask['webstream']); + $uiHandler->SCRATCHPAD->reLoadM(); + break; + + case "editMetaData": + $uiHandler->editMetaData($_REQUEST); + $uiHandler->SCRATCHPAD->reLoadM(); break; case "newFolder": @@ -105,11 +100,6 @@ switch($_REQUEST['act']){ $uiHandler->changeStationPrefs(array_merge($_REQUEST, $_FILES), $ui_fmask["stationPrefs"]); break; - case "editMetaData": - $uiHandler->editMetaData($_REQUEST); - $uiHandler->SCRATCHPAD->reLoadM(); - break; - case "SP.addItem": $uiHandler->SCRATCHPAD->addItem($_REQUEST['id']); $uiHandler->SCRATCHPAD->setReload(); @@ -268,7 +258,7 @@ switch($_REQUEST['act']){ break; case "SCHEDULER.startDaemon": - $uiHandler->SCHEDULER->startDaemon(); + $uiHandler->SCHEDULER->startDaemon(TRUE); $uiHandler->SCHEDULER->setReload(); break; diff --git a/livesupport/modules/htmlUI/var/templates/file/edit.tpl b/livesupport/modules/htmlUI/var/templates/file/edit.tpl index 2d33bb133..8939d1ed4 100755 --- a/livesupport/modules/htmlUI/var/templates/file/edit.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/edit.tpl @@ -1,70 +1,74 @@
-
-

- {if $editItem.id} - ##Edit## - {else} - ##New## - {/if} - {$editItem.type|capitalize} -

+

+ {if $_REQUEST.act == addFileData || $_REQUEST.act == addFileMData || $_REQUEST.act == addWebstreamData || $_REQUEST.act == addWebstreamMData} + ##New## + {else} + ##Edit## + {/if} + {$editItem.type|capitalize} +

{if $editItem.type == 'audioclip' || $editItem.type == 'file'} -
{include file="file/fileform.tpl"}
-
{include file="file/metadataform.tpl"}
- - +
+ {if $_REQUEST.act == 'addFileData'} + + {UIBROWSER->fileForm id=$editItem.id folderId=$editItem.folderId assign="dynform"} + {include file="sub/dynForm_plain.tpl} + {assign var="_uploadform" value=null} + {/if} +
+ +
+ {include file="file/metadataform.tpl"} +
{/if} {if $editItem.type == 'webstream'} -
{include file="file/webstreamform.tpl"}
-
{include file="file/metadataform.tpl"}
- - +
+ {UIBROWSER->webstreamForm id=$editItem.id folderId=$editItem.folderId assign="dynform"} + {include file="sub/dynForm_plain.tpl} + {assign var="_uploadform" value=null} +
+ +
+ {include file="file/metadataform.tpl"} +
+ + {if $editItem.id} + + + {/if} {/if} {if $editItem.type == 'playlist'} {include file="file/metadataform.tpl"} {/if} + +
- - + diff --git a/livesupport/modules/htmlUI/var/templates/file/fileform.tpl b/livesupport/modules/htmlUI/var/templates/file/fileform.tpl deleted file mode 100755 index 75631cd5b..000000000 --- a/livesupport/modules/htmlUI/var/templates/file/fileform.tpl +++ /dev/null @@ -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} diff --git a/livesupport/modules/htmlUI/var/templates/file/metadataform.tpl b/livesupport/modules/htmlUI/var/templates/file/metadataform.tpl index b1c667289..32565f847 100755 --- a/livesupport/modules/htmlUI/var/templates/file/metadataform.tpl +++ b/livesupport/modules/htmlUI/var/templates/file/metadataform.tpl @@ -1,12 +1,11 @@ {UIBROWSER->metaDataForm id=$editItem.id langid=$editItem.curr_langid assign="_metadataform"}
- +
{assign var="dynform" value=$_metadataform.langswitch} diff --git a/livesupport/modules/htmlUI/var/templates/file/webstreamform.tpl b/livesupport/modules/htmlUI/var/templates/file/webstreamform.tpl deleted file mode 100755 index f18e5c431..000000000 --- a/livesupport/modules/htmlUI/var/templates/file/webstreamform.tpl +++ /dev/null @@ -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} - diff --git a/livesupport/modules/htmlUI/var/templates/menu.tpl b/livesupport/modules/htmlUI/var/templates/menu.tpl index 5dd9e6761..385c32667 100755 --- a/livesupport/modules/htmlUI/var/templates/menu.tpl +++ b/livesupport/modules/htmlUI/var/templates/menu.tpl @@ -1,19 +1,31 @@