コード例 #1
0
     return $Module->handleError(eZError::KERNEL_NOT_AVAILABLE, 'kernel');
 }
 if (!$object->attribute('can_read')) {
     return $Module->handleError(eZError::KERNEL_ACCESS_DENIED, 'kernel');
 }
 $version = $object->currentVersion();
 $contentObjectAttributes = $version->contentObjectAttributes();
 $user = eZUser::currentUser();
 $isLoggedIn = $user->attribute('is_logged_in');
 $allowAnonymous = true;
 if (!$isLoggedIn) {
     $allowAnonymous = eZInformationCollection::allowAnonymous($object);
 }
 $newCollection = false;
 $collection = false;
 $userDataHandling = eZInformationCollection::userDataHandling($object);
 if ($userDataHandling == 'unique' or $userDataHandling == 'overwrite') {
     $collection = eZInformationCollection::fetchByUserIdentifier(eZInformationCollection::currentUserIdentifier(), $object->attribute('id'));
 }
 if (!$isLoggedIn and !$allowAnonymous or $userDataHandling == 'unique' and $collection) {
     $tpl = eZTemplate::factory();
     $attributeHideList = eZInformationCollection::attributeHideList();
     $informationCollectionTemplate = eZInformationCollection::templateForObject($object);
     $node = eZContentObjectTreeNode::fetch($NodeID);
     $collectionID = false;
     if ($collection) {
         $collectionID = $collection->attribute('id');
     }
     $tpl->setVariable('node_id', $node->attribute('node_id'));
     $tpl->setVariable('collection_id', $collectionID);
     $tpl->setVariable('collection', $collection);