[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/section/ -> assign.php (source)

   1  <?php
   2  //
   3  // Created on: <27-Aug-2002 17:06:06 bf>
   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 ( "lib/ezutils/classes/ezhttptool.php" );
  28  include_once ( "lib/ezdb/classes/ezdb.php" );
  29  include_once ( "kernel/classes/ezsection.php" );
  30  include_once ( "kernel/classes/ezcontentobjecttreenode.php" );
  31  include_once ( "kernel/classes/ezcontentbrowse.php" );
  32  include_once ( "kernel/common/template.php" );
  33  
  34  $http =& eZHTTPTool::instance();
  35  $SectionID =& $Params["SectionID"];
  36  $Module =& $Params["Module"];
  37  
  38  if ( $http->hasPostVariable( 'BrowseCancelButton' ) )
  39  {
  40      if ( $http->hasPostVariable( 'BrowseCancelURI' ) )
  41      {
  42          return $Module->redirectTo( $http->postVariable( 'BrowseCancelURI' ) );
  43      }
  44  }
  45  
  46  $section = eZSection::fetch( $SectionID );
  47  
  48  // Redirect to content node browse
  49  
  50  // Assign section to subtree of node
  51  if ( $Module->isCurrentAction( 'AssignSection' ) )
  52  {
  53      $selectedNodeIDArray = eZContentBrowse::result( 'AssignSection' );
  54  
  55      $db =& eZDB::instance();
  56      $db->begin();
  57      foreach ( $selectedNodeIDArray as $nodeID )
  58      {
  59          eZContentObjectTreeNode::assignSectionToSubTree( $nodeID, $section->attribute( 'id' ) );
  60      }
  61      $db->commit();
  62      if ( count( $selectedNodeIDArray ) > 0 )
  63      {
  64          include_once ( 'kernel/classes/ezcontentcachemanager.php' );
  65          eZContentCacheManager::clearAllContentCache();
  66      }
  67      $Module->redirectTo( "/section/list/" );
  68  }
  69  else
  70  {
  71      eZContentBrowse::browse( array( 'action_name' => 'AssignSection',
  72                                      'keys' => array(),
  73                                      'description_template' => 'design:section/browse_assign.tpl',
  74                                      'content' => array( 'section_id' => $section->attribute( 'id' ) ),
  75                                      'from_page' => '/section/assign/' . $section->attribute( 'id' ) . "/",
  76                                      'cancel_page' => '/section/list' ),
  77                               $Module );
  78      return;
  79  }
  80  
  81  ?>


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