Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcontentobjectpackagehandler.php
Go to the documentation of this file.
1 <?php
17 class eZContentObjectPackageHandler extends eZPackageHandler
18 {
19 public $HandlerType;
20 const MAX_LISTED_OBJECTS = 30;
21
22 // If number of objects in the package is bigger than this constant,
23 // they are stored in separate files to prevent memory overflow.
24 // 'null' means always use separate files
25 const STORE_OBJECTS_TO_SEPARATE_FILES_THRESHOLD = 100;
26
27 const INSTALL_OBJECTS_ERROR_RANGE_FROM = 1;
28 const INSTALL_OBJECTS_ERROR_RANGE_TO = 100;
29 const UNINSTALL_OBJECTS_ERROR_RANGE_FROM = 101;
30 const UNINSTALL_OBJECTS_ERROR_RANGE_TO = 200;
31
32 public function __construct()
33 {
34 parent::__construct( 'ezcontentobject', array( 'extract-install-content' => true ) );
35 }
36
40 function fetchObjectFromFile( $objectFileNode )
41 {
42 $fileName = $objectFileNode->getAttribute( 'filename' );
43 $filePath = $this->Package->path() . '/' . $this->contentObjectDirectory() . '/' . $fileName;
44 $dom = $this->Package->fetchDOMFromFile( $filePath );
45
46 if ( $dom )
47 {
48 $objectNode = $dom->documentElement;
49 }
50 else
51 {
52 eZDebug::writeError( "Can't fetch object from package file: $filePath", __METHOD__ );
53 $objectNode = false;
54 }
55
56 return $objectNode;
57 }
58
59 function getRealObjectNode( $objectNode )
60 {
61 if ( $objectNode->localName == 'object' )
62 {
63 $realObjectNode = $objectNode;
64 }
65 else
66 {
67 $realObjectNode = $this->fetchObjectFromFile( $objectNode );
68 }
69 return $realObjectNode;
70 }
71
86 function explainInstallItem( $package, $installItem, $requestedInfo = array() )
87 {
88 $this->Package = $package;
89
90 if ( $installItem['filename'] )
91 {
92 $filename = $installItem['filename'];
93 $subdirectory = $installItem['sub-directory'];
94 if ( $subdirectory )
95 $filepath = $subdirectory . '/' . $filename . '.xml';
96 else
97 $filepath = $filename . '.xml';
98
99 $filepath = $package->path() . '/' . $filepath;
100
101 $dom = $package->fetchDOMFromFile( $filepath );
102
103 if ( !$dom )
104 return null;
105
106 $content = $dom->documentElement;
107 $objectListNode = $content->getElementsByTagName( 'object-list' )->item( 0 );
108 if ( $objectListNode )
109 {
110 $realObjectNodes = $objectListNode->getElementsByTagName( 'object' );
111 }
112 else
113 {
114 // If objects are stored in separate files (new format)
115 $objectListNode = $content->getElementsByTagName( 'object-files-list' )->item( 0 );
116 $objectNodes = $objectListNode->getElementsByTagName( 'object-file' );
117
118 if ( count( $objectNodes ) > self::MAX_LISTED_OBJECTS )
119 {
120 return array( 'description' => ezpI18n::tr( 'kernel/package', '%number content objects', false,
121 array( '%number' => count( $objectNodes ) ) ) );
122 }
123
124 $realObjectNodes = array();
125 foreach( $objectNodes as $objectNode )
126 {
127 $realObjectNode = $this->fetchObjectFromFile( $objectNode );
128 if ( !$realObjectNode )
129 continue;
130
131 $realObjectNodes[] = $realObjectNode;
132 }
133 }
134
135 // create descriptions array
136 $objectNames = array();
137 foreach( $realObjectNodes as $objectNode )
138 {
139 $objectName =
140 $objectNode->getAttribute( 'name' ) .
141 ' (' . $objectNode->getAttributeNS( 'http://ez.no/ezobject', 'class_identifier' ) .')';
142
143 // get info about translations.
144 $languageInfo = array();
145 $versionList = $objectNode->getElementsByTagName( 'version-list' )->item( 0 );
146 $versions = $versionList->getElementsByTagName( 'version' );
147 foreach( $versions as $version )
148 {
149 $versionInfo = $version->getElementsByTagName( 'object-translation' );
150 foreach( $versionInfo as $info )
151 {
152 $languageInfo[] = $info->getAttribute( 'language' );
153 }
154 }
155
156 $objectNames[] = array( 'description' =>
157 ezpI18n::tr( 'kernel/package', 'Content object %objectname', false,
158 array( '%objectname' => $objectName ) ),
159 'language_info' => $languageInfo );
160 }
161 return $objectNames;
162 }
163 }
164
171 function addNode( $nodeID, $isSubtree = true )
172 {
173 $this->RootNodeIDArray[] = $nodeID;
174 $this->NodeIDArray[] = $nodeID;
175
176 if ( $isSubtree )
177 {
178 $nodeArray = eZContentObjectTreeNode::subTreeByNodeID( array( 'AsObject' => false ), $nodeID );
179 foreach( $nodeArray as $node )
180 {
181 $this->NodeIDArray[] = $node['node_id'];
182 }
183 }
184 }
185
192 function generatePackage( $package, $options )
193 {
194 $this->Package = $package;
195 $remoteIDArray = array();
196 $this->NodeIDArray = array_unique( $this->NodeIDArray );
197 foreach( $this->NodeIDArray as $nodeID )
198 {
199 $this->NodeObjectArray[(string)$nodeID] = eZContentObjectTreeNode::fetch( $nodeID );
200 }
201
202 foreach( $this->RootNodeIDArray as $nodeID )
203 {
204 $this->RootNodeObjectArray[(string)$nodeID] = eZContentObjectTreeNode::fetch( $nodeID );
205 }
206
207 $this->generateObjectArray( $options['node_assignment'] );
208
209 $classIDArray = false;
210 if ( $options['include_classes'] )
211 {
212 $remoteIDArray['class'] = array();
213 $classIDArray = $this->generateClassIDArray();
214
215 foreach ( $classIDArray as $classID )
216 {
217 eZContentClassPackageHandler::addClass( $package, $classID );
218 }
219 }
220
221 $dom = new DOMDocument( '1.0', 'utf-8' );
222 $packageRoot = $dom->createElement( 'content-object' );
223 $dom->appendChild( $packageRoot );
224
225 $objectListDOMNode = $this->createObjectListNode( $options );
226 $importedObjectListDOMNode = $dom->importNode( $objectListDOMNode, true );
227 $packageRoot->appendChild( $importedObjectListDOMNode );
228
229 $overrideSettingsArray = false;
230 $templateFilenameArray = false;
231 if ( $options['include_templates'] )
232 {
233 $overrideSettingsListNode = $this->generateOverrideSettingsArray( $options['site_access_array'], $options['minimal_template_set'] );
234 $importedOverrideSettingsListNode = $dom->importNode( $overrideSettingsListNode, true );
235 $packageRoot->appendChild( $importedOverrideSettingsListNode );
236
237 $designTemplateListNode = $this->generateTemplateFilenameArray();
238 $importedDesignTemplateListNode = $dom->importNode( $designTemplateListNode, true );
239 $packageRoot->appendChild( $importedDesignTemplateListNode );
240
241 $fetchAliasListNode = $this->generateFetchAliasArray();
242 $importedFetchAliasListNode = $dom->importNode( $fetchAliasListNode, true );
243 $packageRoot->appendChild( $importedFetchAliasListNode );
244 }
245
246 $siteAccessListDOMNode = $this->createSiteAccessListNode( $options );
247 $importedSiteAccessListDOMNode = $dom->importNode( $siteAccessListDOMNode, true );
248 $packageRoot->appendChild( $importedSiteAccessListDOMNode );
249
250 $topNodeListDOMNode = $this->createTopNodeListDOMNode( $options );
251 $importedTopNodeListDOMNode = $dom->importNode( $topNodeListDOMNode, true );
252 $packageRoot->appendChild( $importedTopNodeListDOMNode );
253
254 //$filename = substr( md5( mt_rand() ), 0, 8 );
255 $filename = 'contentobjects';
256 $this->Package->appendInstall( 'ezcontentobject', false, false, true,
257 $filename, $this->contentObjectDirectory(),
258 array( 'content' => $packageRoot ) );
259 $this->Package->appendInstall( 'ezcontentobject', false, false, false,
260 $filename, $this->contentObjectDirectory(),
261 array( 'content' => false ) );
262 }
263
270 function createTopNodeListDOMNode( $options )
271 {
272 $dom = new DOMDocument( '1.0', 'utf-8' );
273 $topNodeListDOMNode = $dom->createElement( 'top-node-list' );
274 $dom->appendChild( $topNodeListDOMNode );
275
276 foreach( $this->RootNodeObjectArray as $rootNode )
277 {
278 unset( $topNode );
279 $topNode = $dom->createElement( 'top-node' );
280 $topNode->appendChild( $dom->createTextNode( $rootNode->attribute( 'name' ) ) );
281 $topNode->setAttribute( 'node-id', $rootNode->attribute( 'node_id' ) );
282 $topNode->setAttribute( 'remote-id', $rootNode->attribute( 'remote_id' ) );
283 $topNodeListDOMNode->appendChild( $topNode );
284 }
285
286 return $topNodeListDOMNode;
287 }
288
295 function createSiteAccessListNode( $options )
296 {
297 $dom = new DOMDocument( '1.0', 'utf-8' );
298 $siteAccessListDOMNode = $dom->createElement( 'site-access-list' );
299 $dom->appendChild( $siteAccessListDOMNode );
300
301 foreach( $options['site_access_array'] as $siteAccess )
302 {
303 unset( $siteAccessNode );
304 $siteAccessNode = $dom->createElement( 'site-access' );
305 $siteAccessNode->appendChild( $dom->createTextNode( $siteAccess ) );
306 $siteAccessListDOMNode->appendChild( $siteAccessNode );
307 }
308
309 return $siteAccessListDOMNode;
310 }
311
318 function createObjectListNode( $options )
319 {
320 if ( $options['versions'] == 'current' )
321 {
322 $version = true;
323 }
324 else
325 {
326 $version = false;
327 }
328
329 $path = $this->Package->path() . '/' . $this->contentObjectDirectory();
330 if ( !file_exists( $path ) )
331 eZDir::mkdir( $path, false, true );
332
333 $dom = new DOMDocument( '1.0', 'utf-8' );
334
335 // Store objects to separate files or not
336 $storeToMultiple = count( $this->ObjectArray ) >= self::STORE_OBJECTS_TO_SEPARATE_FILES_THRESHOLD ? true : false;
337 if ( $storeToMultiple )
338 $objectListNode = $dom->createElement( 'object-files-list' );
339 else
340 $objectListNode = $dom->createElement( 'object-list' );
341
342 $dom->appendChild( $objectListNode );
343
344 foreach( array_keys( $this->ObjectArray ) as $objectID )
345 {
346 $objectNode = $this->ObjectArray[$objectID]->serialize( $this->Package, $version, $options, $this->NodeObjectArray, $this->RootNodeIDArray );
347
348 if ( $storeToMultiple )
349 {
350 $fileName = 'object-' . $objectNode->getAttribute( 'remote_id' ) . '.xml';
351 $filePath = $path . '/' . $fileName;
352
353 $objectFileNode = $dom->createElement( 'object-file' );
354 $objectFileNode->setAttribute( 'filename', $fileName );
355 $objectListNode->appendChild( $objectFileNode );
356
357 $partDOM = new DOMDocument( '1.0', 'utf-8' );
358 $partDOM->formatOutput = true;
359 $importedObjectNode = $partDOM->importNode( $objectNode, true );
360 $partDOM->appendChild( $importedObjectNode );
361 $this->Package->storeDOM( $filePath, $partDOM );
362 unset( $partDOM );
363 unset( $objectFileNode );
364 }
365 else
366 {
367 $importedObjectNode = $dom->importNode( $objectNode, true );
368 $objectListNode->appendChild( $importedObjectNode );
369 }
370 unset( $objectNode );
371 }
372
373 return $objectListNode;
374 }
375
382 function generateObjectArray( $nodeAssignment )
383 {
384 foreach( $this->NodeObjectArray as $contentNode )
385 {
386 if ( $nodeAssignment == 'main' )
387 {
388 if ( $contentNode->attribute( 'main_node_id' ) == $contentNode->attribute( 'node_id' ) )
389 {
390 $this->ObjectArray[(string)$contentNode->attribute( 'contentobject_id' )] = $contentNode->object();
391 }
392 }
393 else
394 {
395 $this->ObjectArray[(string)$contentNode->attribute( 'contentobject_id' )] = $contentNode->object();
396 }
397 }
398 }
399
403 function &generateFetchAliasArray()
404 {
405 $dom = new DOMDocument( '1.0', 'utf-8' );
406 $fetchAliasListDOMNode = $dom->createElement( 'fetch-alias-list' );
407 $registeredAliases = array();
408
409 foreach( array_keys( $this->TemplateFileArray ) as $siteAccess )
410 {
411 $aliasINI = eZINI::instance( 'fetchalias.ini', 'settings', null, null, true );
412 $aliasINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
413 $aliasINI->loadCache();
414
415 foreach ( $this->TemplateFileArray[$siteAccess] as $filename )
416 {
417 $fp = fopen( $filename, 'r' );
418 if ( !$fp )
419 {
420 eZDebug::writeError( 'Could not open ' . $filename . ' during content object export.', __METHOD__ );
421 continue;
422 }
423
424 $str = fread( $fp, filesize( $filename ) );
425
426 $matchArray = array();
427 preg_match_all( "#.*fetch_alias\‍([ ]*([a-zA-Z0-9_]+)[ |,|)]+.*#U", $str, $matchArray, PREG_PATTERN_ORDER );
428
429 foreach( $matchArray[1] as $fetchAlias )
430 {
431 if ( isset( $registeredAliases[$fetchAlias] ) )
432 {
433 continue;
434 }
435 $registeredAliases[$fetchAlias] = true;
436
437 unset( $fetchAliasDOMNode );
438 $fetchAliasDOMNode = $dom->createElement( 'fetch-alias' );
439 $fetchAliasDOMNode->setAttribute( 'name', $fetchAlias );
440 $fetchAliasDOMNode->setAttribute( 'site-access', $siteAccess );
441
442 $fetchBlock = $aliasINI->group( $fetchAlias );
443 if ( isset( $fetchBlock['Constant'] ) )
444 {
445 foreach ( $fetchBlock['Constant'] as $matchKey => $value )
446 {
447 if ( strpos( $matchKey, 'class_' ) === 0 &&
448 is_int( $value ) )
449 {
450 $contentClass = eZContentClass::fetch( $value );
451 $fetchBlock['Constant']['class_remote_id'] = $contentClass->attribute( 'remote_id' );
452 }
453 if ( strpos( $matchKey, 'node_' ) === 0 &&
454 is_int( $value ) )
455 {
456 $contentTreeNode = eZContentObjectTreeNode::fetch( $value );
457 $fetchBlock['Constant']['node_remote_id'] = $contentTreeNode->attribute( 'remote_id' );
458 }
459 if ( strpos( $matchKey, 'parent_node_' ) === 0 &&
460 is_int( $value ) )
461 {
462 $contentTreeNode = eZContentObjectTreeNode::fetch( $value );
463 $fetchBlock['Constant']['parent_node_remote_id'] = $contentTreeNode->attribute( 'remote_id' );
464 }
465 if ( strpos( $matchKey, 'object_' ) === 0 &&
466 is_int( $value ) )
467 {
468 $contentObject = eZContentObject::fetch( $value );
469 $fetchBlock['Constant']['object_remote_id'] = $contentObject->attribute( 'remote_id' );
470 }
471 }
472 }
473 $importedNode = $dom->importNode( eZContentObjectPackageHandler::createElementNodeFromArray( $fetchAlias, $fetchBlock ), true );
474 $fetchAliasDOMNode->appendChild( $importedNode );
475 $fetchAliasListDOMNode->appendChild( $fetchAliasDOMNode );
476 }
477 }
478 }
479 return $fetchAliasListDOMNode;
480 }
481
485 function &generateTemplateFilenameArray()
486 {
487 $dom = new DOMDocument( '1.0', 'utf-8' );
488
489 $templateListDOMNode = $dom->createElement( 'template-list' );
490 $dom->appendChild( $templateListDOMNode );
491
492 foreach( array_keys( $this->OverrideSettingsArray ) as $siteAccess )
493 {
494 $this->TemplateFileArray[$siteAccess] = array();
495 $overrideArray = eZTemplateDesignResource::overrideArray( $siteAccess );
496
497 foreach( $this->OverrideSettingsArray[$siteAccess] as $override )
498 {
499 $customMatchArray = $overrideArray['/' . $override['Source']]['custom_match'];
500
501 foreach( $customMatchArray as $customMatch )
502 {
503 if ( $customMatch['conditions'] == null )
504 {
505 //$templateListDOMNode->appendChild( $this->createDOMNodeFromFile( $customMatch['match_file'], $siteAccess, 'design' ) );
506 //$this->TemplateFileArray[$siteAccess][] = $customMatch['match_file'];
507 }
508 else if ( count( array_diff( $customMatch['conditions'], $override['Match'] ) ) == 0 &&
509 count( array_diff( $override['Match'], $customMatch['conditions'] ) ) == 0 )
510 {
511 unset( $node );
512 $node = $this->createDOMNodeFromFile( $customMatch['match_file'], $siteAccess, 'design' );
513 $importedNode = $dom->importNode( $node, true );
514 $templateListDOMNode->appendChild( $importedNode );
515 $this->TemplateFileArray[$siteAccess][] = $customMatch['match_file'];
516 }
517 }
518 }
519 }
520 return $templateListDOMNode;
521
522 //TODO : add templates included in templates here.
523 }
524
533 function createDOMNodeFromFile( $filename, $siteAccess, $filetype = false )
534 {
535 $path = substr( $filename, strpos( $filename, '/', 7 ) );
536
537 $dom = new DOMDocument( '1.0', 'utf-8' );
538 $fileDOMNode = $dom->createElement( 'file' );
539 $fileDOMNode->setAttribute( 'site-access', $siteAccess );
540
541 if ( $filetype !== false )
542 {
543 $fileDOMNode->setAttribute( 'file-type', $filetype );
544 }
545
546 $dom->appendChild( $fileDOMNode );
547 $originalPathNode = $dom->createElement( 'original-path' );
548 $originalPathNode->appendChild( $dom->createTextNode( $filename ) );
549 $fileDOMNode->appendChild( $originalPathNode );
550 $pathNode = $dom->createElement( 'path' );
551 $pathNode->appendChild( $dom->createTextNode( $path ) );
552 $fileDOMNode->appendChild( $pathNode );
553
554 $destinationPath = $this->Package->path() . '/' . eZContentObjectPackageHandler::contentObjectDirectory() . '/' . $path;
555 eZDir::mkdir( eZDir::dirpath( $destinationPath ), false, true );
556 eZFileHandler::copy( $filename, $destinationPath );
557
558 return $fileDOMNode;
559 }
560
567 function &generateOverrideSettingsArray( $siteAccessArray, $minimalTemplateSet )
568 {
569 $datatypeHash = array();
570 $simpleMatchList = array();
571 $regexpMatchList = array();
572 foreach ( $siteAccessArray as $siteAccess )
573 {
574 $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
575 $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
576 $overrideINI->loadCache();
577
578 $matchBlock = false;
579 $blockMatchArray = array();
580
581 foreach( array_keys( $this->NodeObjectArray ) as $nodeID )
582 {
583 // Extract some information that will be used
584 unset( $contentNode, $contentObject, $contentClass );
585 $contentNode = $this->NodeObjectArray[$nodeID];
586 $contentObject = $contentNode->attribute( 'object' );
587 $contentClass = $contentObject->attribute( 'content_class' );
588 $attributeList = $contentClass->fetchAttributes( false, false, false );
589 $datatypeList = array();
590 foreach ( $attributeList as $attribute )
591 {
592 $datatypeList[] = $attribute['data_type_string'];
593 if ( !isset( $datatypeHash[$attribute['data_type_string']] ) )
594 {
595 $datatype = eZDataType::create( $attribute['data_type_string'] );
596 $datatypeHash[$attribute['data_type_string']] = $datatype;
597 if ( !method_exists( $datatype, 'templateList' ) )
598 continue;
599 $templateList = $datatype->templateList();
600 if ( $templateList === false )
601 continue;
602 foreach ( $templateList as $templateMatch )
603 {
604 if ( is_string( $templateMatch ) )
605 {
606 $simpleMatchList[] = $templateMatch;
607 }
608 else if ( is_array( $templateMatch ) )
609 {
610 if ( $templateMatch[0] == 'regexp' )
611 {
612 $regexpMatchList[] = $templateMatch[1];
613 }
614 }
615 }
616 }
617 }
618 $datatypeText = implode( '|', array_unique( $datatypeList ) );
619
620 foreach( array_keys( $overrideINI->groups() ) as $blockName )
621 {
622 if ( isset( $blockMatchArray[$blockName] ) )
623 {
624 continue;
625 }
626
627 $blockData = $overrideINI->group( $blockName );
628 $sourceName = $blockData['Source'];
629 $matchSettings = false;
630 if ( isset( $blockData['Match'] ) )
631 $matchSettings = $blockData['Match'];
632
633 $matchValue = array();
634 $validMatch = true;
635 $hasMatchType = false;
636 if ( $matchSettings )
637 {
638 foreach( array_keys( $matchSettings ) as $matchType )
639 {
640 switch( $matchType )
641 {
642 case 'object':
643 {
644 $hasMatchType = true;
645 if ( $contentNode->attribute( 'contentobject_id' ) != $matchSettings[$matchType] )
646 {
647 $validMatch = false;
648 }
649 else
650 {
651 $matchValue[$this->OverrideObjectRemoteID] = $contentObject->attribute( 'remote_id' );
652 }
653 } break;
654
655 case 'node':
656 {
657 $hasMatchType = true;
658 if ( $nodeID != $matchSettings[$matchType] )
659 {
660 $validMatch = false;
661 }
662 else
663 {
664 $matchValue[$this->OverrideNodeRemoteID] = $contentNode->attribute( 'remote_id' );
665 }
666 } break;
667
668 case 'parent_node':
669 {
670 $hasMatchType = true;
671 if ( $contentNode->attribute( 'parent_node_id' ) != $matchSettings[$matchType] )
672 {
673 $validMatch = false;
674 }
675 else
676 {
677 $parentNode = $contentNode->attribute( 'parent' );
678 $matchValue[$this->OverrideParentNodeRemoteID] = $parentNode->attribute( 'remote_id' );
679 }
680 } break;
681
682 case 'class':
683 {
684 $hasMatchType = true;
685 if ( $contentObject->attribute( 'contentclass_id' ) != $matchSettings[$matchType] )
686 {
687 $validMatch = false;
688 }
689 else
690 {
691 $matchValue[$this->OverrideClassRemoteID] = $contentClass->attribute( 'remote_id' );
692 }
693 } break;
694
695 case 'class_identifier':
696 {
697 $hasMatchType = true;
698 if ( $contentObject->attribute( 'class_identifier' ) != $matchSettings[$matchType] )
699 {
700 $validMatch = false;
701 }
702 } break;
703
704 case 'section':
705 {
706 $hasMatchType = true;
707 if ( $contentObject->attribute( 'section_id' ) != $matchSettings[$matchType] )
708 {
709 $validMatch = false;
710 }
711 } break;
712
713 case 'depth':
714 {
715 $hasMatchType = true;
716 if ( $contentNode->attribute( 'depth' ) != $matchSettings[$matchType] )
717 {
718 $validMatch = false;
719 }
720 } break;
721 }
722
723 if ( !$validMatch )
724 {
725 break;
726 }
727 }
728 }
729 else
730 {
731 $validMatch = false;
732 }
733
734 if ( !$hasMatchType )
735 {
736 // Datatype match, we include overrides for datatype templates
737 if ( preg_match( "#^content/datatype/[a-zA-Z]+/(" . $datatypeText . ")\\.tpl$#", $sourceName ) )
738 {
739 $validMatch = true;
740 $hasMatchType = true;
741 }
742 else if ( in_array( $sourceName, $simpleMatchList ) )
743 {
744 $validMatch = true;
745 $hasMatchType = true;
746 }
747 else
748 {
749 foreach ( $regexpMatchList as $regexpMatch )
750 {
751 if ( preg_match( $regexpMatch, $sourceName ) )
752 {
753 $validMatch = true;
754 $hasMatchType = true;
755 }
756 }
757 }
758 }
759
760 if ( $validMatch )
761 {
762 if ( !$minimalTemplateSet or
763 $hasMatchType )
764 {
765 $blockMatchArray[$blockName] = array_merge( $blockData,
766 $matchValue );
767 }
768 }
769 }
770 }
771 $this->OverrideSettingsArray[$siteAccess] = $blockMatchArray;
772 }
773
774 $dom = new DOMDocument( '1.0', 'utf-8' );
775
776 $overrideSettingsListDOMNode = $dom->createElement( 'override-list' );
777 $dom->appendChild( $overrideSettingsListDOMNode );
778 foreach ( $this->OverrideSettingsArray as $siteAccess => $blockMatchArray )
779 {
780 foreach( $blockMatchArray as $blockName => $iniGroup )
781 {
782 unset( $blockMatchNode );
783 $blockMatchNode = $dom->createElement( 'block' );
784 $blockMatchNode->setAttribute( 'name', $blockName );
785 $blockMatchNode->setAttribute( 'site-access', $siteAccess );
786 $importedNode = $dom->importNode( eZContentObjectPackageHandler::createElementNodeFromArray( $blockName, $iniGroup ), true );
787 $blockMatchNode->appendChild( $importedNode );
788 $overrideSettingsListDOMNode->appendChild( $blockMatchNode );
789 }
790 }
791 return $overrideSettingsListDOMNode;
792 }
793
798 function &generateClassIDArray()
799 {
800 $classIDArray = array();
801 foreach( $this->NodeObjectArray as $nodeObject )
802 {
803 $contentObject = $nodeObject->object();
804 $classIDArray[] = $contentObject->attribute( 'contentclass_id' );
805 }
806 $classIDArray = array_unique( $classIDArray );
807 return $classIDArray;
808 }
809
813 function uninstall( $package, $installType, $parameters,
814 $name, $os, $filename, $subdirectory,
815 $content, &$installParameters,
816 &$installData )
817 {
818 $this->Package = $package;
819
820 if ( isset( $installParameters['error']['error_code'] ) )
821 $errorCode = $installParameters['error']['error_code'];
822 else
823 $errorCode = false;
824
825 // Error codes reserverd for content object uninstallation
826 if ( !$errorCode || ( $errorCode >= self::UNINSTALL_OBJECTS_ERROR_RANGE_FROM &&
827 $errorCode <= self::UNINSTALL_OBJECTS_ERROR_RANGE_TO ) )
828 {
829 $objectListNode = $content->getElementsByTagName( 'object-list' )->item( 0 );
830 if ( $objectListNode )
831 {
832 $objectNodes = $objectListNode->getElementsByTagName( 'object' );
833 }
834 else
835 {
836 $objectListNode = $content->getElementsByTagName( 'object-files-list' )->item( 0 );
837 $objectNodes = $objectListNode->getElementsByTagName( 'object-file' );
838 }
839
840 // loop intentionally from the last until the first
841 // objects need to be uninstalled in reverse order of installation
842 for ( $i = $objectNodes->length - 1; $i >=0; $i-- )
843 {
844 $objectNode = $objectNodes->item( $i );
845 $realObjectNode = $this->getRealObjectNode( $objectNode );
846
847 $objectRemoteID = $realObjectNode->getAttribute( 'remote_id' );
848 $name = $realObjectNode->getAttribute( 'name' );
849
850 if ( isset( $installParameters['error']['error_code'] ) &&
851 !$this->isErrorElement( $objectRemoteID, $installParameters ) )
852 continue;
853
854 if ( isset( $object ) )
855 {
856 eZContentObject::clearCache( $object->attribute( 'id' ) );
857 unset( $object );
858 }
859 $object = eZContentObject::fetchByRemoteID( $objectRemoteID );
860
861 if ( $object !== null )
862 {
863 $modified = $object->attribute( 'modified' );
864 $published = $object->attribute( 'published' );
865 if ( $modified > $published )
866 {
867 $choosenAction = $this->errorChoosenAction( eZContentObject::PACKAGE_ERROR_MODIFIED,
868 $installParameters, false, $this->HandlerType );
869
870 if ( $choosenAction == eZContentObject::PACKAGE_KEEP )
871 {
872 continue;
873 }
874 if ( $choosenAction != eZContentObject::PACKAGE_DELETE )
875 {
876 $installParameters['error'] = array( 'error_code' => eZContentObject::PACKAGE_ERROR_MODIFIED,
877 'element_id' => $objectRemoteID,
878 'description' => ezpI18n::tr( 'kernel/package',
879 "Object '%objectname' has been modified since installation. Are you sure you want to remove it?",
880 false, array( '%objectname' => $name ) ),
881 'actions' => array( eZContentObject::PACKAGE_DELETE => ezpI18n::tr( 'kernel/package', 'Remove' ),
882 eZContentObject::PACKAGE_KEEP => ezpI18n::tr( 'kernel/package', 'Keep object' ) ) );
883 return false;
884 }
885 }
886
887 $assignedNodes = $object->attribute( 'assigned_nodes' );
888 $assignedNodeIDArray = array();
889 foreach( $assignedNodes as $node )
890 {
891 $assignedNodeIDArray[] = $node->attribute( 'node_id' );
892 }
893 if ( count( $assignedNodeIDArray ) == 0 )
894 continue;
895 $info = eZContentObjectTreeNode::subtreeRemovalInformation( $assignedNodeIDArray );
896 $childrenCount = $info['total_child_count'];
897
898 if ( $childrenCount > 0 )
899 {
900 $choosenAction = $this->errorChoosenAction( eZContentObject::PACKAGE_ERROR_HAS_CHILDREN,
901 $installParameters, false, $this->HandlerType );
902
903 if ( $choosenAction == eZContentObject::PACKAGE_KEEP )
904 {
905 continue;
906 }
907 if ( $choosenAction != eZContentObject::PACKAGE_DELETE )
908 {
909 $installParameters['error'] = array( 'error_code' => eZContentObject::PACKAGE_ERROR_HAS_CHILDREN,
910 'element_id' => $objectRemoteID,
911 'description' => ezpI18n::tr( 'kernel/package',
912 "Object '%objectname' has %childrencount sub-item(s) that will be removed.",
913 false, array( '%objectname' => $name,
914 '%childrencount' => $childrenCount ) ),
915 'actions' => array( eZContentObject::PACKAGE_DELETE => ezpI18n::tr( 'kernel/package', "Remove object and its sub-item(s)" ),
916 eZContentObject::PACKAGE_KEEP => ezpI18n::tr( 'kernel/package', 'Keep object' ) ) );
917 return false;
918 }
919 }
920
921 eZContentObjectTreeNode::removeSubtrees( $assignedNodeIDArray, false );
922
923 //eZContentObjectOperations::remove( $object->attribute( 'id' ) );
924 }
925 else
926 {
927 eZDebug::writeNotice( "Can't uninstall object '$name': object not found", __METHOD__ );
928 }
929
930 unset( $realObjectNode );
931 }
932 }
933 return true;
934 }
935
939 function install( $package, $installType, $parameters,
940 $name, $os, $filename, $subdirectory,
941 $content, &$installParameters,
942 &$installData )
943 {
944 $this->Package = $package;
945
946 if ( isset( $installParameters['error']['error_code'] ) )
947 $errorCode = $installParameters['error']['error_code'];
948 else
949 $errorCode = false;
950
951 // Error codes reservered for content object installation
952 if ( !$errorCode || ( $errorCode >= self::INSTALL_OBJECTS_ERROR_RANGE_FROM &&
953 $errorCode <= self::INSTALL_OBJECTS_ERROR_RANGE_TO ) )
954 {
955 $objectListNode = $content->getElementsByTagName( 'object-list' )->item( 0 );
956 if ( $objectListNode )
957 {
958 $objectNodes = $objectListNode->getElementsByTagName( 'object' );
959 }
960 else
961 {
962 $objectListNode = $content->getElementsByTagName( 'object-files-list' )->item( 0 );
963 $objectNodes = $objectListNode->getElementsByTagName( 'object-file' );
964 }
965
966
967 if ( !$this->installContentObjects( $objectNodes,
968 $content->getElementsByTagName( 'top-node-list' )->item( 0 ),
969 $installParameters ) )
970 return false;
971 $errorCode = false;
972 }
973
974 if ( !$this->installTemplates( $content->getElementsByTagName( 'template-list' )->item( 0 ),
975 $package,
976 $subdirectory,
977 $installParameters ) )
978 return false;
979
980
981 if ( !$this->installOverrides( $content->getElementsByTagName( 'override-list' )->item( 0 ),
982 $installParameters ) )
983 return false;
984
985 if ( !$this->installFetchAliases( $content->getElementsByTagName( 'fetch-alias-list' )->item( 0 ),
986 $installParameters ) )
987 return false;
988
989 return true;
990 }
991
1001 function installContentObjects( $objectNodes, $topNodeListNode, &$installParameters )
1002 {
1003 if ( isset( $installParameters['user_id'] ) )
1004 $userID = $installParameters['user_id'];
1005 else
1006 $userID = eZUser::currentUserID();
1007
1008 $handlerType = $this->handlerType();
1009 $firstInstalledID = null;
1010
1011 foreach( $objectNodes as $objectNode )
1012 {
1013 $realObjectNode = $this->getRealObjectNode( $objectNode );
1014
1015 // Cycle until we reach an element where error has occured.
1016 // If action has been choosen, try install this item again, else skip it.
1017 if ( isset( $installParameters['error']['error_code'] ) &&
1018 !$this->isErrorElement( $realObjectNode->getAttribute( 'remote_id' ), $installParameters ) )
1019 {
1020 continue;
1021 }
1022
1023 //we are here, it means we'll try to install some object.
1024 if ( !$firstInstalledID )
1025 {
1026 $firstInstalledID = $realObjectNode->getAttribute( 'remote_id' );
1027 }
1028
1029 $newObject = eZContentObject::unserialize( $this->Package, $realObjectNode, $installParameters, $userID, $handlerType );
1030 if ( !$newObject )
1031 {
1032 return false;
1033 }
1034
1035 if ( is_object( $newObject ) )
1036 {
1037 eZContentObject::clearCache( $newObject->attribute( 'id' ) );
1038 unset( $newObject );
1039 }
1040 unset( $realObjectNode );
1041
1042 if ( isset( $installParameters['error'] ) && count( $installParameters['error'] ) )
1043 {
1044 $installParameters['error'] = array();
1045 }
1046 }
1047
1048 $this->installSuspendedNodeAssignment( $installParameters );
1049 $this->installSuspendedObjectRelations( $installParameters );
1050
1051 // Call postUnserialize on all installed objects
1052 foreach( $objectNodes as $objectNode )
1053 {
1054 if ( $objectNode->localName == 'object' )
1055 {
1056 $remoteID = $objectNode->getAttribute( 'remote_id' );
1057 }
1058 else
1059 {
1060 $remoteID = substr( $objectNode->getAttribute( 'filename' ), 7, 32 );
1061 }
1062
1063 // Begin from the object that we started from in the previous cycle
1064 if ( $firstInstalledID && $remoteID != $firstInstalledID )
1065 {
1066 continue;
1067 }
1068 else
1069 {
1070 $firstInstalledID = null;
1071 }
1072
1073 $object = eZContentObject::fetchByRemoteID( $remoteID );
1074 if ( is_object( $object ) )
1075 {
1076 $object->postUnserialize( $this->Package );
1077 eZContentObject::clearCache( $object->attribute( 'id' ) );
1078 }
1079 unset( $object );
1080 }
1081
1082 return true;
1083 }
1084
1090 function installSuspendedNodeAssignment( &$installParameters )
1091 {
1092 if ( !isset( $installParameters['suspended-nodes'] ) )
1093 {
1094 return;
1095 }
1096 foreach ( $installParameters['suspended-nodes'] as $parentNodeRemoteID => $suspendedNodeInfo )
1097 {
1098 $parentNode = eZContentObjectTreeNode::fetchByRemoteID( $parentNodeRemoteID );
1099 if ( $parentNode !== null )
1100 {
1101 $nodeInfo = $suspendedNodeInfo['nodeinfo'];
1102 $nodeInfo['parent_node'] = $parentNode->attribute( 'node_id' );
1103
1104 $existNodeAssignment = eZPersistentObject::fetchObject( eZNodeAssignment::definition(),
1105 null,
1106 $nodeInfo );
1107 $nodeInfo['priority'] = $suspendedNodeInfo['priority'];
1108 if( !is_object( $existNodeAssignment ) )
1109 {
1110 $nodeAssignment = eZNodeAssignment::create( $nodeInfo );
1111 $nodeAssignment->store();
1112 }
1113
1114 $contentObject = eZContentObject::fetch( $nodeInfo['contentobject_id'] );
1115 if ( is_object( $contentObject ) && $contentObject->attribute( 'current_version' ) == $nodeInfo['contentobject_version'] )
1116 {
1117 eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $nodeInfo['contentobject_id'],
1118 'version' => $nodeInfo['contentobject_version'] ) );
1119 }
1120 if ( isset( $nodeInfo['is_main'] ) && $nodeInfo['is_main'] )
1121 {
1122 $existingMainNode = eZContentObjectTreeNode::fetchByRemoteID( $nodeInfo['parent_remote_id'], false );
1123 if ( $existingMainNode )
1124 {
1125 eZContentObjectTreeNode::updateMainNodeID( $existingMainNode['node_id'],
1126 $nodeInfo['contentobject_id'],
1127 $nodeInfo['contentobject_version'],
1128 $nodeInfo['parent_node'] );
1129 }
1130 }
1131 }
1132 else
1133 {
1134 eZDebug::writeError( 'Can not find parent node by remote-id ID = ' . $parentNodeRemoteID, __METHOD__ );
1135 }
1136 unset( $installParameters['suspended-nodes'][$parentNodeRemoteID] );
1137 }
1138 }
1139
1147 function installSuspendedObjectRelations( &$installParameters )
1148 {
1149 if ( !isset( $installParameters['suspended-relations'] ) )
1150 {
1151 return;
1152 }
1153 foreach( $installParameters['suspended-relations'] as $suspendedObjectRelation )
1154 {
1155 $contentObjectID = $suspendedObjectRelation['contentobject-id'];
1156 $contentObjectVersionID = $suspendedObjectRelation['contentobject-version'];
1157
1158 $contentObjectVersion = eZContentObjectVersion::fetchVersion( $contentObjectVersionID, $contentObjectID );
1159 if ( is_object( $contentObjectVersion ) )
1160 {
1161 $relatedObjectRemoteID = $suspendedObjectRelation['related-object-remote-id'];
1162 $relatedObject = eZContentObject::fetchByRemoteID( $relatedObjectRemoteID );
1163 $relatedObjectID = ( $relatedObject !== null ) ? $relatedObject->attribute( 'id' ) : null;
1164
1165 if ( $relatedObjectID )
1166 {
1167 $relatedObject->addContentObjectRelation( $relatedObjectID, $contentObjectVersionID, $contentObjectID );
1168 }
1169 else
1170 {
1171 eZDebug::writeError( 'Can not find related object by remote-id ID = ' . $relatedObjectRemoteID, __METHOD__ );
1172 }
1173 }
1174 }
1175 unset( $installParameters['suspended-relations'] );
1176 }
1177
1188 function installTemplates( $templateList, $package, $subdirectory, &$installParameters )
1189 {
1190 if ( !$templateList )
1191 {
1192 return true;
1193 }
1194 $siteAccessDesignPathArray = array();
1195 $templateRootPath = $package->path() . '/' . $subdirectory;
1196 foreach( $templateList->getElementsByTagName( 'file' ) as $fileNode )
1197 {
1198 $originalSiteAccess = $fileNode->getAttribute( 'site-access' );
1199 if ( isset( $installParameters['site_access_map'][$originalSiteAccess] ) )
1200 {
1201 $newSiteAccess = $installParameters['site_access_map'][$originalSiteAccess];
1202 }
1203 else
1204 {
1205 $newSiteAccess = $installParameters['site_access_map']['*'];
1206 }
1207
1208 if ( !isset( $siteAccessDesignPathArray[$newSiteAccess] ) )
1209 {
1210 $ini = eZINI::instance( 'site.ini', 'settings', null, null, true );
1211 $ini->prependOverrideDir( "siteaccess/$newSiteAccess", false, 'siteaccess' );
1212 $ini->loadCache();
1213
1214 if ( isset( $installParameters['design_map'] ) )
1215 {
1216 $designMap = $installParameters['design_map'];
1217 if ( isset( $designMap[$originalSiteAccess] ) )
1218 $siteAccessDesignPathArray[$newSiteAccess] = eZTemplateDesignResource::designStartPath() . '/' . $designMap[$originalSiteAccess];
1219 else
1220 $siteAccessDesignPathArray[$newSiteAccess] = eZTemplateDesignResource::designStartPath() . '/' . $designMap['*'];
1221 }
1222 else
1223 {
1224 $siteAccessDesignPathArray[$newSiteAccess] = eZTemplateDesignResource::designStartPath() . '/' . $ini->variable( "DesignSettings", "StandardDesign" );
1225 }
1226 }
1227
1228 $path = '';
1229 foreach( $fileNode->childNodes as $pathNode )
1230 {
1231 if ( $pathNode->nodeName == 'path' )
1232 {
1233 $path = $pathNode->nodeValue;
1234 break;
1235 }
1236 }
1237
1238 $sourcePath = $templateRootPath . $path;
1239 $destinationPath = $siteAccessDesignPathArray[$newSiteAccess] . $path;
1240
1241 eZDir::mkdir( eZDir::dirpath( $destinationPath ), false, true );
1242 if ( !eZFileHandler::copy( $sourcePath, $destinationPath ) )
1243 return false;
1244
1245 // eZDebug::writeNotice( 'Copied: "' . $sourcePath . '" to: "' . $destinationPath . '"', __METHOD__ );
1246 }
1247 return true;
1248 }
1249
1258 function installOverrides( $overrideListNode, &$parameters )
1259 {
1260 if ( !$overrideListNode )
1261 {
1262 return true;
1263 }
1264
1265 $overrideINIArray = array();
1266 foreach( $overrideListNode->getElementsByTagName( 'block' ) as $blockNode )
1267 {
1268 if ( isset( $parameters['site_access_map'][$blockNode->getAttribute( 'site-access' )] ) )
1269 {
1270 $newSiteAccess = $parameters['site_access_map'][$blockNode->getAttribute( 'site-access' )];
1271 }
1272 else
1273 {
1274 $newSiteAccess = $parameters['site_access_map']['*'];
1275 }
1276
1277 if ( !$newSiteAccess )
1278 {
1279 eZDebug::writeError( 'SiteAccess map for : ' . $blockNode->getAttribute( 'site-access' ) . ' not set.', __METHOD__ );
1280 continue;
1281 }
1282
1283 if ( !isset( $overrideINIArray[$newSiteAccess] ) )
1284 {
1285 $overrideINIArray[$newSiteAccess] = eZINI::instance( 'override.ini.append.php', "settings/siteaccess/$newSiteAccess", null, null, true );
1286 }
1287
1288 $blockArray = array();
1289 $blockName = $blockNode->getAttribute( 'name' );
1290 $blockArray[$blockName] = eZContentObjectPackageHandler::createArrayFromDOMNode( $blockNode->getElementsByTagName( $blockName )->item( 0 ) );
1291
1292 if ( isset( $blockArray[$blockName][$this->OverrideObjectRemoteID] ) )
1293 {
1294 $contentObject = eZContentObject::fetchByRemoteID( $blockArray[$blockName][$this->OverrideObjectRemoteID] );
1295 $blockArray[$blockName]['Match']['object'] = $contentObject->attribute( 'id' );
1296 unset( $blockArray[$blockName][$this->OverrideObjectRemoteID] );
1297 // eZDebug::writeNotice( 'Found object id: "' . $blockArray[$blockName]['Match']['object'] . '" for matchblock "[' . $blockName . '][Match][object]"', __METHOD__ );
1298 }
1299 if ( isset( $blockArray[$blockName][$this->OverrideNodeRemoteID] ) )
1300 {
1301 $contentNode = eZContentObjectTreeNode::fetchByRemoteID( $blockArray[$blockName][$this->OverrideNodeRemoteID] );
1302 $blockArray[$blockName]['Match']['node'] = $contentNode->attribute( 'node_id' );
1303 unset( $blockArray[$blockName][$this->OverrideNodeRemoteID] );
1304 // eZDebug::writeNotice( 'Found node id: "' . $blockArray[$blockName]['Match']['node'] . '" for matchblock "[' . $blockName . '][Match][node]"', __METHOD__ );
1305 }
1306 if ( isset( $blockArray[$blockName][$this->OverrideParentNodeRemoteID] ) )
1307 {
1308 $parentContentNode = eZContentObjectTreeNode::fetchByRemoteID( $blockArray[$blockName][$this->OverrideParentNodeRemoteID] );
1309 $blockArray[$blockName]['Match']['parent_node'] = $parentContentNode->attribute( 'node_id' );
1310 unset( $blockArray[$blockName][$this->OverrideParentNodeRemoteID] );
1311 // eZDebug::writeNotice( 'Found parent node id: "' . $blockArray[$blockName]['Match']['parent_node'] . '" for matchblock "[' . $blockName . '][Match][parent_node]"', __METHOD__ );
1312 }
1313 if ( isset( $blockArray[$blockName][$this->OverrideClassRemoteID] ) )
1314 {
1315 $contentClass = eZContentClass::fetchByRemoteID( $blockArray[$blockName][$this->OverrideClassRemoteID] );
1316 if ( !$contentClass )
1317 {
1318 eZDebug::writeError( 'No content class found for RemoteID: ' . $blockArray[$blockName][$this->OverrideClassRemoteID], __METHOD__ );
1319 continue;
1320 }
1321 $blockArray[$blockName]['Match']['class'] = $contentClass->attribute( 'id' );
1322 unset( $blockArray[$blockName][$this->OverrideClassRemoteID] );
1323 // eZDebug::writeNotice( 'Found class id: "' . $blockArray[$blockName]['Match']['class'] . '" for matchblock "[' . $blockName . '][Match][class]"', __METHOD__ );
1324 }
1325
1326 $overrideINIArray[$newSiteAccess]->setVariables( $blockArray );
1327 }
1328
1329 foreach( $overrideINIArray as $siteAccess => $iniArray )
1330 {
1331 $overrideINIArray[$siteAccess]->save();
1332 }
1333
1334 return true;
1335 }
1336
1345 function installFetchAliases( $fetchAliasListNode, &$parameters )
1346 {
1347 if ( !$fetchAliasListNode )
1348 {
1349 return true;
1350 }
1351
1352 $fetchAliasINIArray = array();
1353 foreach( $fetchAliasListNode->getElementsByTagName( 'fetch-alias' ) as $blockNode )
1354 {
1355 if ( isset( $parameters['site_access_map'][$blockNode->getAttribute( 'site-access' )] ) )
1356 {
1357 $newSiteAccess = $parameters['site_access_map'][$blockNode->getAttribute( 'site-access' )];
1358 }
1359 else
1360 {
1361 $newSiteAccess = $parameters['site_access_map']['*'];
1362 }
1363
1364 if ( !isset( $fetchAliasINIArray[$newSiteAccess] ) )
1365 {
1366 $fetchAliasINIArray[$newSiteAccess] = eZINI::instance( 'fetchalias.ini.append.php', "settings/siteaccess/$newSiteAccess", null, null, true );
1367 }
1368
1369 $blockArray = array();
1370 $blockName = $blockNode->getAttribute( 'name' );
1371 $blockArray[$blockName] = eZContentObjectPackageHandler::createArrayFromDOMNode( $blockNode->getElementsByTagName( $blockName )->item( 0 ) );
1372
1373 //$blockArray[$blockName] = $blockArray[$blockName][0];
1374
1375 if ( isset( $blockArray[$blockName]['Constant'] ) && is_array( $blockArray[$blockName]['Constant'] ) && count( $blockArray[$blockName]['Constant'] ) > 0 )
1376 {
1377 foreach( $blockArray[$blockName]['Constant'] as $matchKey => $value )
1378 {
1379 if ( strpos( $matchKey, 'class_' ) === 0 &&
1380 is_int( $value ) )
1381 {
1382 $contentClass = eZContentClass::fetchByRemoteID( $blockArray[$blockName]['Constant']['class_remote_id'] );
1383 $blockArray[$blockName]['Constant'][$matchKey] = $contentClass->attribute( 'id' );
1384 unset( $blockArray[$blockName]['Constant']['class_remote_id'] );
1385 }
1386 if( strpos( $matchKey, 'node_' ) === 0 &&
1387 is_int( $value ) )
1388 {
1389 $contentTreeNode = eZContentObjectTreeNode::fetchByRemoteID( $blockArray[$blockName]['Constant']['node_remote_id'] );
1390 $blockArray[$blockName]['Constant'][$matchKey] = $contentTreeNode->attribute( 'node_id' );
1391 unset( $blockArray[$blockName]['Constant']['node_remote_id'] );
1392 }
1393 if( strpos( $matchKey, 'parent_node_' ) === 0 &&
1394 is_int( $value ) )
1395 {
1396 $contentTreeNode = eZContentObjectTreeNode::fetchByRemoteID( $blockArray[$blockName]['Constant']['parent_node_remote_id'] );
1397 $blockArray[$blockName]['Constant'][$matchKey] = $contentTreeNode->attribute( 'node_id' );
1398 unset( $blockArray[$blockName]['Constant']['parent_node_remote_id'] );
1399 }
1400 if( strpos( $matchKey, 'object_' ) === 0 &&
1401 is_int( $value ) )
1402 {
1403 $contentObject = eZContentObject::fetchByRemoteID( $blockArray[$blockName]['Constant']['object_remote_id'] );
1404 $blockArray[$blockName]['Constant'][$matchKey] = $contentTreeNode->attribute( 'id' );
1405 unset( $blockArray[$blockName]['Constant']['object_remote_id'] );
1406 }
1407 }
1408 }
1409
1410 $fetchAliasINIArray[$newSiteAccess]->setVariables( $blockArray );
1411 }
1412
1413 foreach( $fetchAliasINIArray as $siteAccess => $iniFetchAlias )
1414 {
1415 $fetchAliasINIArray[$siteAccess]->save();
1416 }
1417
1418 return true;
1419 }
1420
1421 function add( $packageType, $package, $cli, $parameters )
1422 {
1423 $options = array();
1424 foreach ( $parameters['node-list'] as $nodeItem )
1425 {
1426 $nodeIDList = $nodeItem['node-id-list'];
1427 foreach ( $nodeIDList as $nodeIDItem )
1428 {
1429 $this->addNode( $nodeIDItem['id'], $nodeIDItem['subtree'] );
1430 unset( $node );
1431 $node = false;
1432 if ( isset( $nodeIDItem['node'] ) )
1433 {
1434 $node = $nodeIDItem['node'];
1435 }
1436 else
1437 {
1438 $node = eZContentObjectTreeNode::fetch( $nodeIDItem['id'] );
1439 }
1440 $cli->notice( "Adding node /" . $node->pathWithNames() . " to package" );
1441 }
1442 }
1443 $options['include_classes'] = $parameters['include-classes'];
1444 $options['include_templates'] = $parameters['include-templates'];
1445 $options['node_assignment'] = $parameters['node-assignment-type'];
1446 $options['site_access_array'] = $parameters['siteaccess-list'];
1447 $options['language_array'] = $parameters['language-list'];
1448 $options['versions'] = $parameters['version-type'];
1449 $options['related_objects'] = $parameters['related-type'];
1450 $options['embed_objects'] = $parameters['embed-type'];
1451 $options['minimal_template_set'] = $parameters['minimal-template-set'];
1452 $this->generatePackage( $package, $options );
1453 }
1454
1455 function handleAddParameters( $packageType, $package, $cli, $arguments )
1456 {
1457 return $this->handleParameters( $packageType, $package, $cli, 'add', $arguments );
1458 }
1459
1463 function handleParameters( $packageType, $package, $cli, $type, $arguments )
1464 {
1465 $nodeList = array();
1466 $includeClasses = true;
1467 $includeTemplates = true;
1468 $siteAccessList = array();
1469 $nodeAssignmentType = 'main';
1470 $relatedObjectType = 'selected';
1471 $embedObjectType = 'selected';
1472 $versionType = 'current';
1473 $languageList = array();
1474 $minimalTemplateSet = false;
1475 $nodeItem = array( 'node-id-list' => array() );
1476 $longOptions = array( 'include-classes' => 'include-classes',
1477 'include-templates' => 'include-templates',
1478 'exclude-classes' => 'exclude-classes',
1479 'exclude-templates' => 'exclude-templates',
1480 'language' => 'language',
1481 'current-version' => 'current-version',
1482 'all-versions' => 'all-versions',
1483 'node-main' => 'node-main',
1484 'node-selected' => 'node-selected',
1485 'siteaccess' => 'siteaccess',
1486 'minimal-template-set' => 'minimal-template-set' );
1487 $shortOptions = array();
1488 $error = false;
1489 foreach ( $arguments as $argument )
1490 {
1491 if ( $argument[0] == '-' )
1492 {
1493 if ( strlen( $argument ) > 1 and
1494 $argument[1] == '-' )
1495 {
1496 $option = substr( $argument, 2 );
1497 $valuePos = strpos( $option, '=' );
1498 $optionValue = false;
1499 if ( $valuePos !== false )
1500 {
1501 $optionValue = substr( $option, $valuePos + 1 );
1502 $option = substr( $option, 0, $valuePos );
1503 }
1504 if ( isset( $longOptions[$option] ) )
1505 $optionName = $longOptions[$option];
1506 else
1507 $optionName = false;
1508 }
1509 else
1510 {
1511 $option = substr( $argument, 1 );
1512 if ( isset( $shortOptions[$option] ) )
1513 $optionName = $shortOptions[$option];
1514 else
1515 $optionName = false;
1516 }
1517 if ( $optionName == 'include-classes' or $optionName == 'exclude-classes' )
1518 {
1519 if ( count( $nodeItem['node-id-list'] ) > 0 )
1520 {
1521 $nodeList[] = $nodeItem;
1522 $nodeItem['node-id-list'] = array();
1523 }
1524 $includeClasses = ( $optionName == 'include-classes' );
1525 }
1526 else if ( $optionName == 'include-templates' or $optionName == 'exclude-templates' )
1527 {
1528 if ( count( $nodeItem['node-id-list'] ) > 0 )
1529 {
1530 $nodeList[] = $nodeItem;
1531 $nodeItem['node-id-list'] = array();
1532 }
1533 $includeTemplates = ( $optionName == 'include-templates' );
1534 }
1535 else if ( $optionName == 'node-main' )
1536 {
1537 $nodeAssignmentType = 'main';
1538 }
1539 else if ( $optionName == 'node-selected' )
1540 {
1541 $nodeAssignmentType = 'selected';
1542 }
1543 else if ( $optionName == 'siteaccess' )
1544 {
1545 $siteAccessList = explode( ',', $optionValue );
1546 }
1547 else if ( $optionName == 'language' )
1548 {
1549 $languageList = explode( ',', $optionValue );
1550 }
1551 else if ( $optionName == 'current-version' )
1552 {
1553 $versionType = 'current';
1554 }
1555 else if ( $optionName == 'all-versions' )
1556 {
1557 $versionType = 'all';
1558 }
1559 else if ( $optionName == 'minimal-template-set' )
1560 {
1561 $minimalTemplateSet = true;
1562 }
1563 }
1564 else
1565 {
1566 $nodeID = false;
1567 if ( is_numeric( $argument ) )
1568 {
1569 $nodeID = (int)$argument;
1570 $node = eZContentObjectTreeNode::fetch( $nodeID );
1571 if ( !is_object( $node ) )
1572 {
1573 $error = true;
1574 $nodeID = false;
1575 $cli->notice( "Could not find content-node using ID " . $cli->stylize( 'emphasize', $nodeID ) );
1576 }
1577 }
1578 else
1579 {
1580 $path = $argument;
1581 if ( preg_match( "#(.+)/\*$#", $path, $matches ) )
1582 {
1583 $path = $matches[1];
1584 }
1585 $node = eZContentObjectTreeNode::fetchByURLPath( $path );
1586 if ( is_object( $node ) )
1587 {
1588 $nodeID = $node->attribute( 'node_id' );
1589 }
1590 else
1591 {
1592 $cli->notice( "Could not find content-node using path " . $cli->stylize( 'emphasize', $path ) );
1593 $error = true;
1594 }
1595 }
1596 if ( $nodeID )
1597 {
1598 $nodeItem['node-id-list'][] = array( 'id' => $nodeID,
1599 'subtree' => true,
1600 'node' => &$node );
1601 }
1602 if ( $error )
1603 return false;
1604 }
1605 }
1606 if ( count( $nodeItem['node-id-list'] ) > 0 )
1607 {
1608 $nodeList[] = $nodeItem;
1609 }
1610 if ( count( $nodeList ) == 0 )
1611 {
1612 $cli->error( "No objects chosen" );
1613 return false;
1614 }
1615 if ( count( $languageList ) == 0 )
1616 {
1617 // The default is to fetch all languages
1618 $languageList = eZContentLanguage::fetchLocaleList();
1619 }
1620 if ( count( $siteAccessList ) == 0 )
1621 {
1622 $ini = eZINI::instance();
1623 $siteAccessList[] = $ini->variable( 'SiteSettings', 'DefaultAccess' );
1624 }
1625 return array( 'node-list' => $nodeList,
1626 'include-classes' => $includeClasses,
1627 'include-templates' => $includeTemplates,
1628 'siteaccess-list' => $siteAccessList,
1629 'language-list' => $languageList,
1630 'node-assignment-type' => $nodeAssignmentType,
1631 'related-type' => $relatedObjectType,
1632 'embed-type' => $embedObjectType,
1633 'version-type' => $versionType,
1634 'minimal-template-set' => $minimalTemplateSet,
1635 );
1636 }
1637
1638 function contentObjectDirectory()
1639 {
1640 return 'ezcontentobject';
1641 }
1642
1647 static function createElementNodeFromArray( $name, $array )
1648 {
1649 $dom = new DOMDocument( '1.0', 'utf-8' );
1650 $node = $dom->createElement( $name );
1651 $dom->appendChild( $node );
1652
1653 foreach ( $array as $arrayKey => $value )
1654 {
1655 if ( is_array( $value ) and
1656 count( $valueKeys = array_keys( $value ) ) > 0 )
1657 {
1658 if ( is_int( $valueKeys[0] ) )
1659 {
1660 foreach( $value as $child )
1661 {
1662 unset( $childNode );
1663 unset( $importedChildNode );
1664 $childNode = eZContentObjectPackageHandler::createElementNodeFromArray( $arrayKey, $child );
1665 $importedChildNode = $dom->importNode( $childNode, true );
1666 $node->appendChild( $importedChildNode );
1667 }
1668 }
1669 else
1670 {
1671 unset( $valueNode );
1672 unset( $importedValueNode );
1673 $valueNode = eZContentObjectPackageHandler::createElementNodeFromArray( $arrayKey, $value );
1674 $importedValueNode = $dom->importNode( $valueNode, true );
1675 $node->appendChild( $importedValueNode );
1676 }
1677 }
1678 else
1679 {
1680 $node->setAttribute( $arrayKey, $value );
1681 }
1682 }
1683 return $node;
1684 }
1685
1690 static function createArrayFromDOMNode( $domNode )
1691 {
1692 if ( !$domNode )
1693 {
1694 return null;
1695 }
1696
1697 $retArray = array();
1698 foreach ( $domNode->childNodes as $childNode )
1699 {
1700 if ( $childNode->nodeType != XML_ELEMENT_NODE )
1701 {
1702 continue;
1703 }
1704
1705 if ( !isset( $retArray[$childNode->localName] ) )
1706 {
1707 $retArray[$childNode->localName] = array();
1708 }
1709
1710 // If the node has children we create an array for this element
1711 // and append to it, if not we assign it directly
1712 if ( $childNode->hasChildNodes() )
1713 {
1714 $retArray[$childNode->localName][] = eZContentObjectPackageHandler::createArrayFromDOMNode( $childNode );
1715 }
1716 else
1717 {
1718 $retArray[$childNode->localName] = eZContentObjectPackageHandler::createArrayFromDOMNode( $childNode );
1719 }
1720 }
1721 foreach( $domNode->attributes as $attributeNode )
1722 {
1723 $retArray[$attributeNode->name] = $attributeNode->value;
1724 }
1725
1726 return $retArray;
1727 }
1728
1729 public $NodeIDArray = array();
1730 public $RootNodeIDArray = array();
1731 public $NodeObjectArray = array();
1732 public $ObjectArray = array();
1733 public $RootNodeObjectArray = array();
1734 public $OverrideSettingsArray = array();
1735 public $TemplateFileArray = array();
1736 public $Package = null;
1737
1738 // Static class variables - replacing match values in override.ini
1739 public $OverrideObjectRemoteID = 'content_object_remote_id';
1740 public $OverrideNodeRemoteID = 'content_node_remote_id';
1741 public $OverrideParentNodeRemoteID = 'parent_content_node_remote_id';
1742 public $OverrideClassRemoteID = 'content_class_remote_id';
1743 }
1744
1745 ?>
eZContentClassPackageHandler\addClass
static addClass( $package, $classID, $classIdentifier=false)
Definition: ezcontentclasspackagehandler.php:424
eZContentClass\fetchByRemoteID
static fetchByRemoteID( $remoteID, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $user_id=false, $parent_id=null)
Definition: ezcontentclass.php:1170
eZContentClass\fetch
static fetch( $id, $asObject=true, $version=eZContentClass::VERSION_STATUS_DEFINED, $user_id=false, $parent_id=null)
Definition: ezcontentclass.php:1116
eZContentLanguage\fetchLocaleList
static fetchLocaleList()
Definition: ezcontentlanguage.php:231
eZContentObjectPackageHandler
Handles content objects in the package system.
Definition: ezcontentobjectpackagehandler.php:18
eZContentObjectPackageHandler\createArrayFromDOMNode
static createArrayFromDOMNode( $domNode)
Definition: ezcontentobjectpackagehandler.php:1690
eZContentObjectPackageHandler\generateObjectArray
generateObjectArray( $nodeAssignment)
Definition: ezcontentobjectpackagehandler.php:382
eZContentObjectPackageHandler\$NodeObjectArray
$NodeObjectArray
Definition: ezcontentobjectpackagehandler.php:1731
eZContentObjectPackageHandler\$OverrideNodeRemoteID
$OverrideNodeRemoteID
Definition: ezcontentobjectpackagehandler.php:1740
eZContentObjectPackageHandler\handleParameters
handleParameters( $packageType, $package, $cli, $type, $arguments)
Definition: ezcontentobjectpackagehandler.php:1463
eZContentObjectPackageHandler\generatePackage
generatePackage( $package, $options)
Definition: ezcontentobjectpackagehandler.php:192
eZContentObjectPackageHandler\generateFetchAliasArray
& generateFetchAliasArray()
Definition: ezcontentobjectpackagehandler.php:403
eZContentObjectPackageHandler\createElementNodeFromArray
static createElementNodeFromArray( $name, $array)
Definition: ezcontentobjectpackagehandler.php:1647
eZContentObjectPackageHandler\$TemplateFileArray
$TemplateFileArray
Definition: ezcontentobjectpackagehandler.php:1735
eZContentObjectPackageHandler\$ObjectArray
$ObjectArray
Definition: ezcontentobjectpackagehandler.php:1732
eZContentObjectPackageHandler\$OverrideClassRemoteID
$OverrideClassRemoteID
Definition: ezcontentobjectpackagehandler.php:1742
eZContentObjectPackageHandler\$NodeIDArray
$NodeIDArray
Definition: ezcontentobjectpackagehandler.php:1729
eZContentObjectPackageHandler\handleAddParameters
handleAddParameters( $packageType, $package, $cli, $arguments)
Definition: ezcontentobjectpackagehandler.php:1455
eZContentObjectPackageHandler\installContentObjects
installContentObjects( $objectNodes, $topNodeListNode, &$installParameters)
Definition: ezcontentobjectpackagehandler.php:1001
eZContentObjectPackageHandler\fetchObjectFromFile
fetchObjectFromFile( $objectFileNode)
Definition: ezcontentobjectpackagehandler.php:40
eZContentObjectPackageHandler\install
install( $package, $installType, $parameters, $name, $os, $filename, $subdirectory, $content, &$installParameters, &$installData)
Definition: ezcontentobjectpackagehandler.php:939
eZContentObjectPackageHandler\INSTALL_OBJECTS_ERROR_RANGE_FROM
const INSTALL_OBJECTS_ERROR_RANGE_FROM
Definition: ezcontentobjectpackagehandler.php:27
eZContentObjectPackageHandler\MAX_LISTED_OBJECTS
const MAX_LISTED_OBJECTS
Definition: ezcontentobjectpackagehandler.php:20
eZContentObjectPackageHandler\contentObjectDirectory
contentObjectDirectory()
Definition: ezcontentobjectpackagehandler.php:1638
eZContentObjectPackageHandler\UNINSTALL_OBJECTS_ERROR_RANGE_FROM
const UNINSTALL_OBJECTS_ERROR_RANGE_FROM
Definition: ezcontentobjectpackagehandler.php:29
eZContentObjectPackageHandler\add
add( $packageType, $package, $cli, $parameters)
Definition: ezcontentobjectpackagehandler.php:1421
eZContentObjectPackageHandler\explainInstallItem
explainInstallItem( $package, $installItem, $requestedInfo=array())
Definition: ezcontentobjectpackagehandler.php:86
eZContentObjectPackageHandler\$OverrideSettingsArray
$OverrideSettingsArray
Definition: ezcontentobjectpackagehandler.php:1734
eZContentObjectPackageHandler\installTemplates
installTemplates( $templateList, $package, $subdirectory, &$installParameters)
Definition: ezcontentobjectpackagehandler.php:1188
eZContentObjectPackageHandler\installOverrides
installOverrides( $overrideListNode, &$parameters)
Definition: ezcontentobjectpackagehandler.php:1258
eZContentObjectPackageHandler\installSuspendedNodeAssignment
installSuspendedNodeAssignment(&$installParameters)
Definition: ezcontentobjectpackagehandler.php:1090
eZContentObjectPackageHandler\__construct
__construct()
Definition: ezcontentobjectpackagehandler.php:32
eZContentObjectPackageHandler\$RootNodeIDArray
$RootNodeIDArray
Definition: ezcontentobjectpackagehandler.php:1730
eZContentObjectPackageHandler\$OverrideParentNodeRemoteID
$OverrideParentNodeRemoteID
Definition: ezcontentobjectpackagehandler.php:1741
eZContentObjectPackageHandler\INSTALL_OBJECTS_ERROR_RANGE_TO
const INSTALL_OBJECTS_ERROR_RANGE_TO
Definition: ezcontentobjectpackagehandler.php:28
eZContentObjectPackageHandler\createTopNodeListDOMNode
createTopNodeListDOMNode( $options)
Definition: ezcontentobjectpackagehandler.php:270
eZContentObjectPackageHandler\createSiteAccessListNode
createSiteAccessListNode( $options)
Definition: ezcontentobjectpackagehandler.php:295
eZContentObjectPackageHandler\$Package
$Package
Definition: ezcontentobjectpackagehandler.php:1736
eZContentObjectPackageHandler\createDOMNodeFromFile
createDOMNodeFromFile( $filename, $siteAccess, $filetype=false)
Definition: ezcontentobjectpackagehandler.php:533
eZContentObjectPackageHandler\getRealObjectNode
getRealObjectNode( $objectNode)
Definition: ezcontentobjectpackagehandler.php:59
eZContentObjectPackageHandler\createObjectListNode
createObjectListNode( $options)
Definition: ezcontentobjectpackagehandler.php:318
eZContentObjectPackageHandler\$HandlerType
$HandlerType
Definition: ezcontentobjectpackagehandler.php:19
eZContentObjectPackageHandler\addNode
addNode( $nodeID, $isSubtree=true)
Definition: ezcontentobjectpackagehandler.php:171
eZContentObjectPackageHandler\uninstall
uninstall( $package, $installType, $parameters, $name, $os, $filename, $subdirectory, $content, &$installParameters, &$installData)
Definition: ezcontentobjectpackagehandler.php:813
eZContentObjectPackageHandler\installFetchAliases
installFetchAliases( $fetchAliasListNode, &$parameters)
Definition: ezcontentobjectpackagehandler.php:1345
eZContentObjectPackageHandler\UNINSTALL_OBJECTS_ERROR_RANGE_TO
const UNINSTALL_OBJECTS_ERROR_RANGE_TO
Definition: ezcontentobjectpackagehandler.php:30
eZContentObjectPackageHandler\generateTemplateFilenameArray
& generateTemplateFilenameArray()
Definition: ezcontentobjectpackagehandler.php:485
eZContentObjectPackageHandler\installSuspendedObjectRelations
installSuspendedObjectRelations(&$installParameters)
Definition: ezcontentobjectpackagehandler.php:1147
eZContentObjectPackageHandler\$OverrideObjectRemoteID
$OverrideObjectRemoteID
Definition: ezcontentobjectpackagehandler.php:1739
eZContentObjectPackageHandler\generateOverrideSettingsArray
& generateOverrideSettingsArray( $siteAccessArray, $minimalTemplateSet)
Definition: ezcontentobjectpackagehandler.php:567
eZContentObjectPackageHandler\$RootNodeObjectArray
$RootNodeObjectArray
Definition: ezcontentobjectpackagehandler.php:1733
eZContentObjectPackageHandler\STORE_OBJECTS_TO_SEPARATE_FILES_THRESHOLD
const STORE_OBJECTS_TO_SEPARATE_FILES_THRESHOLD
Definition: ezcontentobjectpackagehandler.php:25
eZContentObjectPackageHandler\generateClassIDArray
& generateClassIDArray()
Definition: ezcontentobjectpackagehandler.php:798
eZContentObjectTreeNode\subtreeRemovalInformation
static subtreeRemovalInformation( $deleteIDArray)
Definition: ezcontentobjecttreenode.php:3826
eZContentObjectTreeNode\fetchByRemoteID
static fetchByRemoteID( $remoteID, $asObject=true)
Definition: ezcontentobjecttreenode.php:2933
eZContentObjectTreeNode\updateMainNodeID
static updateMainNodeID( $mainNodeID, $objectID, $version, $parentMainNodeID, $updateSection=true)
Definition: ezcontentobjecttreenode.php:2882
eZContentObjectTreeNode\fetch
static fetch( $nodeID=false, $lang=false, $asObject=true, $conditions=false)
Definition: ezcontentobjecttreenode.php:3058
eZContentObjectTreeNode\fetchByURLPath
static fetchByURLPath( $pathString, $asObject=true)
Definition: ezcontentobjecttreenode.php:2943
eZContentObjectTreeNode\removeSubtrees
static removeSubtrees( $deleteIDArray, $moveToTrash=true, $infoOnly=false)
Definition: ezcontentobjecttreenode.php:3847
eZContentObjectTreeNode\subTreeByNodeID
static subTreeByNodeID( $params=false, $nodeID=0)
Definition: ezcontentobjecttreenode.php:1940
eZContentObjectVersion\fetchVersion
static fetchVersion( $version, $contentObjectID, $asObject=true)
Definition: ezcontentobjectversion.php:166
eZContentObject\clearCache
static clearCache( $idArray=array())
Definition: ezcontentobject.php:284
eZContentObject\fetch
static fetch( $id, $asObject=true)
Definition: ezcontentobject.php:885
eZContentObject\PACKAGE_KEEP
const PACKAGE_KEEP
Definition: ezcontentobject.php:35
eZContentObject\PACKAGE_ERROR_HAS_CHILDREN
const PACKAGE_ERROR_HAS_CHILDREN
Definition: ezcontentobject.php:27
eZContentObject\fetchByRemoteID
static fetchByRemoteID( $remoteID, $asObject=true)
Definition: ezcontentobject.php:865
eZContentObject\PACKAGE_ERROR_MODIFIED
const PACKAGE_ERROR_MODIFIED
Definition: ezcontentobject.php:26
eZContentObject\PACKAGE_DELETE
const PACKAGE_DELETE
Definition: ezcontentobject.php:34
eZDataType\create
static create( $dataTypeString)
Definition: ezdatatype.php:151
eZDebug\writeError
static writeError( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:545
eZDebug\writeNotice
static writeNotice( $string, $label="", $backgroundClass="")
Definition: ezdebug.php:459
eZDir\mkdir
static mkdir( $dir, $perm=false, $recursive=false)
Definition: ezdir.php:73
eZDir\dirpath
static dirpath( $filepath)
Definition: ezdir.php:129
eZFileHandler\copy
static copy( $sourceFilename, $destinationFilename)
Definition: ezfilehandler.php:356
eZNodeAssignment\definition
static definition()
Definition: eznodeassignment.php:44
eZNodeAssignment\create
static create( $parameters=array())
Definition: eznodeassignment.php:193
eZOperationHandler\execute
static execute( $moduleName, $operationName, $operationParameters, $lastTriggerName=null, $useTriggers=true)
Definition: ezoperationhandler.php:42
eZPackageHandler
The class eZPackageHandler does.
Definition: ezpackagehandler.php:18
eZPackageHandler\handlerType
handlerType()
Definition: ezpackagehandler.php:69
eZPackageHandler\isErrorElement
isErrorElement( $elementID, &$installParameters)
Definition: ezpackagehandler.php:190
eZPackageHandler\errorChoosenAction
static errorChoosenAction( $errorCode, &$installParameters, $description, $handlerType, $resetError=true)
Definition: ezpackagehandler.php:213
eZPersistentObject\fetchObject
static fetchObject( $def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
Definition: ezpersistentobject.php:213
eZTemplateDesignResource\designStartPath
static designStartPath()
Definition: eztemplatedesignresource.php:798
eZTemplateDesignResource\overrideArray
static overrideArray( $siteAccess=false)
Definition: eztemplatedesignresource.php:828
eZUser\currentUserID
static currentUserID()
Definition: ezuser.php:1731
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+.