Class Mage_Cms_Model_Wysiwyg_Images_Storage

Description

Wysiwyg Images model

Located in /Cms/Model/Wysiwyg/Images/Storage.php (line 34)

Varien_Object
   |
   --Mage_Cms_Model_Wysiwyg_Images_Storage
Class Constant Summary
DIRECTORY_NAME_REGEXP = '/^[a-z0-9\-\_]+$/si'
THUMBS_DIRECTORY_NAME = '.thumbs'
THUMB_PLACEHOLDER_PATH_SUFFIX = 'images/placeholder/thumbnail.jpg'
Variable Summary
Method Summary
array createDirectory (string $name, string $path)
void deleteDirectory (string $path)
array getAllowedExtensions ([string $type = null])
Varien_Data_Collection_Filesystem getCollection ([string $path = null])
array getConfigAsArray ()
mixed getConfigData (string $key, [mixed $default = false])
Varien_Data_Collection_Filesystem getDirsCollection (string $path)
Varien_Data_Collection_Filesystem getFilesCollection (string $path, [string $type = null])
string getThumbnailPath (string $filePath, [boolean $checkFile = false])
string getThumbnailRoot ()
string getThumbnailUrl (string $filePath, [boolean $checkFile = false])
string getThumbsPath ([string $filePath = false])
bool isImage (string $filename)
bool|string resizeFile (string $source, [bool $keepRation = true])
bool|string resizeOnTheFly (string $filename)
array uploadFile (string $targetPath, [string $type = null])
Variables
Mage_Core_Model_Config_Element $_config (line 45)

Config object

  • access: protected
array $_configAsArray (line 52)

Config object as array

  • access: protected
Methods
createDirectory (line 184)

Create new directory in storage

  • return: New directory info
  • throws: Mage_Core_Exception
  • access: public
array createDirectory (string $name, string $path)
  • string $name: New directory name
  • string $path: Parent directory path
deleteDirectory (line 220)

Recursively delete directory from storage

  • access: public
void deleteDirectory (string $path)
  • string $path: Target dir
deleteFile (line 248)

Delete file (and its thumbnail if exists) from storage

  • access: public
Mage_Cms_Model_Wysiwyg_Images_Storage deleteFile (string $target)
  • string $target: File path to be deleted
getAllowedExtensions (line 484)

Prepare allowed_extensions config settings

  • return: Array of allowed file extensions
  • access: public
array getAllowedExtensions ([string $type = null])
  • string $type: Type of storage, e.g. image, media etc.
getCollection (line 167)

Storage collection

  • access: public
Varien_Data_Collection_Filesystem getCollection ([string $path = null])
  • string $path: Path to the directory
getConfig (line 440)

Config object getter

  • access: public
getConfigAsArray (line 454)

Config object as array getter

  • access: public
array getConfigAsArray ()
getConfigData (line 470)

Wysiwyg Config reader

  • access: public
mixed getConfigData (string $key, [mixed $default = false])
  • string $key
  • mixed $default
getDirsCollection (line 60)

Return one-level child directories for specified path

  • access: public
Varien_Data_Collection_Filesystem getDirsCollection (string $path)
  • string $path: Parent directory path
getFilesCollection (line 107)

Return files

  • access: public
Varien_Data_Collection_Filesystem getFilesCollection (string $path, [string $type = null])
  • string $path: Parent directory path
  • string $type: Type of storage, e.g. image, media etc.
getHelper (line 420)

Media Storage Helper getter

  • access: public
getSession (line 430)

Storage session

  • access: public
getThumbnailPath (line 310)

Thumbnail path getter

  • return: | false
  • access: public
string getThumbnailPath (string $filePath, [boolean $checkFile = false])
  • string $filePath: original file path
  • boolean $checkFile: OPTIONAL is it necessary to check file availability
getThumbnailRoot (line 502)

Thumbnail root directory getter

  • access: public
string getThumbnailRoot ()
getThumbnailUrl (line 332)

Thumbnail URL getter

  • return: | false
  • access: public
string getThumbnailUrl (string $filePath, [boolean $checkFile = false])
  • string $filePath: original file path
  • boolean $checkFile: OPTIONAL is it necessary to check file availability
getThumbsPath (line 404)

Return thumbnails directory path for file/current directory

  • access: public
string getThumbsPath ([string $filePath = false])
  • string $filePath: Path to the file
isImage (line 513)

Simple way to check whether file is image or not based on extension

  • access: public
bool isImage (string $filename)
  • string $filename
resizeFile (line 355)

Create thumbnail for image and save it to thumbnails directory

  • return: Resized filepath or false if errors were occurred
  • access: public
bool|string resizeFile (string $source, [bool $keepRation = true])
  • string $source: Image path to be resized
  • bool $keepRation: Keep aspect ratio or not
resizeOnTheFly (line 389)

Resize images on the fly in controller action

  • return: Thumbnail path or false for errors
  • access: public
bool|string resizeOnTheFly (string $filename)
  • string $filename: File basename
uploadFile (line 271)

Upload and resize new file

  • return: File info Array
  • throws: Mage_Core_Exception
  • access: public
array uploadFile (string $targetPath, [string $type = null])
  • string $targetPath: Target directory
  • string $type: Type of storage, e.g. image, media etc.
Class Constants
DIRECTORY_NAME_REGEXP = '/^[a-z0-9\-\_]+$/si' (line 36)
THUMBS_DIRECTORY_NAME = '.thumbs' (line 37)
THUMB_PLACEHOLDER_PATH_SUFFIX = 'images/placeholder/thumbnail.jpg' (line 38)

Documentation generated on Fri, 11 Feb 2011 17:13:24 +0200 by phpDocumentor 1.4.3