diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-15 16:40:05 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-15 16:40:05 +0100 |
| commit | c8aba9e4d5ff8fd2f13ec4e96c206c726df568b0 (patch) | |
| tree | d2074fcd322ff094c51971b22e24bec2354e2070 /attachment_uploader.php | |
| parent | 58cad39ab806494dbc6f440ce4f35793f5d7f20c (diff) | |
| download | liberty-c8aba9e4d5ff8fd2f13ec4e96c206c726df568b0.tar.gz liberty-c8aba9e4d5ff8fd2f13ec4e96c206c726df568b0.tar.bz2 liberty-c8aba9e4d5ff8fd2f13ec4e96c206c726df568b0.zip | |
Namespace fixes
Diffstat (limited to 'attachment_uploader.php')
| -rwxr-xr-x | attachment_uploader.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/attachment_uploader.php b/attachment_uploader.php index 4aa250a..bcc3446 100755 --- a/attachment_uploader.php +++ b/attachment_uploader.php @@ -8,17 +8,18 @@ /** * required setup */ +use Bitweaver\KernelTools; require_once '../kernel/includes/setup_inc.php'; global $gBitSmarty, $gContent; $error = null; if ( !isset($_FILES['upload'] ) ) { - $error = tra( "No upload submitted." ); + $error = KernelTools::tra( "No upload submitted." ); }elseif( !empty( $_REQUEST['liberty_attachments']['content_id'] )) { // if we have a content id then we just load up that if( !($gContent = LibertyBase::getLibertyObject( $_REQUEST['liberty_attachments']['content_id'] )) ) { // if there is something wrong with the content id spit back an error - $error = tra( "You are attempting to upload a file to a content item that does not exist." ); + $error = KernelTools::tra( "You are attempting to upload a file to a content item that does not exist." ); } }elseif( isset ( $_REQUEST['liberty_attachments']['content_type_guid'] ) ){ /* if we don't have a content id then we assume this is new content and we need to create a draft. @@ -26,9 +27,9 @@ if ( !isset($_FILES['upload'] ) ) { */ // if we are creating new content the status must be enforced, so status recognition must be enabled if( !$gBitSystem->isFeatureActive( "liberty_display_status" ) ){ - $error = tra( "You must save the content to upload an attachment." ); + $error = KernelTools::tra( "You must save the content to upload an attachment." ); }elseif( !isset( $gLibertySystem->mContentTypes[$_REQUEST['liberty_attachments']['content_type_guid']] ) ){ - $error = tra( "You are attempting to upload a file to an invalid content type" ); + $error = KernelTools::tra( "You are attempting to upload a file to an invalid content type" ); }else{ // load up the requested content type handler class $contentType = $_REQUEST['liberty_attachments']['content_type_guid']; @@ -39,7 +40,7 @@ if ( !isset($_FILES['upload'] ) ) { $pathVar = strtoupper($package).'_PKG_PATH'; if( !defined( $pathVar ) ) { - $error = tra( "Undefined handler package path" ); + $error = KernelTools::tra( "Undefined handler package path" ); }else{ require_once( constant( $pathVar ).$classFile ); $gContent = new $class(); |
