Ejemplo n.º 1
0
 /**
  * Executes the PHP function for the operator cleanup and modifies $operatorValue.
  * 
  * @param eZTemplate $tpl
  * @param string $operatorName
  * @param array $operatorParameters
  * @param string $rootNamespace
  * @param string $currentNamespace
  * @param mixed $operatorValue
  * @param array $namedParameters
  */
 public function modify($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters)
 {
     $objectId = $namedParameters['object_id'];
     switch ($operatorName) {
         case 'pagelink':
             $links = array();
             $ini = eZINI::instance('block.ini');
             $items = eZFlowPoolItem::fetchListByContentObjectId($objectId);
             foreach ($items as $item) {
                 $block = $item->attribute('block');
                 $node = $block->attribute('node');
                 if (!$node->attribute('can_read')) {
                     continue;
                 }
                 $nodeId = $node->attribute('node_id');
                 $links[$nodeId]['node'] = $node;
                 if ($block->attribute('name') == '') {
                     $block->setAttribute('name', $ini->variable($block->attribute('block_type'), 'Name'));
                 }
                 $links[$nodeId]['blocks'][] = $block;
             }
             $operatorValue = $links;
             break;
     }
 }