#1794 HTML UI: Confirmation needed on successful file upload

This commit is contained in:
sebastian 2010-02-11 15:52:19 +00:00
parent 29e7838554
commit 073b51c2dc
2 changed files with 15 additions and 18 deletions

View File

@ -8,7 +8,7 @@
<script> <script>
{UIBROWSER->getAlertMsg assign='alertMsg'} {UIBROWSER->getAlertMsg assign='alertMsg'}
{if $alertMsg} {if $alertMsg}
alert('{$alertMsg}'); alert('{$alertMsg|escape:quotes}');
{/if} {/if}
</script> </script>
</body> </body>

View File

@ -147,8 +147,8 @@ class uiHandler extends uiBase {
$this->redirUrl = UI_BROWSER."?act=addFileData&folderId=".$formdata['folderId']; $this->redirUrl = UI_BROWSER."?act=addFileData&folderId=".$formdata['folderId'];
return FALSE; return FALSE;
} else { } else {
//$duplicate->delete(); $duplicateName = $this->gb->getMetadataValue($duplicate->getId(), UI_MDATA_KEY_TITLE, $this->sessid);
$this->_retMsg('The file "'.basename($formdata['mediafile']['name']).'" already exists in the database.'); $this->_retMsg('An identical audioclip named "$1" already exists in the storage server.', $duplicateName);
$this->redirUrl = UI_BROWSER."?act=addFileData&folderId=".$formdata['folderId']; $this->redirUrl = UI_BROWSER."?act=addFileData&folderId=".$formdata['folderId'];
return FALSE; return FALSE;
} }
@ -163,7 +163,7 @@ class uiHandler extends uiBase {
// #2196 no id tag -> use the original filename // #2196 no id tag -> use the original filename
if (basename($formdata['mediafile']['tmp_name']) == $metadata['dc:title']) { if (basename($formdata['mediafile']['tmp_name']) == $metadata['dc:title']) {
$metadata['dc:title'] = $formdata['mediafile']['name']; $metadata['dc:title'] = $formdata['mediafile']['name'];
$metadata['ls_filename'] = $formdata['mediafile']['name']; $metadata['ls:filename'] = $formdata['mediafile']['name'];
} }
// bsSetMetadataBatch doesnt like these values // bsSetMetadataBatch doesnt like these values
@ -194,9 +194,8 @@ class uiHandler extends uiBase {
$result = $this->gb->bsSetMetadataBatch($storedFile->getId(), $metadata); $result = $this->gb->bsSetMetadataBatch($storedFile->getId(), $metadata);
$this->redirUrl = UI_BROWSER."?act=addFileMData&id=".$storedFile->getId(); $this->redirUrl = UI_BROWSER."?act=addFileMData&id=".$storedFile->getId();
if (UI_VERBOSE) { $this->_retMsg('Audioclip has been uploaded successfully.');
$this->_retMsg('Data of audioclip saved.');
}
return $storedFile->getId(); return $storedFile->getId();
} // fn uploadFile } // fn uploadFile
@ -295,9 +294,8 @@ class uiHandler extends uiBase {
$this->setMetadataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM); $this->setMetadataValue($r, UI_MDATA_KEY_FORMAT, UI_MDATA_VALUE_FORMAT_STREAM);
$this->redirUrl = UI_BROWSER."?act=addWebstreamMData&id=$r"; $this->redirUrl = UI_BROWSER."?act=addWebstreamMData&id=$r";
if (UI_VERBOSE) { $this->_retMsg('Webstream data has been saved.');
$this->_retMsg('Stream data saved.');
}
return $r; return $r;
} // fn addWebstream } // fn addWebstream
@ -316,16 +314,17 @@ class uiHandler extends uiBase {
$this->setMetadataValue($id, UI_MDATA_KEY_DURATION, $extent); $this->setMetadataValue($id, UI_MDATA_KEY_DURATION, $extent);
$this->redirUrl = UI_BROWSER.'?act=editItem&id='.$formdata['id']; $this->redirUrl = UI_BROWSER.'?act=editItem&id='.$formdata['id'];
if (UI_VERBOSE) { $this->_retMsg('Webstream metadata has been saved.');
$this->_retMsg('Stream data saved.');
}
return TRUE; return TRUE;
} // fn editWebstream } // fn editWebstream
/** /**
* @todo Rename this function to "editMetadata". * Sava Meatadata from form.
* @param unknown_type $formdata *
* @param array $formdata
*/ */
function editMetaData($formdata) function editMetaData($formdata)
{ {
@ -351,9 +350,7 @@ class uiHandler extends uiBase {
} }
} }
if (UI_VERBOSE) { $this->_retMsg('Audioclip metadata has been saved.');
$this->_retMsg('Metadata saved.');
}
} // fn editMetadata } // fn editMetadata