ImageManager
[ class tree: ImageManager ] [ index: ImageManager ] [ all elements ]

Class: ImageManager

Source Location: /main/inc/lib/fckeditor/editor/plugins/ImageManager/Classes/ImageManager.php

Class Overview


ImageManager Class.


Author(s):

  • $Author: Wei Zhuo $

Version:

  • $Id: ImageManager.php 27 2004-04-01 08:31:57Z Wei Zhuo $

Variables

Methods



Class Details

[line 16]
ImageManager Class.



Tags:

author:  $Author: Wei Zhuo $
version:  $Id: ImageManager.php 27 2004-04-01 08:31:57Z Wei Zhuo $


[ Top ]


Class Variables

$config =

[line 21]

Configuration array.


Type:   mixed


[ Top ]

$dirs =

[line 26]

Array of directory information.


Type:   mixed


[ Top ]



Class Methods


constructor ImageManager [line 32]

ImageManager ImageManager( array $config)

Constructor. Create a new Image Manager instance.



Parameters:

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

[ Top ]

method countFiles [line 191]

void countFiles( $path)

Count the number of files and directories in a given folder minus the thumbnail folders and thumbnails.



Parameters:

   $path  

[ Top ]

method deleteDirs [line 607]

boolean deleteDirs( )

Delete and specified directories.



Tags:

return:  true if delete, false otherwise


[ Top ]

method deleteFiles [line 595]

boolean deleteFiles( )

Delete and specified files.



Tags:

return:  true if delete, false otherwise


[ Top ]

method getBaseDir [line 41]

string getBaseDir( )

Get the base directory.



Tags:

return:  base dir, see config.inc.php


[ Top ]

method getBaseURL [line 50]

string getBaseURL( )

Get the base URL.



Tags:

return:  base url, see config.inc.php


[ Top ]

method getDefaultThumb [line 530]

string getDefaultThumb( )

Get the default thumbnail.



Tags:

return:  default thumbnail, empty string if the thumbnail doesn't exist.


[ Top ]

method getDirs [line 77]

array getDirs( )

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.




Tags:

return:  of sub directries
  1. array('path name' => 'full directory path'...)


[ Top ]

method getFiles [line 136]

array getFiles( string $path)

Get all the files and directories of a relative path.



Tags:

