[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/filemanager/ImageManager/Classes/ -> ImageManager.php (sommaire)

ImageManager, list images, directories, and thumbnails.

Author: $Author: Wei Zhuo $
Version: $Id: ImageManager.php 2608 2006-02-19 20:09:34Z patricia $
Poids: 700 lignes (18 kb)
Inclus ou requis: 5 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

ImageManager:: (30 méthodes):
  ImageManager()
  getBaseDir()
  getBaseURL()
  isValidBase()
  getTmpPrefix()
  getDirs()
  _dirs()
  getFiles()
  countFiles()
  getImageInfo()
  isThumb()
  isThumbDir()
  isTmpFile()
  getThumbName()
  getThumbURL()
  validRelativePath()
  processUploads()
  _processFiles()
  getFileURL()
  getFullPath()
  getDefaultThumb()
  getThumbnail()
  deleteFiles()
  deleteDirs()
  _delFile()
  _delDir()
  processNewDir()
  validGraphicMethods()
  _checkIMLibrary()
  _checkGDLibrary()


Classe: ImageManager  - X-Ref

ImageManager Class.

ImageManager($config)   X-Ref
Constructor. Create a new Image Manager instance.

param: array $config configuration array, see config.inc.php

getBaseDir()   X-Ref
Get the base directory.

return: string base dir, see config.inc.php

getBaseURL()   X-Ref
Get the base URL.

return: string base url, see config.inc.php

isValidBase()   X-Ref
Pas de description

getTmpPrefix()   X-Ref
Get the tmp file prefix.

return: string tmp file prefix.

getDirs()   X-Ref
Get the sub directories in the base dir.
Each array element contain
the relative path (relative to the base dir) as key and the
full path as value.

return: array of sub directries

_dirs($base, $path)   X-Ref
Recursively travese the directories to get a list
of accessable directories.

param: string $base the full path to the current directory
param: string $path the relative path name
return: array of accessiable sub-directories

getFiles($path)   X-Ref
Get all the files and directories of a relative path.

param: string $path relative path to be base path.
return: array of file and path information.

countFiles($path)   X-Ref
Count the number of files and directories in a given folder
minus the thumbnail folders and thumbnails.


getImageInfo($file)   X-Ref
Get image size information.

param: string $file the image file
return: array of getImageSize information,

isThumb($file)   X-Ref
Check if the file contains the thumbnail prefix.

param: string $file filename to be checked
return: true if the file contains the thumbnail prefix, false otherwise.

isThumbDir($entry)   X-Ref
Check if the given directory is a thumbnail directory.

param: string $entry directory name
return: true if it is a thumbnail directory, false otherwise

isTmpFile($file)   X-Ref
Check if the given file is a tmp file.

param: string $file file name
return: boolean true if it is a tmp file, false otherwise

getThumbName($fullpathfile)   X-Ref
For a given image file, get the respective thumbnail filename
no file existence check is done.

param: string $fullpathfile the full path to the image file
return: string of the thumbnail file

getThumbURL($relative)   X-Ref
Similar to getThumbName, but returns the URL, base on the
given base_url in config.inc.php

param: string $relative the relative image file name,
return: string the url of the thumbnail

validRelativePath($path)   X-Ref
Check if the given path is part of the subdirectories
under the base_dir.

param: string $path the relative path to be checked
return: boolean true if the path exists, false otherwise

processUploads()   X-Ref
Process uploaded files, assumes the file is in
$_FILES['upload'] and $_POST['dir'] is set.
The dir must be relative to the base_dir and exists.
If 'validate_images' is set to true, only file with
image dimensions will be accepted.

return: null

_processFiles($relative, $file)   X-Ref
Process upload files. The file must be an
uploaded file. If 'validate_images' is set to
true, only images will be processed. Any duplicate
file will be renamed. See Files::copyFile for details
on renaming.

param: string $relative the relative path where the file
param: array $file the uploaded file from $_FILES
return: boolean true if the file was processed successfully,

getFileURL($relative)   X-Ref
Get the URL of the relative file.
basically appends the relative file to the
base_url given in config.inc.php

param: string $relative a file the relative to the base_dir
return: string the URL of the relative file.

getFullPath($relative)   X-Ref
Get the fullpath to a relative file.

param: string $relative the relative file.
return: string the full path, .ie. the base_dir + relative.

getDefaultThumb()   X-Ref
Get the default thumbnail.

return: string default thumbnail, empty string if

getThumbnail($relative)   X-Ref
Get the thumbnail url to be displayed.
If the thumbnail exists, and it is up-to-date
the thumbnail url will be returns. If the
file is not an image, a default image will be returned.
If it is an image file, and no thumbnail exists or
the thumbnail is out-of-date (i.e. the thumbnail
modified time is less than the original file)
then a thumbs.php?img=filename.jpg is returned.
The thumbs.php url will generate a new thumbnail
on the fly. If the image is less than the dimensions
of the thumbnails, the image will be display instead.

param: string $relative the relative image file.
return: string the url of the thumbnail, be it

deleteFiles()   X-Ref
Delete and specified files.

return: boolean true if delete, false otherwise

deleteDirs()   X-Ref
Delete and specified directories.

return: boolean true if delete, false otherwise

_delFile($relative)   X-Ref
Delete the relative file, and any thumbnails.

param: string $relative the relative file.
return: boolean true if deleted, false otherwise.

_delDir($relative)   X-Ref
Delete directories recursively.

param: string $relative the relative path to be deleted.
return: boolean true if deleted, false otherwise.

processNewDir()   X-Ref
Create new directories.
If in safe_mode, nothing happens.

return: boolean true if created, false otherwise.

validGraphicMethods($library,$method)   X-Ref
Do some graphic library method checkings

param: string $library the graphics library, GD, NetPBM, or IM.
param: string $method the method to check.
return: boolean true if able, false otherwise.

_checkIMLibrary($method)   X-Ref
Pas de description

_checkGDLibrary($method)   X-Ref
Check the GD library functionality.

param: string $library the graphics library, GD, NetPBM, or IM.
return: boolean true if able, false otherwise.



Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7