[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/infocollector/ -> collectionlist.php (source)

   1  <?php
   2  //
   3  // Created on: <13-Feb-2005 03:13:00 bh>
   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/ezcontentobject.php' );
  28  include_once ( 'kernel/classes/ezinformationcollection.php' );
  29  include_once ( 'kernel/common/template.php' );
  30  include_once ( 'kernel/classes/ezpreferences.php' );
  31  
  32  $http =& eZHTTPTool::instance();
  33  $module =& $Params['Module'];
  34  $objectID = $Params['ObjectID'];
  35  $offset = $Params['Offset'];
  36  
  37  if( !is_numeric( $offset ) )
  38  {
  39      $offset = 0;
  40  }
  41  
  42  
  43  if( $module->isCurrentAction( 'RemoveCollections' ) && $http->hasPostVariable( 'CollectionIDArray' ) )
  44  {
  45      $collectionIDArray = $http->postVariable( 'CollectionIDArray' );
  46      $http->setSessionVariable( 'CollectionIDArray', $collectionIDArray );
  47      $http->setSessionVariable( 'ObjectID', $objectID );
  48  
  49      $collections = count( $collectionIDArray );
  50  
  51      $tpl =& templateInit();
  52      $tpl->setVariable( 'module', $module );
  53      $tpl->setVariable( 'collections', $collections );
  54      $tpl->setVariable( 'object_id', $objectID );
  55      $tpl->setVariable( 'remove_type', 'collections' );
  56  
  57      $Result = array();
  58      $Result['content'] =& $tpl->fetch( 'design:infocollector/confirmremoval.tpl' );
  59      $Result['path'] = array( array( 'url' => false,
  60                                      'text' => ezi18n( 'kernel/infocollector', 'Collected information' ) ) );
  61      return;
  62  }
  63  
  64  
  65  if( $module->isCurrentAction( 'ConfirmRemoval' ) )
  66  {
  67      $collectionIDArray =& $http->sessionVariable( 'CollectionIDArray' );
  68  
  69      if( is_array( $collectionIDArray ) )
  70      {
  71          foreach( $collectionIDArray as $collectionID )
  72          {
  73              eZInformationCollection::removeCollection( $collectionID );
  74          }
  75      }
  76  
  77      $objectID = $http->sessionVariable( 'ObjectID' );
  78      $module->redirectTo( '/infocollector/collectionlist/' . $objectID );
  79  }
  80  
  81  
  82  if( eZPreferences::value( 'admin_infocollector_list_limit' ) )
  83  {
  84      switch( eZPreferences::value( 'admin_infocollector_list_limit' ) )
  85      {
  86          case '2': { $limit = 25; } break;
  87          case '3': { $limit = 50; } break;
  88          default:  { $limit = 10; } break;
  89      }
  90  }
  91  else
  92  {
  93      $limit = 10;
  94  }
  95  
  96  $object = false;
  97  
  98  if( is_numeric( $objectID ) )
  99  {
 100      $object =& eZContentObject::fetch( $objectID );
 101  }
 102  
 103  if( !$object )
 104  {
 105      return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
 106  }
 107  
 108  $collections = eZInformationCollection::fetchCollectionsList( $objectID, /* object id */
 109                                                                false, /* creator id */
 110                                                                false, /* user identifier */
 111                                                                array( 'limit' => $limit,'offset' => $offset ) /* limit array */ );
 112  $numberOfCollections = eZInformationCollection::fetchCollectionsCount( $objectID );
 113  
 114  $viewParameters = array( 'offset' => $offset );
 115  $objectName = $object->attribute( 'name' );
 116  
 117  $tpl =& templateInit();
 118  $tpl->setVariable( 'module', $module );
 119  $tpl->setVariable( 'limit', $limit );
 120  $tpl->setVariable( 'view_parameters', $viewParameters );
 121  $tpl->setVariable( 'object', $object );
 122  $tpl->setVariable( 'collection_array', $collections );
 123  $tpl->setVariable( 'collection_count', $numberOfCollections );
 124  
 125  $Result = array();
 126  $Result['content'] =& $tpl->fetch( 'design:infocollector/collectionlist.tpl' );
 127  $Result['path'] = array( array( 'url' => '/infocollector/overview',
 128                                  'text' => ezi18n( 'kernel/infocollector', 'Collected information' ) ),
 129                           array( 'url' => false,
 130                                  'text' => $objectName ) );
 131  
 132  ?>


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