Index: kernel/classes/ezcontentobject.php =================================================================== --- kernel/classes/ezcontentobject.php (revision 21391) +++ kernel/classes/ezcontentobject.php (working copy) @@ -75,13 +75,15 @@ function eZContentObject( $row ) { $this->eZPersistentObject( $row ); + $this->ClassIdentifier = false; if ( isset( $row['contentclass_identifier'] ) ) $this->ClassIdentifier = $row['contentclass_identifier']; + $this->ClassName = false; if ( isset( $row['contentclass_name'] ) ) $this->ClassName = $row['contentclass_name']; - if ( isset( $row['serialized_name_list'] ) ) + else if ( isset( $row['serialized_name_list'] ) ) $this->ClassName = eZContentClass::nameFromSerializedString( $row['serialized_name_list'] ); $this->CurrentLanguage = false; @@ -3427,7 +3429,9 @@ } $query = "SELECT ezcontentobject.*, ezcontentobject_tree.*, - ezcontentclass.serialized_name_list as class_serialized_name_list + ezcontentclass.serialized_name_list as class_serialized_name_list, + ezcontentclass.identifier as class_identifier, + ezcontentclass.is_container as is_container FROM ezcontentobject_tree, ezcontentobject, ezcontentclass Index: kernel/classes/ezcontentobjecttreenode.php =================================================================== --- kernel/classes/ezcontentobjecttreenode.php (revision 21391) +++ kernel/classes/ezcontentobjecttreenode.php (working copy) @@ -186,7 +186,8 @@ 'class_name' => 'className', 'hidden_invisible_string' => 'hiddenInvisibleString', 'hidden_status_string' => 'hiddenStatusString', - 'classes_js_array' => 'availableClassesJsArray' ), + 'classes_js_array' => 'availableClassesJsArray', + 'is_container' => 'classIsContainer' ), "increment_key" => "node_id", "class_name" => "eZContentObjectTreeNode", "name" => "ezcontentobject_tree" ); @@ -2072,7 +2073,8 @@ ezcontentobject.*, ezcontentobject_tree.*, ezcontentclass.serialized_name_list as class_serialized_name_list, - ezcontentclass.identifier as class_identifier + ezcontentclass.identifier as class_identifier, + ezcontentclass.is_container as is_container $groupBySelectText $versionNameTargets $sortingInfo[attributeTargetSQL] @@ -3484,11 +3486,18 @@ $db = eZDB::instance(); $contentObjectID =(int) $contentObjectID; $parentNodeID =(int) $parentNodeID; - $query = "SELECT ezcontentobject_tree.* - FROM ezcontentobject_tree, ezcontentobject + $query = "SELECT ezcontentobject_tree.*, + ezcontentclass.serialized_name_list as class_serialized_name_list, + ezcontentclass.identifier as class_identifier, + ezcontentclass.is_container as is_container + FROM ezcontentobject_tree, + ezcontentobject, + ezcontentclass WHERE ezcontentobject_tree.contentobject_id = '$contentObjectID' AND ezcontentobject.id = '$contentObjectID' AND - ezcontentobject_tree.parent_node_id = '$parentNodeID' AND ". + ezcontentobject_tree.parent_node_id = '$parentNodeID' AND + ezcontentclass.version=0 AND + ezcontentclass.id = ezcontentobject.contentclass_id AND". eZContentLanguage::languagesSQLFilter( 'ezcontentobject' ); $nodeListArray = $db->arrayQuery( $query ); @@ -3556,7 +3565,8 @@ $query = "SELECT ezcontentobject.*, ezcontentobject_tree.*, ezcontentclass.serialized_name_list as class_serialized_name_list, - ezcontentclass.identifier as class_identifier + ezcontentclass.identifier as class_identifier, + ezcontentclass.is_container as is_container $versionNameTargets FROM ezcontentobject_tree, ezcontentobject, @@ -5366,8 +5376,6 @@ if ( !is_array( $array ) ) return $retNodes; - $ini = eZINI::instance(); - foreach ( $array as $node ) { unset( $object ); @@ -5393,9 +5401,13 @@ } if ( isset( $node['class_identifier'] ) ) $object->ClassIdentifier = $node['class_identifier']; + + if ( isset( $node['is_container'] ) ) + $object->ClassIsContainer = $node['is_container']; + if ( $with_contentobject ) { - if ( array_key_exists( 'class_name', $node ) ) + if ( isset( $node['class_name'] ) ) { unset( $node['remote_id'] ); $contentObject = new eZContentObject( $node ); @@ -5884,21 +5896,16 @@ /*! \return the cached value of the class identifier if it exists, it not it's fetched dynamically */ - function classIdentifier() + public function classIdentifier() { - $identifier = ''; - if ( $this->ClassIdentifier !== null ) - { - $identifier = $this->ClassIdentifier; - } - else + if ( $this->ClassIdentifier === null ) { $object = $this->object(); $class = $object->contentClass(); - $identifier = $class->attribute( 'identifier' ); + $this->ClassIdentifier = $class->attribute( 'identifier' ); } - return $identifier; + return $this->ClassIdentifier; } /*! @@ -5904,16 +5911,30 @@ /*! \return the cached value of the class name if it exists, it not it's fetched dynamically */ - function className() + public function className() { - if ( $this->ClassName !== null ) + if ( $this->ClassName === null ) { - return $this->ClassName; + $object = $this->object(); + $class = $object->contentClass(); + $this->ClassName = $class->attribute( 'name' ); } - $object = $this->object(); - $class = $object->contentClass(); - return $class->attribute( 'name' ); + return $this->ClassName; + } + + /*! + \return the cached value of the class is_container if it exists, it not it's fetched dynamically + */ + public function classIsContainer() + { + if ( $this->ClassIsContainer === null ) + { + $obj = $this->object(); + $class = $obj->attribute( 'content_class' ); + $this->ClassIsContainer = $class->attribute( 'is_container' ); + } + return $this->ClassIsContainer; } /*! @@ -6347,6 +6368,7 @@ /// Contains the cached value of the class identifier public $ClassIdentifier = null; public $ClassName = null; + protected $ClassIsContainer = null; } ?>