[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/url/ -> list.php (source)

   1  <?php
   2  //
   3  // Created on: <23-Jan-2003 11:37:30 amos>
   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/datatypes/ezurl/ezurl.php' );
  28  include_once ( 'kernel/classes/ezpreferences.php' );
  29  
  30  $Module =& $Params['Module'];
  31  $ViewMode = $Params['ViewMode'];
  32  
  33  if( eZPreferences::value( 'admin_url_list_limit' ) )
  34  {
  35      switch( eZPreferences::value( 'admin_url_list_limit' ) )
  36      {
  37          case '2': { $limit = 25; } break;
  38          case '3': { $limit = 50; } break;
  39          default:  { $limit = 10; } break;
  40      }
  41  }
  42  else
  43  {
  44      $limit = 10;
  45  }
  46  
  47  $offset = $Params['Offset'];
  48  if ( !is_numeric( $offset ) )
  49  {
  50      $offset = 0;
  51  }
  52  
  53  if( $ViewMode != 'all' && $ViewMode != 'invalid' && $ViewMode != 'valid')
  54  {
  55      $ViewMode = 'all';
  56  }
  57  
  58  if ( $Module->isCurrentAction( 'SetValid' ) )
  59  {
  60      $urlSelection = $Module->actionParameter( 'URLSelection' );
  61      eZURL::setIsValid( $urlSelection, true );
  62  }
  63  else if ( $Module->isCurrentAction( 'SetInvalid' ) )
  64  {
  65      $urlSelection = $Module->actionParameter( 'URLSelection' );
  66      eZURL::setIsValid( $urlSelection, false );
  67  }
  68  
  69  
  70  if( $ViewMode == 'all' )
  71  {
  72      $listParameters = array( 'is_valid'       => null,
  73                               'offset'         => $offset,
  74                               'limit'          => $limit,
  75                               'only_published' => true );
  76  
  77      $countParameters = array( 'only_published' => true );
  78  }
  79  elseif( $ViewMode == 'valid' )
  80  {
  81      $listParameters = array( 'is_valid'       => true,
  82                               'offset'         => $offset,
  83                               'limit'          => $limit,
  84                               'only_published' => true );
  85  
  86      $countParameters = array( 'is_valid' => true,
  87                                'only_published' => true );
  88  }
  89  elseif( $ViewMode == 'invalid' )
  90  {
  91      $listParameters = array( 'is_valid'       => false,
  92                               'offset'         => $offset,
  93                               'limit'          => $limit,
  94                               'only_published' => true );
  95  
  96      $countParameters = array( 'is_valid' => false,
  97                                'only_published' => true );
  98  }
  99  
 100  $list = eZURL::fetchList( $listParameters );
 101  $listCount = eZURL::fetchListCount( $countParameters );
 102  
 103  $viewParameters = array( 'offset' => $offset, 'limit'  => $limit );
 104  
 105  include_once ( 'kernel/common/template.php' );
 106  $tpl =& templateInit();
 107  
 108  $tpl->setVariable( 'view_parameters', $viewParameters );
 109  $tpl->setVariable( 'url_list', $list );
 110  $tpl->setVariable( 'url_list_count', $listCount );
 111  $tpl->setVariable( 'view_mode', $ViewMode );
 112  
 113  $Result = array();
 114  $Result['content'] = $tpl->fetch( "design:url/list.tpl" );
 115  $Result['path'] = array( array( 'url' => false,
 116                                  'text' => ezi18n( 'kernel/url', 'URL' ) ),
 117                           array( 'url' => false,
 118                                  'text' => ezi18n( 'kernel/url', 'List' ) ) );
 119  ?>


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