return:  of file and path information.
  1. array(0=>array('relative'=>'fullpath',...)1=>array('filename'=>fileinfo array(),...)
fileinfo array:
  1. array('url'=>'full url',
  2.                        'relative'=>'relative to base',
  3.                         'fullpath'=>'full file path',
  4.                         'image'=>imageInfo array(false if not image,
  5.                         'stat' => filestat)


Parameters:

string   $path   relative path to be base path.

[ Top ]

method getFileURL [line 510]

string getFileURL( string $relative)

Get the URL of the relative file.

basically appends the relative file to the base_url given in config.inc.php




Tags:

return:  the URL of the relative file.


Parameters:

string   $relative   a file the relative to the base_dir

[ Top ]

method getFullPath [line 520]

string getFullPath( string $relative)

Get the fullpath to a relative file.



Tags:

return:  the full path, .ie. the base_dir + relative.


Parameters:

string   $relative   the relative file.

[ Top ]

method getImageInfo [line 221]

array getImageInfo( string $file)

Get image size information.



Tags:

return:  of getImageSize information, false if the file is not an image.


Parameters:

string   $file   the image file

[ Top ]

method getThumbnail [line 556]

string getThumbnail( string $relative)

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.




Tags:

return:  the url of the thumbnail, be it actually thumbnail or a script to generate the thumbnail on the fly.


Parameters:

string   $relative   the relative image file.

[ Top ]

method getThumbName [line 274]

string getThumbName( string $fullpathfile)

For a given image file, get the respective thumbnail filename no file existence check is done.



Tags:

return:  of the thumbnail file


Parameters:

string   $fullpathfile   the full path to the image file

[ Top ]

method getThumbURL [line 308]

string getThumbURL( string $relative)

Similar to getThumbName, but returns the URL, base on the

given base_url in config.inc.php




Tags:

return:  the url of the thumbnail


Parameters:

string   $relative   the relative image file name, relative to the base_dir path

[ Top ]

method getTmpPrefix [line 64]

string getTmpPrefix( )

Get the tmp file prefix.



Tags:

return:  tmp file prefix.


[ Top ]

method isThumb [line 231]

true isThumb( string $file)

Check if the file contains the thumbnail prefix.



Tags:

return:  if the file contains the thumbnail prefix, false otherwise.


Parameters:

string   $file   filename to be checked

[ Top ]

method isThumbDir [line 245]

true isThumbDir( string $entry)

Check if the given directory is a thumbnail directory.



Tags:

return:  if it is a thumbnail directory, false otherwise


Parameters:

string   $entry   directory name

[ Top ]

method isTmpFile [line 259]

boolean isTmpFile( string $file)

Check if the given file is a tmp file.



Tags:

return:  true if it is a tmp file, false otherwise


Parameters:

string   $file   file name

[ Top ]

method isValidBase [line 55]

void isValidBase( )



[ Top ]

method processNewDir [line 658]

boolean processNewDir( )

Create new directories.

If in safe_mode, nothing happens.




Tags:

return:  true if created, false otherwise.


[ Top ]

method processUploads [line 368]

null processUploads( )

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.




[ Top ]

method validGraphicMethods [line 682]

boolean validGraphicMethods( string $library, string $method)

Do some graphic library method checkings



Tags:

return:  true if able, false otherwise.


Parameters:

string   $library   the graphics library, GD, NetPBM, or IM.
string   $method   the method to check.

[ Top ]

method validRelativePath [line 341]

boolean validRelativePath( string $path)

Check if the given path is part of the subdirectories under the base_dir.



Tags:

return:  true if the path exists, false otherwise


Parameters:

string   $path   the relative path to be checked

[ Top ]

method _checkGDLibrary [line 712]

boolean _checkGDLibrary( $method, string $library)

Check the GD library functionality.



Tags:

return:  true if able, false otherwise.


Parameters:

string   $library   the graphics library, GD, NetPBM, or IM.
   $method  

[ Top ]

method _checkIMLibrary [line 698]

void _checkIMLibrary( $method)



Parameters:

   $method  

[ Top ]

method _delDir [line 644]

boolean _delDir( string $relative)

Delete directories recursively.



Tags:

return:  true if deleted, false otherwise.


Parameters:

string   $relative   the relative path to be deleted.

[ Top ]

method _deletePictureInDatabase [line 411]

void _deletePictureInDatabase( $relative)



Parameters:

   $relative  

[ Top ]

method _delFile [line 620]

boolean _delFile( string $relative)

Delete the relative file, and any thumbnails.



Tags:

return:  true if deleted, false otherwise.


Parameters:

string   $relative   the relative file.

[ Top ]

method _dirs [line 96]

array _dirs( string $base, string $path)

Recursively travese the directories to get a list of accessable directories.



Tags:

return:  of accessiable sub-directories
  1. array('path name' => 'full directory path'...)


Parameters:

string   $base   the full path to the current directory
string   $path   the relative path name

[ Top ]

method _insertPictureInDatabase [line 394]

void _insertPictureInDatabase( string $relative, array $file, String $file_name)

Insert the uploaded picture in the database.



Parameters:

string   $relative   The path in the document images folder
array   $file   the uploaded file from $_FILES
String   $file_name   the correct file name (generated by the function Files::copyFile).

[ Top ]

method _processFiles [line 446]

boolean _processFiles( string $relative, array $file)

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.




Tags:

return:  true if the file was processed successfully, false otherwise


Parameters:

string   $relative   the relative path where the file should be copied to.
array   $file   the uploaded file from $_FILES

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:47:00 -0500 by phpDocumentor 1.4.1