[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/package/ -> view.php (source)

   1  <?php
   2  //
   3  // Created on: <11-Aug-2003 18:12:39 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/common/template.php" );
  28  include_once ( "kernel/classes/ezpackage.php" );
  29  
  30  $module =& $Params['Module'];
  31  $viewMode = $Params['ViewMode'];
  32  $packageName = $Params['PackageName'];
  33  $repositoryID = false;
  34  if ( isset( $Params['RepositoryID'] ) and $Params['RepositoryID'] )
  35      $repositoryID = $Params['RepositoryID'];
  36  
  37  $package = eZPackage::fetch( $packageName, false, $repositoryID );
  38  if ( !is_object( $package ) )
  39      return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
  40  
  41  if ( !$package->attribute( 'can_read' ) )
  42      return $module->handleError( EZ_ERROR_KERNEL_ACCESS_DENIED, 'kernel' );
  43  
  44  
  45  if ( $module->isCurrentAction( 'Export' ) )
  46  {
  47      return $module->run( 'export', array( $packageName ) );
  48  }
  49  else if ( $module->isCurrentAction( 'Install' ) )
  50  {
  51      return $module->redirectToView( 'install', array( $packageName ) );
  52  }
  53  else if ( $module->isCurrentAction( 'Uninstall' ) )
  54  {
  55      return $module->redirectToView( 'uninstall', array( $packageName ) );
  56  }
  57  
  58  $repositoryInformation = $package->currentRepositoryInformation();
  59  
  60  $tpl =& templateInit();
  61  
  62  $tpl->setVariable( 'package_name', $packageName );
  63  $tpl->setVariable( 'repository_id', $repositoryID );
  64  
  65  $Result = array();
  66  $Result['content'] =& $tpl->fetch( "design:package/view/$viewMode.tpl" );
  67  $path = array( array( 'url' => 'package/list',
  68                        'text' => ezi18n( 'kernel/package', 'Packages' ) ) );
  69  if ( $repositoryInformation and $repositoryInformation['id'] != 'local' )
  70  {
  71      $path[] = array( 'url' => 'package/list/' . $repositoryInformation['id'],
  72                       'text' => $repositoryInformation['name'] );
  73  }
  74  $path[] = array( 'url' => false,
  75                   'text' => $package->attribute( 'name' ) );
  76  $Result['path'] = $path;
  77  
  78  ?>


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