Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezimagetype.php
Go to the documentation of this file.
1 <?php
20 class eZImageType extends eZDataType
21 {
22 const FILESIZE_FIELD = 'data_int1';
23 const FILESIZE_VARIABLE = '_ezimage_max_filesize_';
24 const DATA_TYPE_STRING = "ezimage";
25
26 public function __construct()
27 {
28 parent::__construct( self::DATA_TYPE_STRING, ezpI18n::tr( 'kernel/classes/datatypes', "Image", 'Datatype name' ),
29 array( 'serialize_supported' => true ) );
30 $this->FileExtensionBlackListValidator = new eZFileExtensionBlackListValidator();
31 }
32
33 function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
34 {
35 if ( $currentVersion != false )
36 {
37 $dataText = $originalContentObjectAttribute->attribute( "data_text" );
38 $contentObjectAttribute->setAttribute( "data_text", $dataText );
39 }
40 }
41
46 function trashStoredObjectAttribute( $contentObjectAttribute, $version = null )
47 {
48 $imageHandler = $contentObjectAttribute->attribute( "content" );
49 $originalAlias = $imageHandler->imageAlias( "original" );
50
51 // check if there is an actual image, 'is_valid' says if there is an image or not
52 if ( $originalAlias['is_valid'] != '1' && empty( $originalAlias['filename'] ) )
53 {
54 return;
55 }
56
57 $basenameHashed = md5( $originalAlias["basename"] );
58 $trashedFolder = "{$originalAlias["dirpath"]}/trashed";
59 $imageHandler->updateAliasPath( $trashedFolder, $basenameHashed );
60 if ( $imageHandler->isStorageRequired() )
61 {
62 $imageHandler->store( $contentObjectAttribute );
63 $contentObjectAttribute->store();
64 }
65
66 // Now clean all other aliases, not cleanly registered within the attribute content
67 // First get all remaining aliases full path to then safely move them to the trashed folder
68 ezpEvent::getInstance()->notify( 'image/trashAliases', array( $originalAlias['url'] ) );
69 $aliasNames = array_keys( $imageHandler->aliasList() );
70 $aliasesPath = array();
71 foreach ( $aliasNames as $aliasName )
72 {
73 if ( $aliasName === "original" )
74 {
75 continue;
76 }
77
78 $aliasesPath[] = "{$originalAlias["dirpath"]}/{$originalAlias["basename"]}_{$aliasName}.{$originalAlias["suffix"]}";
79 }
80
81 if( empty( $aliasesPath ) )
82 {
83 return;
84 }
85 $conds = array(
86 "contentobject_attribute_id" => $contentObjectAttribute->attribute( "id" ),
87 "filepath" => array( $aliasesPath )
88 );
89 $remainingAliases = eZPersistentObject::fetchObjectList(
90 eZImageFile::definition(), null,
91 $conds
92 );
93 unset( $conds, $remainingAliasesPath );
94
95 if ( !empty( $remainingAliases ) )
96 {
97 foreach ( $remainingAliases as $remainingAlias )
98 {
99 $filename = basename( $remainingAlias->attribute( "filepath" ) );
100 $newFilePath = $trashedFolder . "/" . $basenameHashed . substr( $filename, strrpos( $filename, '_' ) );
101 eZClusterFileHandler::instance( $remainingAlias->attribute( "filepath" ) )->move( $newFilePath );
102
103 // $newFilePath might have already been processed in eZImageFile
104 // If so, $remainingAlias is a duplicate. We can then remove it safely
105 $imageFile = eZImageFile::fetchByFilepath( false, $newFilePath, false );
106 if ( empty( $imageFile ) )
107 {
108 $remainingAlias->setAttribute( "filepath", $newFilePath );
109 $remainingAlias->store();
110 }
111 else
112 {
113 $remainingAlias->remove();
114 }
115 }
116 }
117 }
118
119 public function restoreTrashedObjectAttribute( $contentObjectAttribute )
120 {
121 $imageHandler = $contentObjectAttribute->attribute( "content" );
122 $originalAlias = $imageHandler->imageAlias( "original" );
123 $originalPath = str_replace( "/trashed", "", $originalAlias["dirpath"]);
124 $originalName = $imageHandler->imageName( $contentObjectAttribute, $contentObjectAttribute->objectVersion() );
125 $imageHandler->updateAliasPath( $originalPath, $originalName );
126
127 if ( $imageHandler->isStorageRequired() )
128 {
129 $imageHandler->store( $contentObjectAttribute );
130 $contentObjectAttribute->store();
131 }
132
133 // Now clean all other aliases, not cleanly registered within the attribute content
134 // First get all remaining aliases full path to then safely remove them
135 $aliasNames = array_keys( $imageHandler->aliasList() );
136 $aliasesPath = array();
137 foreach ( $aliasNames as $aliasName )
138 {
139 if ( $aliasName === "original" )
140 {
141 continue;
142 }
143
144 $aliasesPath[] = "{$originalAlias["dirpath"]}/{$originalAlias["basename"]}_{$aliasName}.{$originalAlias["suffix"]}";
145 }
146
147 if( empty( $aliasesPath ) )
148 {
149 return;
150 }
151 $conds = array(
152 "contentobject_attribute_id" => $contentObjectAttribute->attribute( "id" ),
153 "filepath" => array( $aliasesPath )
154 );
155 $remainingAliases = eZPersistentObject::fetchObjectList(
156 eZImageFile::definition(), null,
157 $conds
158 );
159 unset( $conds, $remainingAliasesPath );
160
161 if ( !empty( $remainingAliases ) )
162 {
163 foreach ( $remainingAliases as $remainingAlias )
164 {
165 $filename = basename( $remainingAlias->attribute( "filepath" ) );
166 $newFilePath = $originalPath . "/" . $originalName . substr( $filename, strrpos( $filename, '_' ) );
167 eZClusterFileHandler::instance( $remainingAlias->attribute( "filepath" ) )->move( $newFilePath );
168
169 // $newFilePath might have already been processed in eZImageFile
170 // If so, $remainingAlias is a duplicate. We can then remove it safely
171 $imageFile = eZImageFile::fetchByFilepath( false, $newFilePath, false );
172 if ( empty( $imageFile ) )
173 {
174 $remainingAlias->setAttribute( "filepath", $newFilePath );
175 $remainingAlias->store();
176 }
177 else
178 {
179 $remainingAlias->remove();
180 }
181 }
182 }
183 }
184
185 function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null )
186 {
188 $imageHandler = $contentObjectAttribute->attribute( 'content' );
189 if ( $imageHandler )
190 {
191 $imageHandler->setAttribute( 'alternative_text', false );
192 $imageHandler->removeAliases();
193 $imageHandler->store( $contentObjectAttribute );
194 $contentObjectAttribute->setContent( null );
195 }
196 }
197
207 function validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
208 {
209 $classAttribute = $contentObjectAttribute->contentClassAttribute();
210 $httpFileName = $base . "_data_imagename_" . $contentObjectAttribute->attribute( "id" );
211 $maxSize = 1024 * 1024 * $classAttribute->attribute( self::FILESIZE_FIELD );
212 $mustUpload = false;
213
214 $tmpImgObj = $contentObjectAttribute->attribute( 'content' );
215 $original = $tmpImgObj->attribute( 'original' );
216 if( $contentObjectAttribute->validateIsRequired() )
217 {
218 if ( !$original['is_valid'] )
219 {
220 $mustUpload = true;
221 }
222 }
223
224 $extensionsBlackList = implode(', ', $this->FileExtensionBlackListValidator->extensionsBlackList() );
225 $state = $this->FileExtensionBlackListValidator->validate( $original['filename'] );
226 if ( $state === eZInputValidator::STATE_INVALID || $state === eZInputValidator::STATE_INTERMEDIATE )
227 {
228 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
229 "A valid file is required. The following file extensions are blacklisted: $extensionsBlackList" ) );
230 return eZInputValidator::STATE_INVALID;
231 }
232
233 $canFetchResult = eZHTTPFile::canFetch( $httpFileName, $maxSize );
234 if ( isset( $_FILES[$httpFileName] ) and $_FILES[$httpFileName]["tmp_name"] != "" )
235 {
236 $imagefile = $_FILES[$httpFileName]['tmp_name'];
237 if ( !$_FILES[$httpFileName]["size"] )
238 {
239 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
240 'The image file must have non-zero size.' ) );
241 return eZInputValidator::STATE_INVALID;
242 }
243
244 $state = $this->FileExtensionBlackListValidator->validate( $_FILES[$httpFileName]['name'] );
245 if ( $state === eZInputValidator::STATE_INVALID || $state === eZInputValidator::STATE_INTERMEDIATE )
246 {
247 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
248 "A valid file is required. The following file extensions are on the blacklist: $extensionsBlackList" ) );
249 return eZInputValidator::STATE_INVALID;
250 }
251
252 if ( !self::validateImageFileExtension( $_FILES[$httpFileName]['name'] ) )
253 {
254 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
255 'A valid image file is required.' ) );
256 return eZInputValidator::STATE_INVALID;
257 }
258 }
259 if ( $mustUpload && $canFetchResult == eZHTTPFile::UPLOADEDFILE_DOES_NOT_EXIST )
260 {
261 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
262 'A valid image file is required.' ) );
263 return eZInputValidator::STATE_INVALID;
264 }
265 if ( $canFetchResult == eZHTTPFile::UPLOADEDFILE_EXCEEDS_PHP_LIMIT )
266 {
267 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
268 'The size of the uploaded image exceeds limit set by upload_max_filesize directive in php.ini. Please contact the site administrator.' ) );
269 return eZInputValidator::STATE_INVALID;
270 }
271 if ( $canFetchResult == eZHTTPFile::UPLOADEDFILE_EXCEEDS_MAX_SIZE )
272 {
273 $contentObjectAttribute->setValidationError( ezpI18n::tr( 'kernel/classes/datatypes',
274 'The size of the uploaded file exceeds the limit set for this site: %1 bytes.' ), $maxSize );
275 return eZInputValidator::STATE_INVALID;
276 }
277 return eZInputValidator::STATE_ACCEPTED;
278 }
279
280 private static function validateImageFileExtension($filename)
281 {
282 $mimeType = eZMimeType::findByURL( $filename );
283 $nameMimeType = $mimeType['name'];
284 $nameMimeTypes = explode('/', $nameMimeType);
285
286 return $nameMimeTypes[0] === 'image';
287 }
288
298 function fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute )
299 {
300 $result = false;
301 $imageAltText = false;
302 $hasImageAltText = false;
303 if ( $http->hasPostVariable( $base . "_data_imagealttext_" . $contentObjectAttribute->attribute( "id" ) ) )
304 {
305 $imageAltText = $http->postVariable( $base . "_data_imagealttext_" . $contentObjectAttribute->attribute( "id" ) );
306 $hasImageAltText = true;
307 }
308
309 $content = $contentObjectAttribute->attribute( 'content' );
310 $httpFileName = $base . "_data_imagename_" . $contentObjectAttribute->attribute( "id" );
311
312 if ( eZHTTPFile::canFetch( $httpFileName ) )
313 {
314 $httpFile = eZHTTPFile::fetch( $httpFileName );
315 if ( $httpFile )
316 {
317 if ( $content )
318 {
319 $content->setHTTPFile( $httpFile );
320 $result = true;
321 }
322 }
323
324 }
325
326 if ( $content )
327 {
328 if ( $hasImageAltText )
329 $content->setAttribute( 'alternative_text', $imageAltText );
330 $result = true;
331 }
332
333 return $result;
334 }
335
336 function storeObjectAttribute( $contentObjectAttribute )
337 {
338 $imageHandler = $contentObjectAttribute->attribute( 'content' );
339 if ( $imageHandler )
340 {
341 $httpFile = $imageHandler->httpFile( true );
342 if ( $httpFile && self::validateImageFileExtension( $httpFile->attribute( 'original_filename' ) ) )
343 {
344 $imageAltText = $imageHandler->attribute( 'alternative_text' );
345
346 $imageHandler->initializeFromHTTPFile( $httpFile, $imageAltText );
347 }
348 if ( $imageHandler->isStorageRequired() )
349 {
350 $imageHandler->store( $contentObjectAttribute );
351 }
352 }
353 }
354
358 function isHTTPFileInsertionSupported()
359 {
360 return true;
361 }
362
366 function isRegularFileInsertionSupported()
367 {
368 return true;
369 }
370
374 function insertHTTPFile( $object, $objectVersion, $objectLanguage,
375 $objectAttribute, $httpFile, $mimeData,
376 &$result )
377 {
378 $result = array( 'errors' => array(),
379 'require_storage' => false );
380
381 $handler = $objectAttribute->content();
382 if ( !$handler )
383 {
384 $result['errors'][] = array( 'description' => ezpI18n::tr( 'kernel/classes/datatypes/ezimage',
385 'Failed to fetch Image Handler. Please contact the site administrator.' ) );
386 return false;
387 }
388
389 $status = $handler->initializeFromHTTPFile( $httpFile );
390 $result['require_storage'] = $handler->isStorageRequired();
391 return $status;
392 }
393
397 function insertRegularFile( $object, $objectVersion, $objectLanguage,
398 $objectAttribute, $filePath,
399 &$result )
400 {
401 $result = array( 'errors' => array(),
402 'require_storage' => false );
403
404 $handler = $objectAttribute->content();
405 if ( !$handler )
406 {
407 $result['errors'][] = array( 'description' => ezpI18n::tr( 'kernel/classes/datatypes/ezimage',
408 'Failed to fetch Image Handler. Please contact the site administrator.' ) );
409 return false;
410 }
411
412 $status = $handler->initializeFromFile( $filePath, false, basename( $filePath ) );
413 $result['require_storage'] = $handler->isStorageRequired();
414 return $status;
415 }
416
420 function hasStoredFileInformation( $object, $objectVersion, $objectLanguage,
421 $objectAttribute )
422 {
423 return true;
424 }
425
429 function storedFileInformation( $object, $objectVersion, $objectLanguage,
430 $objectAttribute )
431 {
432 $content = $objectAttribute->content();
433 if ( $content )
434 {
435 $original = $content->attribute( 'original' );
436 $fileName = $original['filename'];
437 $filePath = $original['full_path'];
438 $mimeType = $original['mime_type'];
439 $originalFileName = $original['original_filename'];
440
441 return array( 'filename' => $fileName,
442 'original_filename' => $originalFileName,
443 'filepath' => $filePath,
444 'mime_type' => $mimeType );
445 }
446 return false;
447 }
448
449 function onPublish( $contentObjectAttribute, $contentObject, $publishedNodes )
450 {
451 $hasContent = $contentObjectAttribute->hasContent();
452 if ( $hasContent )
453 {
455 $imageHandler = $contentObjectAttribute->attribute( 'content' );
456 $mainNode = false;
457 foreach ( array_keys( $publishedNodes ) as $publishedNodeKey )
458 {
459 $publishedNode = $publishedNodes[$publishedNodeKey];
460 if ( $publishedNode->attribute( 'is_main' ) )
461 {
462 $mainNode = $publishedNode;
463 break;
464 }
465 }
466 if ( $mainNode )
467 {
468 $dirpath = $imageHandler->imagePathByNode( $contentObjectAttribute, $mainNode );
469 $oldDirpath = $imageHandler->directoryPath();
470 if ( $oldDirpath != $dirpath )
471 {
472 $name = $imageHandler->imageNameByNode( $contentObjectAttribute, $mainNode );
473 $imageHandler->updateAliasPath( $dirpath, $name );
474 }
475 }
476 if ( $imageHandler->isStorageRequired() )
477 {
478 $imageHandler->store( $contentObjectAttribute );
479 $contentObjectAttribute->store();
480 }
481 }
482 }
483
484 function fetchClassAttributeHTTPInput( $http, $base, $classAttribute )
485 {
486 $filesizeName = $base . self::FILESIZE_VARIABLE . $classAttribute->attribute( 'id' );
487 if ( $http->hasPostVariable( $filesizeName ) )
488 {
489 $filesizeValue = $http->postVariable( $filesizeName );
490 $classAttribute->setAttribute( self::FILESIZE_FIELD, $filesizeValue );
491 return true;
492 }
493 return false;
494 }
495
496 function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribute, $parameters )
497 {
498 if( $action == "delete_image" )
499 {
500 $this->deleteStoredObjectAttribute( $contentObjectAttribute );
501 }
502 }
503
510 function title( $contentObjectAttribute, $name = 'original_filename' )
511 {
512 $content = $contentObjectAttribute->content();
513 $original = $content->attribute( 'original' );
514 $value = $original['alternative_text'];
515 if ( trim( $value ) == '' )
516 {
517 if ( array_key_exists( $name, $original ) )
518 $value = $original[$name];
519 else
520 $value = $original['original_filename'];
521 }
522
523 return $value;
524 }
525
526 function hasObjectAttributeContent( $contentObjectAttribute )
527 {
528 $handler = $contentObjectAttribute->content();
529 if ( !$handler )
530 return false;
531 return $handler->attribute( 'is_valid' );
532 }
533
534 function objectAttributeContent( $contentObjectAttribute )
535 {
536 $imageHandler = new eZImageAliasHandler( $contentObjectAttribute );
537
538 return $imageHandler;
539 }
540
541 function metaData( $contentObjectAttribute )
542 {
543 $content = $contentObjectAttribute->content();
544 $original = $content->attribute( 'original' );
545 $value = $original['alternative_text'];
546 return $value;
547 }
548
549 function serializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode )
550 {
551 $maxSize = $classAttribute->attribute( self::FILESIZE_FIELD );
552 $dom = $attributeParametersNode->ownerDocument;
553
554 $maxSizeNode = $dom->createElement( 'max-size' );
555 $maxSizeNode->appendChild( $dom->createTextNode( $maxSize ) );
556 $maxSizeNode->setAttribute( 'unit-size', 'mega' );
557 $attributeParametersNode->appendChild( $maxSizeNode );
558 }
559
560 function unserializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode )
561 {
562 $sizeNode = $attributeParametersNode->getElementsByTagName( 'max-size' )->item( 0 );
563 $maxSize = $sizeNode->textContent;
564 $unitSize = $sizeNode->getAttribute( 'unit-size' );
565 $classAttribute->setAttribute( self::FILESIZE_FIELD, $maxSize );
566 }
567
568
572 function serializeContentObjectAttribute( $package, $objectAttribute )
573 {
574 $node = $this->createContentObjectAttributeDOMNode( $objectAttribute );
575
576 $content = $objectAttribute->content();
577 $original = $content->attribute( 'original' );
578
579 if ( $original['url'] )
580 {
581 $imageKey = md5( mt_rand() );
582
583 $package->appendSimpleFile( $imageKey, $original['url'] );
584 $node->setAttribute( 'image-file-key', $imageKey );
585 }
586
587 $node->setAttribute( 'alternative-text', $original['alternative_text'] );
588
589 return $node;
590 }
591
592 function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
593 {
594 // Remove all existing image data for the case this is a translated attribute,
595 // so initial language's image alias will not be removed in 'initializeFromFile'
596 $objectAttribute->setAttribute( 'data_text', '' );
597
598 $alternativeText = $attributeNode->getAttribute( 'alternative-text' );
599 // Backwards compatibility with older node name
600 if ( $alternativeText === false )
601 $alternativeText = $attributeNode->getAttribute( 'alternativ-text' );
602 $content = $objectAttribute->attribute( 'content' );
603 $imageFileKey = $attributeNode->getAttribute( 'image-file-key' );
604 if ( $imageFileKey )
605 {
606 $content->initializeFromFile( $package->simpleFilePath( $imageFileKey ), $alternativeText );
607 }
608 else
609 {
610 $content->setAttribute( 'alternative_text', $alternativeText );
611 }
612 $content->store( $objectAttribute );
613 }
614
619 function toString( $objectAttribute )
620 {
621 $content = $objectAttribute->content();
622 $original = $content->attribute( 'original' );
623 $alternativeText = $content->attribute( 'alternative_text' );
624 return $original['url'] . '|' . $alternativeText;
625 }
626
627 function fromString( $objectAttribute, $string )
628 {
629 $delimiterPos = strpos( $string, '|' );
630
632 $content = $objectAttribute->attribute( 'content' );
633 if ( $delimiterPos === false )
634 {
635 $content->initializeFromFile( $string, '' );
636 }
637 else
638 {
639 $content->initializeFromFile( substr( $string, 0, $delimiterPos ), '' );
640 $content->setAttribute( 'alternative_text', substr( $string, $delimiterPos + 1 ) );
641 }
642 $content->store( $objectAttribute );
643 return true;
644 }
645
646 function supportsBatchInitializeObjectAttribute()
647 {
648 return true;
649 }
650
655 function postStore( $objectAttribute )
656 {
657 $objectAttributeId = $objectAttribute->attribute( "id" );
658
659 if ( ( $doc = simplexml_load_string( $objectAttribute->attribute( "data_text" ) ) ) === false )
660 return;
661
662 // Creates ezimagefile entries
663 foreach ( $doc->xpath( "//*/@url" ) as $url )
664 {
665 $url = (string)$url;
666
667 if ( $url === "" )
668 continue;
669
670 eZImageFile::appendFilepath( $objectAttributeId, $url, true );
671 }
672 }
673
676 private $FileExtensionBlackListValidator;
677 }
678
679 eZDataType::register( eZImageType::DATA_TYPE_STRING, "eZImageType" );
680
681 ?>
eZClusterFileHandler\instance
static instance( $filename=false)
Definition: ezclusterfilehandler.php:21
eZDataType
Base class for content datatypes.
Definition: ezdatatype.php:46
eZDataType\deleteStoredObjectAttribute
deleteStoredObjectAttribute( $objectAttribute, $version=null)
Definition: ezdatatype.php:956
eZDataType\fromString
fromString( $objectAttribute, $string)
Definition: ezdatatype.php:1134
eZDataType\register
static register( $dataTypeString, $className)
Definition: ezdatatype.php:203
eZDataType\onPublish
onPublish( $contentObjectAttribute, $contentObject, $publishedNodes)
Definition: ezdatatype.php:646
eZDataType\createContentObjectAttributeDOMNode
createContentObjectAttributeDOMNode( $objectAttribute)
Definition: ezdatatype.php:1371
eZFileExtensionBlackListValidator
The class eZFileExtensionBlackListValidator validates file extensions based on a blacklist.
Definition: ezfileextensionblacklistvalidator.php:17
eZHTTPFile\UPLOADEDFILE_EXCEEDS_MAX_SIZE
const UPLOADEDFILE_EXCEEDS_MAX_SIZE
Definition: ezhttpfile.php:27
eZHTTPFile\canFetch
static canFetch( $httpName, $maxSize=false)
Definition: ezhttpfile.php:203
eZHTTPFile\fetch
static fetch( $http_name)
Definition: ezhttpfile.php:269
eZHTTPFile\UPLOADEDFILE_EXCEEDS_PHP_LIMIT
const UPLOADEDFILE_EXCEEDS_PHP_LIMIT
Definition: ezhttpfile.php:26
eZHTTPFile\UPLOADEDFILE_DOES_NOT_EXIST
const UPLOADEDFILE_DOES_NOT_EXIST
Definition: ezhttpfile.php:25
eZImageAliasHandler
Internal manager for the eZImage datatype.
Definition: ezimagealiashandler.php:28
eZImageFile\appendFilepath
static appendFilepath( $contentObjectAttributeID, $filepath, $ignoreUnique=false)
Definition: ezimagefile.php:184
eZImageFile\fetchByFilepath
static fetchByFilepath( $contentObjectAttributeID, $filepath, $asObject=true)
Definition: ezimagefile.php:136
eZImageFile\definition
static definition()
Definition: ezimagefile.php:20
eZImageType
The class eZImageType handles image accounts and association with content objects.
Definition: ezimagetype.php:21
eZImageType\insertRegularFile
insertRegularFile( $object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
Definition: ezimagetype.php:397
eZImageType\DATA_TYPE_STRING
const DATA_TYPE_STRING
Definition: ezimagetype.php:24
eZImageType\serializeContentClassAttribute
serializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode)
Definition: ezimagetype.php:549
eZImageType\fetchClassAttributeHTTPInput
fetchClassAttributeHTTPInput( $http, $base, $classAttribute)
Definition: ezimagetype.php:484
eZImageType\fetchObjectAttributeHTTPInput
fetchObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute)
Definition: ezimagetype.php:298
eZImageType\validateImageFileExtension
static validateImageFileExtension($filename)
Definition: ezimagetype.php:280
eZImageType\isRegularFileInsertionSupported
isRegularFileInsertionSupported()
Definition: ezimagetype.php:366
eZImageType\validateObjectAttributeHTTPInput
validateObjectAttributeHTTPInput( $http, $base, $contentObjectAttribute)
Definition: ezimagetype.php:207
eZImageType\FILESIZE_FIELD
const FILESIZE_FIELD
Definition: ezimagetype.php:22
eZImageType\postStore
postStore( $objectAttribute)
Definition: ezimagetype.php:655
eZImageType\insertHTTPFile
insertHTTPFile( $object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
Definition: ezimagetype.php:374
eZImageType\metaData
metaData( $contentObjectAttribute)
Definition: ezimagetype.php:541
eZImageType\isHTTPFileInsertionSupported
isHTTPFileInsertionSupported()
Definition: ezimagetype.php:358
eZImageType\storeObjectAttribute
storeObjectAttribute( $contentObjectAttribute)
Definition: ezimagetype.php:336
eZImageType\FILESIZE_VARIABLE
const FILESIZE_VARIABLE
Definition: ezimagetype.php:23
eZImageType\hasStoredFileInformation
hasStoredFileInformation( $object, $objectVersion, $objectLanguage, $objectAttribute)
Definition: ezimagetype.php:420
eZImageType\toString
toString( $objectAttribute)
Definition: ezimagetype.php:619
eZImageType\__construct
__construct()
Definition: ezimagetype.php:26
eZImageType\serializeContentObjectAttribute
serializeContentObjectAttribute( $package, $objectAttribute)
Definition: ezimagetype.php:572
eZImageType\supportsBatchInitializeObjectAttribute
supportsBatchInitializeObjectAttribute()
Definition: ezimagetype.php:646
eZImageType\title
title( $contentObjectAttribute, $name='original_filename')
Definition: ezimagetype.php:510
eZImageType\customObjectAttributeHTTPAction
customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribute, $parameters)
Definition: ezimagetype.php:496
eZImageType\initializeObjectAttribute
initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
Definition: ezimagetype.php:33
eZImageType\trashStoredObjectAttribute
trashStoredObjectAttribute( $contentObjectAttribute, $version=null)
Definition: ezimagetype.php:46
eZImageType\objectAttributeContent
objectAttributeContent( $contentObjectAttribute)
Definition: ezimagetype.php:534
eZImageType\$FileExtensionBlackListValidator
$FileExtensionBlackListValidator
Definition: ezimagetype.php:676
eZImageType\unserializeContentClassAttribute
unserializeContentClassAttribute( $classAttribute, $attributeNode, $attributeParametersNode)
Definition: ezimagetype.php:560
eZImageType\restoreTrashedObjectAttribute
restoreTrashedObjectAttribute( $contentObjectAttribute)
Definition: ezimagetype.php:119
eZImageType\storedFileInformation
storedFileInformation( $object, $objectVersion, $objectLanguage, $objectAttribute)
Definition: ezimagetype.php:429
eZImageType\unserializeContentObjectAttribute
unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode)
Definition: ezimagetype.php:592
eZImageType\hasObjectAttributeContent
hasObjectAttributeContent( $contentObjectAttribute)
Definition: ezimagetype.php:526
eZInputValidator\STATE_INTERMEDIATE
const STATE_INTERMEDIATE
Definition: ezinputvalidator.php:80
eZInputValidator\STATE_ACCEPTED
const STATE_ACCEPTED
Definition: ezinputvalidator.php:79
eZInputValidator\STATE_INVALID
const STATE_INVALID
Definition: ezinputvalidator.php:81
eZMimeType\findByURL
static findByURL( $url, $returnDefault=true)
Definition: ezmimetype.php:227
eZPersistentObject\fetchObjectList
static fetchObjectList( $def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
Definition: ezpersistentobject.php:806
ezpI18n\tr
static tr( $context, $source, $comment=null, $arguments=null)
Definition: ezpi18n.php:86
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.