[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/collaboration/ -> ezcollaborationfunctioncollection.php (source)

   1  <?php
   2  //
   3  // Definition of eZCollaborationFunctionCollection class
   4  //
   5  // Created on: <06-Oct-2002 16:19:31 amos>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezcontentfunctioncollection.php
  30  */
  31  
  32  /*!
  33    \class eZCollaborationFunctionCollection ezcontentfunctioncollection.php
  34    \brief The class eZCollaborationFunctionCollection does
  35  
  36  */
  37  
  38  include_once ( 'kernel/error/errors.php' );
  39  
  40  class eZCollaborationFunctionCollection
  41  {
  42      /*!
  43       Constructor
  44      */
  45      function eZCollaborationFunctionCollection()
  46      {
  47      }
  48  
  49      function fetchParticipant( $itemID, $participantID )
  50      {
  51          include_once ( 'kernel/classes/ezcollaborationitemparticipantlink.php' );
  52          if ( $participantID === false )
  53          {
  54              include_once ( 'kernel/classes/datatypes/ezuser/ezuser.php' );
  55              $user =& eZUser::currentUser();
  56              $participantID = $user->attribute( 'contentobject_id' );
  57          }
  58          $participant =& eZCollaborationItemParticipantLink::fetch( $itemID, $participantID );
  59          if ( $participant === null )
  60          {
  61              $resultArray = array( 'error' => array( 'error_type' => 'kernel',
  62                                                      'error_code' => EZ_ERROR_KERNEL_NOT_FOUND ) );
  63          }
  64          else
  65          {
  66              $resultArray = array( 'result' => &$participant );
  67          }
  68          return $resultArray;
  69      }
  70  
  71      function fetchParticipantList( $itemID, $sortBy, $offset, $limit )
  72      {
  73          include_once ( 'kernel/classes/ezcollaborationitemparticipantlink.php' );
  74          $itemParameters = array( 'item_id' => $itemID,
  75                                   'offset' => $offset,
  76                                   'limit' => $limit,
  77                                   'sort_by' => $sortBy );
  78          $children =& eZCollaborationItemParticipantLink::fetchParticipantList( $itemParameters );
  79          if ( $children === null )
  80          {
  81              $resultArray = array( 'error' => array( 'error_type' => 'kernel',
  82                                                      'error_code' => EZ_ERROR_KERNEL_NOT_FOUND ) );
  83          }
  84          else
  85          {
  86              $resultArray = array( 'result' => &$children );
  87          }
  88          return $resultArray;
  89      }
  90  
  91      function fetchParticipantMap( $itemID, $sortBy, $offset, $limit, $field )
  92      {
  93          include_once ( 'kernel/classes/ezcollaborationitemparticipantlink.php' );
  94          $itemParameters = array( 'item_id' => $itemID,
  95                                   'offset' => $offset,
  96                                   'limit' => $limit,
  97                                   'sort_by' => $sortBy );
  98          if ( $field !== false )
  99              $itemParameters['sort_field'] = $field;
 100          $children =& eZCollaborationItemParticipantLink::fetchParticipantMap( $itemParameters );
 101          if ( $children === null )
 102          {
 103              $resultArray = array( 'error' => array( 'error_type' => 'kernel',
 104                                                      'error_code' => EZ_ERROR_KERNEL_NOT_FOUND ) );
 105          }
 106          else
 107          {
 108              $resultArray = array( 'result' => &$children );
 109          }
 110          return $resultArray;
 111      }
 112  
 113      function fetchMessageList( $itemID, $sortBy, $offset, $limit )
 114      {
 115          include_once ( 'kernel/classes/ezcollaborationitemmessagelink.php' );
 116          $itemParameters = array( 'item_id' => $itemID,
 117                                   'offset' => $offset,
 118                                   'limit' => $limit,
 119                                   'sort_by' => $sortBy );
 120          $children = eZCollaborationItemMessageLink::fetchItemList( $itemParameters );
 121          if ( $children === null )
 122          {
 123              $resultArray = array( 'error' => array( 'error_type' => 'kernel',
 124                                                      'error_code' => EZ_ERROR_KERNEL_NOT_FOUND ) );
 125          }
 126          else
 127          {
 128              $resultArray = array( 'result' => &$children );
 129          }
 130          return $resultArray;
 131      }
 132  
 133      function fetchItemList( $sortBy, $offset, $limit, $status, $isRead, $isActive, $parentGroupID )
 134      {
 135          include_once ( 'kernel/classes/ezcollaborationitem.php' );
 136          $itemParameters = array( 'offset' => $offset,
 137                                   'limit' => $limit,
 138                                   'sort_by' => $sortBy,
 139                                   'is_read' => $isRead,
 140                                   'is_active' => $isActive,
 141                                   'parent_group_id' => $parentGroupID );
 142          if ( $status !== false )
 143              $itemParameters['status'] = $status;
 144          $children = eZCollaborationItem::fetchList( $itemParameters );
 145          if ( $children === null )
 146              return array( 'error' => array( 'error_type' => 'kernel',
 147                                              'error_code' => EZ_ERROR_KERNEL_NOT_FOUND ) );
 148          return array( 'result' => &$children );
 149      }
 150  
 151      function fetchItemCount( $isRead, $isActive, $parentGroupID, $status )
 152      {
 153          include_once ( 'kernel/classes/ezcollaborationitem.php' );
 154  
 155          $itemParameters = array( 'is_read' => $isRead,
 156                                   'is_active' => $isActive,
 157                                   'parent_group_id' => $parentGroupID
 158                                   );
 159          if ( $status !== false )
 160              $itemParameters['status'] = $status;
 161          $count = eZCollaborationItem::fetchListCount( $itemParameters );
 162          return array( 'result' => $count );
 163      }
 164  
 165      function fetchGroupTree( $parentGroupID, $sortBy, $offset, $limit, $depth )
 166      {
 167          include_once ( 'kernel/classes/ezcollaborationgroup.php' );
 168          $treeParameters = array( 'parent_group_id' => $parentGroupID,
 169                                   'offset' => $offset,
 170                                   'limit' => $limit,
 171                                   'sort_by' => $sortBy,
 172                                   'depth' => $depth );
 173          $children =& eZCollaborationGroup::subTree( $treeParameters );
 174          if ( $children === null )
 175              return array( 'error' => array( 'error_type' => 'kernel',
 176                                              'error_code' => EZ_ERROR_KERNEL_NOT_FOUND ) );
 177          return array( 'result' => &$children );
 178      }
 179  
 180      function fetchObjectTreeCount( $parentNodeID, $class_filter_type, $class_filter_array, $depth )
 181      {
 182          include_once ( 'kernel/classes/ezcontentobjecttreenode.php' );
 183          $node = eZContentObjectTreeNode::fetch( $parentNodeID );
 184          $childrenCount = $node->subTreeCount( array( 'Limitation' => null,
 185                                                       'ClassFilterType' => $class_filter_type,
 186                                                       'ClassFilterArray' => $class_filter_array,
 187                                                       'Depth' => $depth ) );
 188          if ( $childrenCount === null )
 189          {
 190              $resultArray = array( 'error' => array( 'error_type' => 'kernel',
 191                                                      'error_code' => EZ_ERROR_KERNEL_NOT_FOUND ) );
 192          }
 193          else
 194          {
 195              $resultArray = array( 'result' => &$childrenCount );
 196          }
 197          return $resultArray;
 198      }
 199  
 200  }
 201  
 202  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7