Namespaces | Functions

cms/upload.lib.php File Reference

Go to the source code of this file.

Namespaces

namespace  pragyan
 

Widget Framework for Pragyan CMS (c) 2010 Pragyan Team http://www.gnu.org/licenses/ GNU Public License For more details, see README Add support for File Upload/Download via the widget's configurations Reload Widgets ,Get Widget Instances. see bottom.


Functions

 upload ($moduleComponentId, $moduleName, $userId, $uploadFormName, $maxFileSizeInBytes=false, $uploadableFileTypesArray=false)
 saveUploadedFile ($moduleComponentId, $moduleName, $userId, $uploadFileName, $tempFileName, $uploadFileType, $uploadDir)
 getUploadedFiles ($moduleComponentId, $moduleName)
 fileCopy ($sourcePage_modulecomponentid, $sourcePage_module, $sourceFile_name, $destinationPage_modulecomponentid, $destinationPage_module, $destinationFile_name, $user_id)
 fileMove ($sourcePage_modulecomponentid, $sourcePage_module, $sourceFile_name, $destinationPage_modulecomponentid, $destinationPage_module, $destinationFile_name, $user_id)
 getFileName ($moduleComponentId, $page_module, $upload_fileid)
 deleteFile ($moduleComponentId, $page_module, $upload_filename)
 getUploadedFilePreviewDeleteForm ($moduleComponentId, $moduleName, $deleteFormAction= './+edit')
 submitFileUploadForm ($moduleComponentId, $moduleName, $userId, $maxFileSizeInBytes=false, $uploadableFileTypesArray=false, $uploadFieldName= 'fileUploadField')
 getFileUploadForm ($moduleComponentId, $moduleName, $uploadFormAction= './+edit', $maxFileSizeInBytes=false, $uploadFieldCount=5, $uploadFieldName= 'fileUploadField')
 getFileUploadField ($uploadFieldName, $moduleName, $maxFileSizeInBytes=false, $validCheck="")
 getMultipleFileUploadField ($uploadFieldName, $moduleName, $maxFileSizeInBytes=false, $validCheck="")
 getFileUploadError ($i)
 open_image ($file)
 createThumbs ($pathToImages, $pathToThumbs, $thumbWidth)

Function Documentation

createThumbs ( pathToImages,
pathToThumbs,
thumbWidth 
)

Definition at line 516 of file upload.lib.php.

deleteFile ( moduleComponentId,
page_module,
upload_filename 
)

Deletes the file

Definition at line 256 of file upload.lib.php.

fileCopy ( sourcePage_modulecomponentid,
sourcePage_module,
sourceFile_name,
destinationPage_modulecomponentid,
destinationPage_module,
destinationFile_name,
user_id 
)
Returns:
$copied true if copied, false if not copied successfully

Definition at line 196 of file upload.lib.php.

fileMove ( sourcePage_modulecomponentid,
sourcePage_module,
sourceFile_name,
destinationPage_modulecomponentid,
destinationPage_module,
destinationFile_name,
user_id 
)

Definition at line 221 of file upload.lib.php.

getFileName ( moduleComponentId,
page_module,
upload_fileid 
)

Return file name, given a file id ---- will never get used --- a module is supposed to have no knowledge of the file id. also check if the particular file id exists for that particular module and component id

Definition at line 243 of file upload.lib.php.

getFileUploadError ( i  ) 

Definition at line 485 of file upload.lib.php.

getFileUploadField ( uploadFieldName,
moduleName,
maxFileSizeInBytes = false,
validCheck = "" 
)

Gets a only the text box for upload

Parameters:
string $validCheck used by form for field required javascript

Definition at line 462 of file upload.lib.php.

getFileUploadForm ( moduleComponentId,
moduleName,
uploadFormAction = './+edit',
maxFileSizeInBytes = false,
uploadFieldCount = 5,
uploadFieldName = 'fileUploadField' 
)

Definition at line 420 of file upload.lib.php.

getMultipleFileUploadField ( uploadFieldName,
moduleName,
maxFileSizeInBytes = false,
validCheck = "" 
)

HTML 5 MULTIPLE UPLOAD FILE

Parameters:
same as others. just include this field once.

Definition at line 477 of file upload.lib.php.

getUploadedFilePreviewDeleteForm ( moduleComponentId,
moduleName,
deleteFormAction = './+edit' 
)

Definition at line 288 of file upload.lib.php.

getUploadedFiles ( moduleComponentId,
moduleName 
)

Return the files uploaded for this module with this module component id. Return an array of file names

Definition at line 182 of file upload.lib.php.

open_image ( file  ) 

Definition at line 497 of file upload.lib.php.

saveUploadedFile ( moduleComponentId,
moduleName,
userId,
uploadFileName,
tempFileName,
uploadFileType,
uploadDir 
)

Definition at line 130 of file upload.lib.php.

submitFileUploadForm ( moduleComponentId,
moduleName,
userId,
maxFileSizeInBytes = false,
uploadableFileTypesArray = false,
uploadFieldName = 'fileUploadField' 
)
Returns:
mixed : false if failed, true if no file found/ nothing to upload, otherwise array of filenames uploaded

Definition at line 402 of file upload.lib.php.

upload ( moduleComponentId,
moduleName,
userId,
uploadFormName,
maxFileSizeInBytes = false,
uploadableFileTypesArray = false 
)

Uploads the file

Parameters:
$moduleComponentId page_modulecomponentid
$moduleName The module which is calling this function
$uploadFormName The name of the variable used in forms to upload the file
$userId The user uploading the file
Returns:
$uploadedFiles An array of the names of the files uploaded. The file name is mysql_escaped and then uploaded

TODO : when called by a module check if it exists in enum field in DB if not give error.

Checking for existing directory named as the module and creating it if doesn't exist

Definition at line 27 of file upload.lib.php.