Package DE_EPAGES::MediaGallery::API::Object::MediaGallery
Interface for the MediaGallery folder.
Functions
- absolutePath
- addUploadedFiles
- copyFileFromImageDb
- createDirectory
- createThumbnail
- deleteDirectory
- deleteFile
- deleteThumbnail
- directorySize
- existsDirectory
- existsFile
- gallery2attributeFileName
- increaseGallerySize
- insertFile
- moveFile
- previewPath
- relativePath
- renameDirectory
- renameFile
- resizeImage
- testGallerySize
absolutePath
Adds the public path part of the media gallery to an relative path.
Syntax |
$AbsolutePath = $MediaGallery->absolutePath($RelativePath); |
Example |
$AbsolutePath = $MediaGallery->absolutePath("file.txt"); # $AbsolutePath eq "D:/epages/.../MediaGallery/file.txt" |
Input |
|
Return |
|
addUploadedFiles
Adds files to the media gallery as given by $Servlet->form.
Syntax |
$MediaGallery->addUploadedFiles($Directory, $hFiles, $hFileNames); |
Input |
|
Return |
|
copyFileFromImageDb
Copies a file from the global image db to the user's media gallery. Uses webget if needed.
Syntax |
$MediaGallery->copyFileFromImageDb($SourceFile, $TargetDirectory); $MediaGallery->copyFileFromImageDb( "http://host.com/imagedb/image.jpg", "MyPictures/SubDir"); |
Input |
|
createDirectory
Creates a directory in the media gallery.
Syntax |
$MediaGallery->createDirectory($Path); $MediaGallery->createDirectory($Name, $BaseDir); |
Example |
$MediaGallery->createDirectory('MyFiles/SomeDir/NewDir'); $MediaGallery->createDirectory('NewDir', 'MyFiles/SomeDir'); $MediaGallery->createDirectory('NewDir', 'MediaGallery/MyFiles/SomeDir'); |
Input |
|
createThumbnail
Creates an thumbnail for display on mediagallery.
Syntax |
$GalleryImage->createThumbnail($ImageFile); |
Input |
|
deleteDirectory
Deletes a directory in the media gallery.
Syntax |
$MediaGallery->deleteDirectory($Directory); |
Example |
$MediaGallery->deleteDirectory('MyFiles/SomeDir'); |
Input |
|
deleteFile
Deletes a file in the media gallery and may delete the parent folder, if it becomes empty.
Syntax |
$MediaGallery->deleteFile($FileName, $DeleteEmptyDirectory); |
Example |
$MediaGallery->deleteFile('MyFiles/file.txt'); $MediaGallery->deleteFile('MyFiles/file.txt', 1); |
Input |
|
deleteThumbnail
Deletes an thumbnail of the given mediagallery file.
Syntax |
$GalleryImage->deleteThumbnail($ImageFile); |
Input |
|
directorySize
Returns the default value of a directory to take in count for feature GallerySize.
Syntax |
$DirectorySize = $MediaGallery->directorySize; |
Return |
|
existsDirectory
Returns whether a directory exists in the user's media gallery.
Syntax |
$MediaGallery->existsDirectory($RelativePath); |
Example |
$MediaGallery->existsDirectory('MyFiles/SomeDir'); |
Input |
|
Return |
|
existsFile
Returns whether a file exists in the user's media gallery.
Syntax |
$MediaGallery->existsFile($RelativePath); |
Example |
$MediaGallery->existsFile('MyFiles/file.txt'); |
Input |
|
Return |
|
gallery2attributeFileName
Adds MediaGallery/ in front of filename.
Syntax |
$AttributeFile = $GalleryImage->gallery2attributeFileName($GalleryFile); |
Input |
|
Return |
|
increaseGallerySize
Increases the size of the gallery by a particular amount of bytes.
Syntax |
$MediaGallery->increaseGallerySize($Value); |
Example |
$MediaGallery->increaseGallerySize(1024); |
Input |
|
insertFile
Inserts a file in the media gallery.
Syntax |
$MediaGallery->insertFile($FileName, $rContent, $hFlags); |
Example |
$MediaGallery->insertFile('MyFiles/SomeDir/File.ext', $hForm->{'File'}, {overwrite=>1}); |
Input |
|
Return |
|
moveFile
Moves a file in the media gallery to another directory.
Syntax |
$MediaGallery->moveFile($File, $NewDirectory); |
Example |
$MediaGallery->moveFile('MyFiles/OldDir/file.txt', 'MyFiles/NewDir'); |
Input |
|
previewPath
Removes MediaGallery/ in front of filename.
Syntax |
$GalleryFile = $GalleryImage->attribute2galleryFileName($AttributeFile); |
Input |
|
Return |
|
relativePath
Removes the public path part of the media gallery from an absolute path.
Syntax |
$RelativePath = $MediaGallery->relativePath($AbsolutePath); |
Example |
$RelativePath = $MediaGallery->relativePath("D:/epages/.../MediaGallery/file.txt"); # $RelativePath eq "MediaGallery/file.txt" |
Input |
|
Return |
|
renameDirectory
Renames a directory in the media gallery.
Syntax |
$MediaGallery->renameDirectory($Directory, $NewDirectoryName); |
Example |
$MediaGallery->renameDirectory('MyFiles/OldDir', 'NewDir'); |
Input |
|
renameFile
Renames a file in the media gallery.
Syntax |
$MediaGallery->renameFile($File, $NewFileName); |
Example |
$MediaGallery->renameFile('OldDir/MyFiles/oldfile.txt', 'newfile.txt'); |
Input |
|
resizeImage
Resizes an image file in the media gallery and writes the results to a specified directory in the media gallery.
Syntax |
$MediaGallery->resizeImage($SourceFile, $TargetDirectory, $Width, $Height, $Quality); |
Example |
$MediaGallery->resizeImage( 'MyFiles/image.jpg', 'MyFiles/Thumbnails', 100, 80, 85); |
Input |
|
testGallerySize
test if size of the gallery is to large.
Syntax |
$MediaGallery->testGallerySize; |