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
|