Monday 05 May 2003 12:47:54 am
include_once( "kernel/classes/ezcontentclass.php" );
include_once( "kernel/classes/eznodeassignment.php"); include_once( "kernel/content/ezcontentoperationcollection.php" );
$node =& eZContentObjectTreeNode::fetch( 2 );
$parentContentObject =& $node->attribute( 'object' ); $sectionID = $parentContentObject->attribute( 'section_id' );
$class =& eZContentClass::fetch( 1 );
$contentObject =& $class->instantiate( 14, $sectionID ); $contentObject->setName( "MyNewFolder" ); $contentObject->store();
$nodeAssignment =& eZNodeAssignment::create( array(
'contentobject_id' => $contentObject->attribute( 'id' ),
'contentobject_version' => $contentObject->attribute( 'current_version' ),
'parent_node' => $node->attribute( 'node_id' ),
'is_main' => 1
)
);
$nodeAssignment->store();
include_once( 'lib/ezutils/classes/ezoperationhandler.php' );
$operationResult =& eZOperationHandler::execute( 'content', 'publish', array( 'object_id' => $contentObject->attribute( 'id' ), 'version' =>1 ) ); $contentObject =& eZContentObject::fetch( $contentObject->attribute( 'id' ) );
|