[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Created on: <25-Sep-2003 12:47:21 bf> 4 // 5 // SOFTWARE NAME: eZ publish 6 // SOFTWARE RELEASE: 3.9.0 7 // BUILD VERSION: 17785 8 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 9 // SOFTWARE LICENSE: GNU General Public License v2.0 10 // NOTICE: > 11 // This program is free software; you can redistribute it and/or 12 // modify it under the terms of version 2.0 of the GNU General 13 // Public License as published by the Free Software Foundation. 14 // 15 // This program is distributed in the hope that it will be useful, 16 // but WITHOUT ANY WARRANTY; without even the implied warranty of 17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 // GNU General Public License for more details. 19 // 20 // You should have received a copy of version 2.0 of the GNU General 21 // Public License along with this program; if not, write to the Free 22 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 23 // MA 02110-1301, USA. 24 // 25 // 26 27 include_once ( 'kernel/classes/ezinformationcollection.php' ); 28 include_once ( 'kernel/common/template.php' ); 29 30 $module =& $Params['Module']; 31 32 $nodeID = $Params['NodeID']; 33 if ( !$nodeID ) 34 return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' ); 35 $node = eZContentObjectTreeNode::fetch( $nodeID ); 36 if ( !$node ) 37 return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' ); 38 $object =& $node->attribute( 'object' ); 39 if ( !$object ) 40 return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' ); 41 if ( !$object->attribute( 'can_read' ) ) 42 return $module->handleError( EZ_ERROR_KERNEL_ACCESS_DENIED, 'kernel' ); 43 44 // $http =& eZHTTPTool::instance(); 45 46 $tpl =& templateInit(); 47 48 $icMap = array(); 49 if ( eZHTTPTool::hasSessionVariable( 'InformationCollectionMap' ) ) 50 $icMap = eZHTTPTool::sessionVariable( 'InformationCollectionMap' ); 51 $icID = false; 52 if ( isset( $icMap[$object->attribute( 'id' )] ) ) 53 $icID = $icMap[$object->attribute( 'id' )]; 54 55 $informationCollectionTemplate = eZInformationCollection::templateForObject( $object ); 56 $attributeHideList = eZInformationCollection::attributeHideList(); 57 58 $tpl->setVariable( 'node_id', $nodeID ); 59 $tpl->setVariable( 'collection_id', $icID ); 60 $tpl->setVariable( 'node', $node ); 61 $tpl->setVariable( 'object', $object ); 62 $tpl->setVariable( 'attribute_hide_list', $attributeHideList ); 63 $tpl->setVariable( 'error', false ); 64 65 $section = eZSection::fetch( $object->attribute( 'section_id' ) ); 66 if ( $section ) 67 $navigationPartIdentifier = $section->attribute( 'navigation_part_identifier' ); 68 69 $res =& eZTemplateDesignResource::instance(); 70 $res->setKeys( array( array( 'object', $object->attribute( 'id' ) ), 71 array( 'node', $node->attribute( 'node_id' ) ), 72 array( 'parent_node', $node->attribute( 'parent_node_id' ) ), 73 array( 'class', $object->attribute( 'contentclass_id' ) ), 74 array( 'navigation_part_identifier', $navigationPartIdentifier ), 75 array( 'depth', $node->attribute( 'depth' ) ), 76 array( 'url_alias', $node->attribute( 'url_alias' ) ), 77 array( 'class_identifier', $node->attribute( 'class_identifier' ) ) 78 ) ); 79 80 81 $Result['content'] =& $tpl->fetch( 'design:content/collectedinfo/' . $informationCollectionTemplate . '.tpl' ); 82 83 $title = $object->attribute( 'name' ); 84 if ( $tpl->hasVariable( 'title' ) ) 85 $title = $tpl->variable( 'title' ); 86 87 // create path 88 $parents =& $node->attribute( 'path' ); 89 90 $path = array(); 91 $titlePath = array(); 92 foreach ( $parents as $parent ) 93 { 94 $path[] = array( 'text' => $parent->attribute( 'name' ), 95 'url' => '/content/view/full/' . $parent->attribute( 'node_id' ), 96 'url_alias' => $parent->attribute( 'url_alias' ), 97 'node_id' => $parent->attribute( 'node_id' ) 98 ); 99 } 100 $path[] = array( 'text' => $object->attribute( 'name' ), 101 'url' => '/content/view/full/' . $node->attribute( 'node_id' ), 102 'url_alias' => $node->attribute( 'url_alias' ), 103 'node_id' => $node->attribute( 'node_id' ) ); 104 105 array_shift( $parents ); 106 foreach ( $parents as $parent ) 107 { 108 $titlePath[] = array( 'text' => $parent->attribute( 'name' ), 109 'url' => '/content/view/full/' . $parent->attribute( 'node_id' ), 110 'url_alias' => $parent->attribute( 'url_alias' ), 111 'node_id' => $parent->attribute( 'node_id' ) 112 ); 113 } 114 $titlePath[] = array( 'text' => $title, 115 'url' => '/content/view/full/' . $node->attribute( 'node_id' ), 116 'url_alias' => $node->attribute( 'url_alias' ), 117 'node_id' => $node->attribute( 'node_id' ) ); 118 119 $Result['path'] =& $path; 120 $Result['title_path'] =& $titlePath; 121 122 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |