diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2008-05-29 09:04:36 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2008-05-29 09:04:36 +0000 |
| commit | b7273f93603c45cf9774506dc5f87a84db0b825e (patch) | |
| tree | a5c8a466af421639415b69c94457ed9dfe4bb6f7 /plugins | |
| parent | f2f8bd42911d29319464a2b41655240eea690bb8 (diff) | |
| download | liberty-b7273f93603c45cf9774506dc5f87a84db0b825e.tar.gz liberty-b7273f93603c45cf9774506dc5f87a84db0b825e.tar.bz2 liberty-b7273f93603c45cf9774506dc5f87a84db0b825e.zip | |
lots of updates, make it possible to update multiple attachments at once, better handling of attachment updates in LibertyMime
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/mime.audio.php | 27 | ||||
| -rw-r--r-- | plugins/mime.default.php | 9 |
2 files changed, 18 insertions, 18 deletions
diff --git a/plugins/mime.audio.php b/plugins/mime.audio.php index bb7168b..79243d9 100644 --- a/plugins/mime.audio.php +++ b/plugins/mime.audio.php @@ -1,9 +1,9 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_liberty/plugins/mime.audio.php,v 1.7 2008/05/28 18:55:00 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/plugins/mime.audio.php,v 1.8 2008/05/29 09:04:36 squareing Exp $ * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ * created Thursday May 08, 2008 * @package liberty * @subpackage liberty_mime_handler @@ -88,6 +88,7 @@ function mime_audio_update( &$pStoreRow, $pParams = NULL ) { // if we have been passed a set of parameters, we're only interested in updating the meta data $ret = FALSE; if( BitBase::verifyId( $pStoreRow['attachment_id'] )) { + // now that the upload has been processed (if there was one), we'll deal with the additional params if( !empty( $pStoreRow['storage_path'] ) && !empty( $pParams )) { // update our local version of the file $file = BIT_ROOT_PATH.$pStoreRow['storage_path']; @@ -109,18 +110,18 @@ function mime_audio_update( &$pStoreRow, $pParams = NULL ) { } else { $pStoreRow['errors'] = $log; } - } else { - // this will set the correct pluign guid, even if we let default handle the store process - $pStoreRow['attachment_plugin_guid'] = PLUGIN_MIME_GUID_AUDIO; - $pStoreRow['log'] = array(); + } - // if storing works, we process the audio - if( $ret = mime_default_update( $pStoreRow )) { - if( !mime_audio_converter( $pStoreRow )) { - // if it all goes tits up, we'll know why - $pStoreRow['errors'] = $pStoreRow['log']; - $ret = FALSE; - } + // this will set the correct pluign guid, even if we let default handle the store process + $pStoreRow['attachment_plugin_guid'] = PLUGIN_MIME_GUID_AUDIO; + $pStoreRow['log'] = array(); + + // if storing works, we process the audio + if( !empty( $pStoreRow['upload'] ) && $ret = mime_default_update( $pStoreRow )) { + if( !mime_audio_converter( $pStoreRow )) { + // if it all goes tits up, we'll know why + $pStoreRow['errors'] = $pStoreRow['log']; + $ret = FALSE; } } } diff --git a/plugins/mime.default.php b/plugins/mime.default.php index 27088d5..f70c9e0 100644 --- a/plugins/mime.default.php +++ b/plugins/mime.default.php @@ -1,9 +1,9 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_liberty/plugins/mime.default.php,v 1.8 2008/05/23 10:00:59 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_liberty/plugins/mime.default.php,v 1.9 2008/05/29 09:04:36 squareing Exp $ * * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ * created Thursday May 08, 2008 * @package liberty * @subpackage liberty_mime_handler @@ -117,9 +117,8 @@ function mime_default_verify( &$pStoreRow ) { function mime_default_update( &$pStoreRow ) { global $gBitSystem; - if( BitBase::verifyId( $pStoreRow['attachment_id'] )) { - // get the data we need to deal with - $query = "SELECT `storage_path` FROM `".BIT_DB_PREFIX."liberty_files` lf WHERE `file_id` = ?"; + // this will reset the uploaded file + if( BitBase::verifyId( $pStoreRow['attachment_id'] ) && !empty( $pStoreRow['upload'] )) { if( !empty( $pStoreRow['storage_path'] )) { // First we remove the old file $file = BIT_ROOT_PATH.$pStoreRow['storage_path']; |
