Wednesday 04 March 2009 9:31:30 pm
Create a temple operator called for example tracksoftware() that would take two parameters:
- function name: 'set' or 'get' - $node_id (or $object_id, up to your needs). The core code for the operator should look something like: $http = eZHTTPTool::instance(); // if it is not there already
$trackSoftwareSessionVariable = 'PaulTrackSoftware';
$operatorValue = false;
if( $function == 'get' )
{
if( $http->hasSessionVariable( $trackSoftwareSessionVariable ) )
{
$operatorValue = $http->sessionVariable( $trackSoftwareSessionVariable );
}
}
if( $function == 'set' )
{
$nodeIDArray = array();
if( $http->hasSessionVariable( $trackSoftwareSessionVariable ) )
{
$nodeIDArray = $http->sessionVariable( $trackSoftwareSessionVariable );
}
if( !in_array( $nodeID, $nodeIDArray ) )
{
$nodeIDArray[] = $nodeID;
}
$http->setSessionVariable( $trackSoftwareSessionVariable, $nodeIDArray );
$operatorValue = true;
}
This may be buggy, but should get you pretty close to where I think you want to get...
--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu
|