|
| __construct ($id=0) |
|
| getMediaUrlByView ($type) |
|
| setFileInfo ($type=0) |
|
| getUrl () |
|
| getThumbUrl () |
|
| getFullPath () |
|
| getThumbPath () |
|
| determineFoldersToTest () |
|
| addFoldersToTest ($folders) |
|
| displayFoldersWriteAble () |
|
| displaySupportedImageTypes () |
|
| filterImageArgs ($imageArgs) |
|
| displayMediaFull () |
|
| displayMediaThumb ($imageArgs='', $lightbox=true, $effect="class='modal' rel='group'", $return=true, $withDescr=false, $absUrl=false, $width=0, $height=0) |
|
| getFileUrlThumb ($width=0, $height=0) |
|
| getIcon ($imageArgs, $lightbox, $return=false, $withDescr=false, $absUrl=false) |
|
| displayIt ($file_url, $file_alt, $imageArgs, $lightbox, $effect="class='modal'", $withDesc=false, $absUrl=false) |
|
| uploadFile ($urlfolder, $overwrite=false) |
|
| deleteFile ($url, $absPathGiv=0) |
|
| deleteThumbs () |
|
| processAction ($data) |
|
| processAttributes ($data) |
|
| addMediaAction ($optionName, $langkey) |
|
| addMediaActionByType () |
|
| addMediaAttributes ($optionName, $langkey='') |
|
| addMediaAttributesByType () |
|
| addHidden ($name, $value='') |
|
| displayFilesHandler ($fileIds, $type, $vendorId=0) |
|
| displayFileSelection ($fileIds, $type=0) |
|
| displayImage ($image, $key) |
|
| displayFileHandler ($vendorId=0) |
|
VmMediaHandler::__construct |
( |
|
$id = 0 | ) |
|
VmMediaHandler::addFoldersToTest |
( |
|
$folders | ) |
|
Add complete paths here to test/display if their are writable
- Author
- Max Milbers
- Parameters
-
VmMediaHandler::addHidden |
( |
|
$name, |
|
|
|
$value = '' |
|
) |
| |
Use this to adjust the hidden fields of the displayFileHandler to your form
- Author
- Max Milbers
- Parameters
-
string | $name | for exampel view |
string | $value | for exampel media |
VmMediaHandler::addHiddenByType |
( |
| ) |
|
|
private |
Adds the hidden fields which are needed for the form in every case
- Author
- Max Milbers
VmMediaHandler::addMediaAction |
( |
|
$optionName, |
|
|
|
$langkey |
|
) |
| |
This method can be used to add extra actions to the media
- Author
- Max Milbers
- Parameters
-
string | $optionName | this is the value in the form |
string | $langkey | the langkey used |
VmMediaHandler::addMediaActionByType |
( |
| ) |
|
Adds the media action which are needed in the form for all media, you can use this function in your child calling parent. Look in VmImage for an exampel
- Author
- Max Milbers
VmMediaHandler::addMediaAttributes |
( |
|
$optionName, |
|
|
|
$langkey = '' |
|
) |
| |
This method can be used to add extra attributes to the media
- Author
- Max Milbers
- Parameters
-
string | $optionName | this is the value in the form |
string | $langkey | the langkey used |
VmMediaHandler::addMediaAttributesByType |
( |
| ) |
|
Adds the attributes which are needed in the form for all media, you can use this function in your child calling parent. Look in VmImage for an exampel
- Author
- Max Milbers
static VmMediaHandler::createMedia |
( |
|
$table, |
|
|
|
$type = '' , |
|
|
|
$file_mimetype = '' |
|
) |
| |
|
static |
This function determines the type of a media and creates it. When you want to write a child class of the mediahandler, you need to manipulate this function. We may use later here a hook for plugins or simular
- Author
- Max Milbers
- Parameters
-
object | $table | |
string | $type | vendor,product,category,... |
string | $file_mimetype | such as image/jpeg |
VmMediaHandler::deleteFile |
( |
|
$url, |
|
|
|
$absPathGiv = 0 |
|
) |
| |
Deletes a file
- Parameters
-
string | $url | relative Url, gets adjusted to path |
VmMediaHandler::deleteThumbs |
( |
| ) |
|
VmMediaHandler::determineFoldersToTest |
( |
| ) |
|
This functions adds the folders to test for each media, you can add more folders to test with addFoldersToTest
- Author
- Max Milbers
VmMediaHandler::displayFileHandler |
( |
|
$vendorId = 0 | ) |
|
This displays a media handler. It displays the full and the thumb (icon) of the media. It also gives a possibility to upload/change/thumbnail media
- Parameters
-
string | $imageArgs | html atttributes, Just for displaying the fullsized image |
VmMediaHandler::displayFileSelection |
( |
|
$fileIds, |
|
|
|
$type = 0 |
|
) |
| |
Displays a possibility to select already uploaded media the getImagesList must be adjusted to have more search functions
- Author
- Max Milbers
- Parameters
-
VmMediaHandler::displayFilesHandler |
( |
|
$fileIds, |
|
|
|
$type, |
|
|
|
$vendorId = 0 |
|
) |
| |
Displays file handler and file selector
- Author
- Max Milbers
- Parameters
-
VmMediaHandler::displayFoldersWriteAble |
( |
| ) |
|
Displays for paths if they are writeable You set the folders to test with the function addFoldersToTest
- Author
- Max Milbers
VmMediaHandler::displayHidden |
( |
| ) |
|
|
private |
renders the hiddenfields added in the layout before (used to make the displayFileHandle reusable)
- Author
- Max Milbers
VmMediaHandler::displayImage |
( |
|
$image, |
|
|
|
$key |
|
) |
| |
static VmMediaHandler::displayImages |
( |
|
$types = '' , |
|
|
|
$page = 0 , |
|
|
|
$max = 16 |
|
) |
| |
|
static |
VmMediaHandler::displayIt |
( |
|
$file_url, |
|
|
|
$file_alt, |
|
|
|
$imageArgs, |
|
|
|
$lightbox, |
|
|
|
$effect = "class='modal'" , |
|
|
|
$withDesc = false , |
|
|
|
$absUrl = false |
|
) |
| |
This function is just for options how to display an image... we may add here plugins for displaying images
- Author
- Max Milbers
- Parameters
-
string | $file_url | relative Url |
string | $file_alt | media description |
string | $imageArgs | attributes for displaying the images |
boolean | $lightbox | use lightbox |
VmMediaHandler::displayMediaFull |
( |
| ) |
|
Just for overwriting purpose for childs. Take a look on VmImage to see an example
- Author
- Max Milbers
VmMediaHandler::displayMediaThumb |
( |
|
$imageArgs = '' , |
|
|
|
$lightbox = true , |
|
|
|
$effect = "class='modal' rel='group'" , |
|
|
|
$return = true , |
|
|
|
$withDescr = false , |
|
|
|
$absUrl = false , |
|
|
|
$width = 0 , |
|
|
|
$height = 0 |
|
) |
| |
This function displays the image, when the image is not already a resized one, it tries to get first the resized one, or create a resized one or fallback in case
- Author
- Max Milbers
- Parameters
-
string | $imageArgs | Attributes to be included in the tag. |
boolean | $lightbox | alternative display method |
string | $effect | alternative lightbox display |
boolean | $withDesc | display the image media description |
VmMediaHandler::displayRow |
( |
|
$descr, |
|
|
|
$name, |
|
|
|
$readonly = '' , |
|
|
|
$value = null |
|
) |
| |
|
private |
Just for creating simpel rows
- Author
- Max Milbers
- Parameters
-
VmMediaHandler::displaySupportedImageTypes |
( |
| ) |
|
VmMediaHandler::filterImageArgs |
( |
|
$imageArgs | ) |
|
VmMediaHandler::getFileUrlThumb |
( |
|
$width = 0 , |
|
|
|
$height = 0 |
|
) |
| |
VmMediaHandler::getFullPath |
( |
| ) |
|
VmMediaHandler::getIcon |
( |
|
$imageArgs, |
|
|
|
$lightbox, |
|
|
|
$return = false , |
|
|
|
$withDescr = false , |
|
|
|
$absUrl = false |
|
) |
| |
This function should return later also an icon, if there isnt any automatic thumbnail creation possible like pdf, zip, ...
- Author
- Max Milbers
- Parameters
-
string | $imageArgs | |
boolean | $lightbox | |
static VmMediaHandler::getImagesList |
( |
|
$type = '' , |
|
|
|
$limit = 0 , |
|
|
|
$max = 16 |
|
) |
| |
|
static |
Retrieve a list of layouts from the default and chosen templates directory.
We may use here the getFiles function of the media model or write something simular
- Author
- Max Milbers
- Parameters
-
- Returns
- object List of flypage objects
VmMediaHandler::getMediaUrlByView |
( |
|
$type | ) |
|
The type of the media determines the used path for storing them
- Author
- Max Milbers
- Parameters
-
string | $type | type of the media, allowed values product, category, shop, vendor, manufacturer, forSale |
VmMediaHandler::getOptions |
( |
|
$optionsarray | ) |
|
|
private |
child classes can add their own options and you can get them with this function
- Parameters
-
array | $optionsarray | Allowed values are $this->_actions and $this->_attributes |
static VmMediaHandler::getStoriesFb |
( |
|
$suffix = '' | ) |
|
|
static |
VmMediaHandler::getThumbPath |
( |
| ) |
|
VmMediaHandler::getThumbUrl |
( |
| ) |
|
VmMediaHandler::getUrl |
( |
| ) |
|
static VmMediaHandler::isImage |
( |
|
$file_extension = 0 | ) |
|
|
staticprivate |
Tests if a function is an image by mime or extension
- Author
- Max Milbers
- Parameters
-
string | $file_mimetype | |
string | $file_extension | |
static VmMediaHandler::prepareStoreMedia |
( |
|
$table, |
|
|
|
$data, |
|
|
|
$type |
|
) |
| |
|
static |
This prepares the object for storing the data. This means it does the action and returns the data for storing in the table
- Author
- Max Milbers
- Parameters
-
object | $table | |
array | $data | |
string | $type | |
VmMediaHandler::processAction |
( |
|
$data | ) |
|
Processes the choosed Action while storing the data, gets extend by the used child, use for the action clear commands. Useable commands in all medias upload, upload_delete, delete, and all of them with _thumb on it also.
- Author
- Max Milbers
- Parameters
-
VmMediaHandler::processAttributes |
( |
|
$data | ) |
|
For processing the Attributes of the media while the storing process
- Author
- Max Milbers
- Parameters
-
VmMediaHandler::setFileInfo |
( |
|
$type = 0 | ) |
|
Sets the file information and paths/urls and so on.
- Author
- Max Milbers
- Parameters
-
unknown_type | $filename | |
unknown_type | $url | |
unknown_type | $path | |
VmMediaHandler::uploadFile |
( |
|
$urlfolder, |
|
|
|
$overwrite = false |
|
) |
| |
Handles the upload process of a media, sets the mime_type, when success
- Author
- Max Milbers
- Parameters
-
string | $urlfolder | relative url of the folder where to store the media |
- Returns
- name of the uploaded file
VmMediaHandler::$_actions = array() |
|
private |
VmMediaHandler::$_foldersToTest = array() |
|
private |
VmMediaHandler::$_hidden = array() |
|
private |
VmMediaHandler::$_mLocation = array() |
|
private |
VmMediaHandler::$file_extension = '' |
VmMediaHandler::$file_name = '' |
VmMediaHandler::$media_attributes = 0 |
VmMediaHandler::$setRole = false |
VmMediaHandler::$virtuemart_media_id = '' |
The documentation for this class was generated from the following file: