|
eZ Publish
[trunk]
|
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 () | |
| purgeAllAliases (eZContentObjectAttribute $contentObjectAttribute) | |
| Removes the images alias while keeping the original image. | |
| 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 ($checkValidity=true) | |
| 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 27 of file ezimagealiashandler.php.
| eZImageAliasHandler::addImageAlias | ( | $ | imageAlias | ) |
Adds the image alias structure $imageAlias to the content object attribute.
Definition at line 1391 of file ezimagealiashandler.php.
| eZImageAliasHandler::addImageAliases | ( | $ | imageAliasList | ) |
Adds all the new image alias structures in $imageAliasList to the content object attribute.
Definition at line 1373 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 1403 of file ezimagealiashandler.php.
Referenced by addImageAlias(), addImageAliases(), and recreateDOMTree().
| eZImageAliasHandler::aliasList | ( | $ | checkValidity = true | ) | [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 482 of file ezimagealiashandler.php.
Referenced by directoryPath(), imageAlias(), purgeAllAliases(), recreateDOMTree(), removeAliases(), setAttribute(), and updateAliasPath().
| eZImageAliasHandler::attribute | ( | $ | attributeName | ) |
Definition at line 93 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 111 of file ezimagealiashandler.php.
Referenced by attribute().
Lists all available image aliases as attributes as well as:
Definition at line 61 of file ezimagealiashandler.php.
| eZImageAliasHandler::createImageInformationNode | ( | $ | imageNode, |
| $ | mimeData | ||
| ) |
Definition at line 1292 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 884 of file ezimagealiashandler.php.
Referenced by initialize(), recreateDOMTree(), and setOriginalAttributeData().
Definition at line 225 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 212 of file ezimagealiashandler.php.
Referenced by aliasList(), imageAlias(), and setAttribute().
Definition at line 963 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 32 of file ezimagealiashandler.php.
Creates default information.
Definition at line 1644 of file ezimagealiashandler.php.
Referenced by aliasList(), and domTree().
| eZImageAliasHandler::hasAttribute | ( | $ | attributeName | ) |
Definition at line 75 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 1089 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 394 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 245 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 284 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 317 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 367 of file ezimagealiashandler.php.
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 180 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 1634 of file ezimagealiashandler.php.
Referenced by imageSerialNumber(), and increaseImageSerialNumber().
Increases the serial by one.
Definition at line 193 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 1211 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 1149 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 1112 of file ezimagealiashandler.php.
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 160 of file ezimagealiashandler.php.
Referenced by imagePath(), removeAliases(), and updateAliasPath().
true if the image alias handler is required to store it's contents. Definition at line 1529 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 1058 of file ezimagealiashandler.php.
Referenced by imageName(), and imageNameByNode().
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 1552 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 997 of file ezimagealiashandler.php.
Referenced by aliasList().
| eZImageAliasHandler::purgeAllAliases | ( | eZContentObjectAttribute $ | contentObjectAttribute | ) |
Removes the images alias while keeping the original image.
| eZContentObjectAttribute | $contentObjectAttribute |
Definition at line 682 of file ezimagealiashandler.php.
| 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 896 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 728 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 648 of file ezimagealiashandler.php.
Referenced by eZImageType\deleteStoredObjectAttribute().
Resets the serial number to zero.
Definition at line 201 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 470 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 447 of file ezimagealiashandler.php.
Referenced by aliasList(), imageAlias(), and initialize().
| eZImageAliasHandler::setAliasVariation | ( | $ | aliasName, |
| $ | variation | ||
| ) | [protected] |
Definition at line 458 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 127 of file ezimagealiashandler.php.
| eZImageAliasHandler::setDOMTree | ( | $ | domTree | ) |
Sets the XML DOM document $domTree as the current DOM document.
Definition at line 1453 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 1077 of file ezimagealiashandler.php.
Set internal serial number
| val | value |
Definition at line 1623 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 1569 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 1588 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 1611 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 1540 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 1503 of file ezimagealiashandler.php.
| eZImageAliasHandler::storeDOMTree | ( | $ | domTree, |
| $ | storeAttribute, | ||
| $ | contentObjectAttributeRef | ||
| ) |
Stores the XML DOM document $domTree to the content object attribute.
Definition at line 1462 of file ezimagealiashandler.php.
Referenced by addImageAlias(), addImageAliases(), generateXMLData(), purgeAllAliases(), 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 831 of file ezimagealiashandler.php.
| eZImageAliasHandler::$ContentObjectAttribute |
Deprecated. Contains a reference to the object attribute.
Definition at line 1681 of file ezimagealiashandler.php.
| eZImageAliasHandler::$ContentObjectAttributeData |
Contains a some eZContentObjectAttribute's attributes.
Definition at line 1679 of file ezimagealiashandler.php.