Howto filter out hidden nodes in ezflow

Author Message

Georg Schröder

Tuesday 19 May 2009 6:01:47 am

Hello,
can anyone tell me how to filter out hidden nodes in the fetch-function of ezFlow?
Obviously the function

eZContentObjectTreeNode::subTreeByNodeID( $subTreeParameters, $nodeID )

ignores, if a node is visible or not.

Here is the complete code:

----------------------------------------------------------------------------

class fetchtopnews extends eZFlowFetchInterface
{
function fetch( $parameters, $publishedAfter, $publishedBeforeOrAt )
{
if ( isset( $parameters['Source'] ) )
{
$nodeID = $parameters['Source'];
$node = eZContentObjectTreeNode::fetch( $nodeID, false, false ); // not as an object
}
else
{
$nodeID = 0;
}

$subTreeParameters = array();
$subTreeParameters['AsObject'] = false;
$subTreeParameters['SortBy'] = array( 'published', false );
$subTreeParameters['Limit'] = isset( $parameters['Limit'] ) ? $parameters['Limit']:false;
$subTreeParameters['Depth'] = isset( $parameters['Depth'] ) ? $parameters['Depth']:false;

if ( isset( $parameters['Class'] ) )
{
$subTreeParameters['ClassFilterType'] = 'include';
$subTreeParameters['ClassFilterArray'] = explode( ';', $parameters['Class'] );
}

$subTreeParameters['AttributeFilter'] = array( array('article/top_news', '=', 1 ) );

$result = eZContentObjectTreeNode::subTreeByNodeID( $subTreeParameters, $nodeID );
$fetchResult = array();

foreach( $result as $item )
{
$fetchResult[] = array( 'object_id' => $item['contentobject_id'],
'node_id' => $item['node_id'],
'ts_publication' => $item['published'] );
}
// shuffle($fetchResult);
return $fetchResult;
}
}
----------------------------------------------------------------------------
Please help!

Thanks a lot!

Georg

Bin LIU

Tuesday 19 May 2009 6:27:45 am

 $params["IgnoreVisibility"] = true


$list = eZContentObjectTreeNode::subTreeByNodeID( $params, 2222222 )

:-;

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.