|
eZ Publish
[4.2]
|
Internal manager for the eZImage datatype. More...
Public Member Functions | |
| addImageAlias ($imageAlias) | |
| addImageAliases ($imageAliasList) | |
| addImageAliasToXML ($domTree, $imageAlias) | |
| attribute ($attributeName) | |
| & | attributeFromOriginal ($attributeName) |
| attributes () | |
| createImageInformationNode ($imageNode, $mimeData) | |
| directoryPath () | |
| displayText ($alternativeText=null) | |
| domTree () | |
| eZImageAliasHandler ($contentObjectAttribute) | |
| generateXMLData () | |
| hasAttribute ($attributeName) | |
| httpFile ($release=false) | |
| Returns the stored HTTP file object or false if no object is stored. | |
| imageAlias ($aliasName) | |
| imageName ($contentObjectAttribute, $contentVersion, $language=false) | |
| imageNameByNode ($contentObjectAttribute, $mainNode, $language=false) | |
| imagePath ($contentObjectAttribute, $contentVersion, $isImageOwner=null) | |
| imagePathByNode ($contentObjectAttribute, $mainNode) | |
| imageSerialNumber () | |
| increaseImageSerialNumber () | |
| initialize ($mimeData, $originalFilename, $imageAltText=false) | |
| initializeFromFile ($filename, $imageAltText=false, $originalFilename=false) | |
| initializeFromHTTPFile ($httpFile, $imageAltText=false) | |
| Initializes the content object attribute with the uploaded HTTP file. | |
| isImageOwner () | |
| isStorageRequired () | |
| originalAttributeData () | |
| removeAliases ($contentObjectAttribute) | |
| Removes all the image aliases and their information. | |
| resetImageSerialNumber () | |
| setAttribute ($attributeName, $attributeValue) | |
| setDOMTree ($domTree) | |
| setHTTPFile ($httpFile) | |
| Sets the uploaded HTTP file object to $httpFile. | |
| setImageSerialNumber ($val) | |
| setOriginalAttributeData ($originalData) | |
| setOriginalAttributeDataFromAttribute ($contentObjectAttribute) | |
| setOriginalAttributeDataValues ($attributeID, $attributeVersion, $attributeLanguage) | |
| setStorageRequired ($require=true) | |
| store ($contentObjectAttribute) | |
| storeDOMTree ($domTree, $storeAttribute, $contentObjectAttributeRef) | |
| updateAliasPath ($dirpath, $name) | |
Static Public Member Functions | |
| normalizeImageName ($imageName) | |
| static | removeAllAliases ($contentObjectAttribute) |
| Removes all image alias files which the attribute refers to. | |
Public Attributes | |
| $ContentObjectAttribute | |
| Deprecated. Contains a reference to the object attribute. | |
| $ContentObjectAttributeData | |
| Contains a some eZContentObjectAttribute's attributes. | |
Protected Member Functions | |
| setAliasAttribute ($aliasName, $attributeName, $value) | |
| setAliasList ($aliasList) | |
| setAliasVariation ($aliasName, $variation) | |
Private Member Functions | |
| aliasList () | |
| createOriginalAttributeXMLData ($originalNode, $originalData) | |
| imageSerialNumberRaw () | |
| parseInformationNode ($imageInfoNode) | |
| recreateDOMTree () | |
Internal manager for the eZImage datatype.
Takes care of image conversion and serialization from and to the internal XML format.
Definition at line 47 of file ezimagealiashandler.php.
| eZImageAliasHandler::addImageAlias | ( | $ | imageAlias | ) |
Adds the image alias structure $imageAlias to the content object attribute.
Definition at line 1369 of file ezimagealiashandler.php.
| eZImageAliasHandler::addImageAliases | ( | $ | imageAliasList | ) |
Adds all the new image alias structures in $imageAliasList to the content object attribute.
Definition at line 1351 of file ezimagealiashandler.php.
Referenced by imageAlias().
| eZImageAliasHandler::addImageAliasToXML | ( | $ | domTree, |
| $ | imageAlias | ||
| ) |
Adds the image alias structure $imageAlias to the XML DOM document $domTree.
Definition at line 1381 of file ezimagealiashandler.php.
Referenced by addImageAlias(), addImageAliases(), and recreateDOMTree().
| eZImageAliasHandler::aliasList | ( | ) | [private] |
The first this is called the XML data will be parsed into the internal structures. Subsequent calls will simply return the internal structure.
Definition at line 508 of file ezimagealiashandler.php.
Referenced by directoryPath(), imageAlias(), recreateDOMTree(), removeAliases(), setAttribute(), and updateAliasPath().
| eZImageAliasHandler::attribute | ( | $ | attributeName | ) |
Definition at line 114 of file ezimagealiashandler.php.
Referenced by attributeFromOriginal(), displayText(), imageName(), and imageNameByNode().
| & eZImageAliasHandler::attributeFromOriginal | ( | $ | attributeName | ) |
This is a quick way for extracting information from the 'original' image alias.
Definition at line 132 of file ezimagealiashandler.php.
Referenced by attribute().
| eZImageAliasHandler::attributes | ( | ) |
Lists all available image aliases as attributes as well as:
Definition at line 81 of file ezimagealiashandler.php.
| eZImageAliasHandler::createImageInformationNode | ( | $ | imageNode, |
| $ | mimeData | ||
| ) |
Definition at line 1270 of file ezimagealiashandler.php.
Referenced by generateXMLData(), initialize(), and recreateDOMTree().
| eZImageAliasHandler::createOriginalAttributeXMLData | ( | $ | originalNode, |
| $ | originalData | ||
| ) | [private] |
Creates XML attributes containing information on the original image attribute.
The new attributes will be appended to $originalNode.
Definition at line 873 of file ezimagealiashandler.php.
Referenced by initialize(), recreateDOMTree(), and setOriginalAttributeData().
| eZImageAliasHandler::directoryPath | ( | ) |
Definition at line 246 of file ezimagealiashandler.php.
| eZImageAliasHandler::displayText | ( | $ | alternativeText = null | ) |
The text string will either contain the alternative text from the attribute or the parameter $alternativeText if it is set.
Definition at line 233 of file ezimagealiashandler.php.
Referenced by aliasList(), imageAlias(), and setAttribute().
| eZImageAliasHandler::domTree | ( | ) |
Definition at line 953 of file ezimagealiashandler.php.
Referenced by addImageAlias(), addImageAliases(), setOriginalAttributeData(), and store().
| eZImageAliasHandler::eZImageAliasHandler | ( | $ | contentObjectAttribute | ) |
Creates the handler and creates a reference to the contentobject attribute that created it.
Definition at line 52 of file ezimagealiashandler.php.
| eZImageAliasHandler::generateXMLData | ( | ) |
Creates default information.
Definition at line 1623 of file ezimagealiashandler.php.
Referenced by aliasList(), and domTree().
| eZImageAliasHandler::hasAttribute | ( | $ | attributeName | ) |
Definition at line 96 of file ezimagealiashandler.php.
| eZImageAliasHandler::httpFile | ( | $ | release = false | ) |
Returns the stored HTTP file object or false if no object is stored.
| bool | $release | Erase the content of the stored HTTP file |
Definition at line 1079 of file ezimagealiashandler.php.
| eZImageAliasHandler::imageAlias | ( | $ | aliasName | ) |
This will create the image alias if it does not exist yet, this can involve running image operations to for instance scale the image.
Definition at line 415 of file ezimagealiashandler.php.
Referenced by attribute().
| eZImageAliasHandler::imageName | ( | $ | contentObjectAttribute, |
| $ | contentVersion, | ||
| $ | language = false |
||
| ) |
The image name will generated from the name of the current version. If this is empty it will use the object name or the alternative text.
This ensures that the image has a name which corresponds to the object it belongs to.
The normalization ensures that the name only contains filename and URL friendly characters.
Definition at line 266 of file ezimagealiashandler.php.
Referenced by initializeFromFile(), and initializeFromHTTPFile().
| eZImageAliasHandler::imageNameByNode | ( | $ | contentObjectAttribute, |
| $ | mainNode, | ||
| $ | language = false |
||
| ) |
Similar to imageName() but fetches name information from the node $mainNode.
The normalization ensures that the name only contains filename and URL friendly characters.
Definition at line 305 of file ezimagealiashandler.php.
| eZImageAliasHandler::imagePath | ( | $ | contentObjectAttribute, |
| $ | contentVersion, | ||
| $ | isImageOwner = null |
||
| ) |
The path is calculated by using information from the current object and version. If the object is in the node tree it will contain a path that matches the node path, if not it will be placed in the versioned storage repository.
Definition at line 338 of file ezimagealiashandler.php.
Referenced by initializeFromFile(), and initializeFromHTTPFile().
| eZImageAliasHandler::imagePathByNode | ( | $ | contentObjectAttribute, |
| $ | mainNode | ||
| ) |
Similar to imagePath() but fetches name information from the node $mainNode.
Definition at line 388 of file ezimagealiashandler.php.
| eZImageAliasHandler::imageSerialNumber | ( | ) |
The serial number is used to create unique filenames for uploaded images, it will be increased each time an image is uploaded.
Definition at line 201 of file ezimagealiashandler.php.
Referenced by imageName(), initialize(), and recreateDOMTree().
| eZImageAliasHandler::imageSerialNumberRaw | ( | ) | [private] |
It will check if a serial number exists and return that, if not a new one will be created and returned.
Definition at line 1613 of file ezimagealiashandler.php.
Referenced by imageSerialNumber(), and increaseImageSerialNumber().
| eZImageAliasHandler::increaseImageSerialNumber | ( | ) |
Increases the serial by one.
Definition at line 214 of file ezimagealiashandler.php.
Referenced by initializeFromFile(), and initializeFromHTTPFile().
| eZImageAliasHandler::initialize | ( | $ | mimeData, |
| $ | originalFilename, | ||
| $ | imageAltText = false |
||
| ) |
Makes sure the attribute contains the image file mentioned in $mimeData. This involves removing any previous image (and image aliases), increasing the image name counter, figuring out the image size and creating the internal XML structure.
true on success. Definition at line 1188 of file ezimagealiashandler.php.
Referenced by initializeFromFile(), and initializeFromHTTPFile().
| eZImageAliasHandler::initializeFromFile | ( | $ | filename, |
| $ | imageAltText = false, |
||
| $ | originalFilename = false |
||
| ) |
Initializes the content object attribute $contentObjectAttribute with the filename $filename. Optionally you may also specify the alternative text in the parameter $imageAltText.
Definition at line 1139 of file ezimagealiashandler.php.
| eZImageAliasHandler::initializeFromHTTPFile | ( | $ | httpFile, |
| $ | imageAltText = false |
||
| ) |
Initializes the content object attribute with the uploaded HTTP file.
| eZHTTPFile | $httpFile | |
| string | $imageAltText | Optional image ALT text |
Definition at line 1102 of file ezimagealiashandler.php.
| eZImageAliasHandler::isImageOwner | ( | ) |
true if this is considered to be owner of the image.It will be considered an owner if attribute data is not a copy of another attribute. For instance each time a new image is uploaded this will return true.
Definition at line 181 of file ezimagealiashandler.php.
Referenced by imagePath(), removeAliases(), and updateAliasPath().
| eZImageAliasHandler::isStorageRequired | ( | ) |
true if the image alias handler is required to store it's contents. Definition at line 1507 of file ezimagealiashandler.php.
| eZImageAliasHandler::normalizeImageName | ( | $ | imageName | ) | [static] |
Normalized the image name $imageName by removing all characters that are not considered filename or URL friendly. The filename will also be in non-capital letters.
Definition at line 1048 of file ezimagealiashandler.php.
Referenced by imageName(), and imageNameByNode().
| eZImageAliasHandler::originalAttributeData | ( | ) |
This will only contain data if the attribute is a copy of another attribute, e.g in the case of a new version without an new image upload.
Definition at line 1530 of file ezimagealiashandler.php.
Referenced by imagePath(), imagePathByNode(), initialize(), isImageOwner(), and recreateDOMTree().
| eZImageAliasHandler::parseInformationNode | ( | $ | imageInfoNode | ) | [private] |
Parses the information node and generates the internal information structures.
The information node contains information from the image itself, for instance EXIF data from a JPEG or TIFF image.
| $imageInfoNode |
Definition at line 987 of file ezimagealiashandler.php.
Referenced by aliasList().
| eZImageAliasHandler::recreateDOMTree | ( | ) | [private] |
Recreates the DOM tree from the internal array structures and stores the DOM tree in the 'data_text' field of the attribute.
Definition at line 885 of file ezimagealiashandler.php.
Referenced by setAttribute(), and updateAliasPath().
| eZImageAliasHandler::removeAliases | ( | $ | contentObjectAttribute | ) |
Removes all the image aliases and their information.
The stored images will also be removed if the attribute is the owner of the images.
After the images are removed the attribute will containe an internal structure with empty data
| eZContentObjectAttribute | $contentObjectAttribute | Content object attribute to remove aliases for |
Definition at line 716 of file ezimagealiashandler.php.
Referenced by initializeFromFile(), and initializeFromHTTPFile().
| static eZImageAliasHandler::removeAllAliases | ( | $ | contentObjectAttribute | ) | [static] |
Removes all image alias files which the attribute refers to.
| eZContentObjectAttribute |
Definition at line 674 of file ezimagealiashandler.php.
Referenced by eZImageType\deleteStoredObjectAttribute().
| eZImageAliasHandler::resetImageSerialNumber | ( | ) |
Resets the serial number to zero.
Definition at line 222 of file ezimagealiashandler.php.
Referenced by updateAliasPath().
| eZImageAliasHandler::setAliasAttribute | ( | $ | aliasName, |
| $ | attributeName, | ||
| $ | value | ||
| ) | [protected] |
Set alias value.
| aliasName | alias name |
| attributeName | attribute name |
| value | attribute value |
Definition at line 496 of file ezimagealiashandler.php.
Referenced by addImageAliases(), and setAttribute().
| eZImageAliasHandler::setAliasList | ( | $ | aliasList | ) | [protected] |
Set alias list. Set alias list to current object
| aliasList | alias list |
Definition at line 473 of file ezimagealiashandler.php.
Referenced by aliasList(), imageAlias(), and initialize().
| eZImageAliasHandler::setAliasVariation | ( | $ | aliasName, |
| $ | variation | ||
| ) | [protected] |
Definition at line 484 of file ezimagealiashandler.php.
Referenced by updateAliasPath().
| eZImageAliasHandler::setAttribute | ( | $ | attributeName, |
| $ | attributeValue | ||
| ) |
Sets the attribute named $attributeName to have the value $attributeValue.
The following attributes can be set:
Definition at line 148 of file ezimagealiashandler.php.
| eZImageAliasHandler::setDOMTree | ( | $ | domTree | ) |
Sets the XML DOM document $domTree as the current DOM document.
Definition at line 1431 of file ezimagealiashandler.php.
Referenced by initialize(), recreateDOMTree(), and setOriginalAttributeDataFromAttribute().
| eZImageAliasHandler::setHTTPFile | ( | $ | httpFile | ) |
Sets the uploaded HTTP file object to $httpFile.
This object is used to store information about the image file until the content object attribute is to be stored.
| mixed | $httpFile |
Definition at line 1067 of file ezimagealiashandler.php.
| eZImageAliasHandler::setImageSerialNumber | ( | $ | val | ) |
Set internal serial number
| val | value |
Definition at line 1602 of file ezimagealiashandler.php.
Referenced by aliasList(), increaseImageSerialNumber(), and resetImageSerialNumber().
| eZImageAliasHandler::setOriginalAttributeData | ( | $ | originalData | ) |
Sets the information on which attribute the data was fetched from. See eZImageAliasHandler::originalAttributeData() for more information.
Definition at line 1547 of file ezimagealiashandler.php.
Referenced by aliasList(), originalAttributeData(), setOriginalAttributeDataFromAttribute(), and setOriginalAttributeDataValues().
| eZImageAliasHandler::setOriginalAttributeDataFromAttribute | ( | $ | contentObjectAttribute | ) |
Sets the information on which attribute the data was fetched from.
Fetches data from the contentobject attribute $contentObjectAttribute and sets it using setOriginalAttributeData().
Definition at line 1566 of file ezimagealiashandler.php.
| eZImageAliasHandler::setOriginalAttributeDataValues | ( | $ | attributeID, |
| $ | attributeVersion, | ||
| $ | attributeLanguage | ||
| ) |
Sets the information on which attribute the data was fetched from.
Fetches data from the parameters and sets it using setOriginalAttributeData().
Definition at line 1590 of file ezimagealiashandler.php.
Referenced by initialize(), initializeFromFile(), initializeFromHTTPFile(), and setOriginalAttributeDataFromAttribute().
| eZImageAliasHandler::setStorageRequired | ( | $ | require = true | ) |
Sets whether storage of the image alias data is required or not.
Definition at line 1518 of file ezimagealiashandler.php.
Referenced by setAttribute(), store(), and updateAliasPath().
| eZImageAliasHandler::store | ( | $ | contentObjectAttribute | ) |
Stores the data in the image alias handler to the content object attribute.
Definition at line 1481 of file ezimagealiashandler.php.
| eZImageAliasHandler::storeDOMTree | ( | $ | domTree, |
| $ | storeAttribute, | ||
| $ | contentObjectAttributeRef | ||
| ) |
Stores the XML DOM document $domTree to the content object attribute.
Definition at line 1440 of file ezimagealiashandler.php.
Referenced by addImageAlias(), addImageAliases(), generateXMLData(), removeAliases(), and store().
| eZImageAliasHandler::updateAliasPath | ( | $ | dirpath, |
| $ | name | ||
| ) |
Will update the path for images to point to the new path $dirpath and filename $name.
This is usually called when the object contain the image attribute is moved in the tree.
Definition at line 820 of file ezimagealiashandler.php.
| eZImageAliasHandler::$ContentObjectAttribute |
Deprecated. Contains a reference to the object attribute.
Definition at line 1661 of file ezimagealiashandler.php.
| eZImageAliasHandler::$ContentObjectAttributeData |
Contains a some eZContentObjectAttribute's attributes.
Definition at line 1659 of file ezimagealiashandler.php.