[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/kernel/class/ -> ezclassfunctions.php (source)

   1  <?php
   2  //
   3  // Created on: <24-Sep-2004 13:20:32 jk>
   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  /*! \file ezclassfunctions.php
  28  */
  29  
  30  class eZClassFunctions
  31  {
  32      function addGroup( $classID, $classVersion, $selectedGroup )
  33      {
  34          include_once ( 'kernel/classes/ezcontentclassclassgroup.php' );
  35          list ( $groupID, $groupName ) = split( '/', $selectedGroup );
  36          $ingroup = eZContentClassClassGroup::create( $classID, $classVersion, $groupID, $groupName );
  37          $ingroup->store();
  38          return true;
  39      }
  40  
  41      function removeGroup( $classID, $classVersion, $selectedGroup )
  42      {
  43          include_once ( 'kernel/classes/ezcontentclass.php' );
  44          include_once ( 'kernel/classes/ezcontentclassclassgroup.php' );
  45  
  46          $class = eZContentClass::fetch( $classID, true, EZ_CLASS_VERSION_STATUS_DEFINED );
  47          if ( !$class )
  48              return false;
  49          $groups = $class->attribute( 'ingroup_list' );
  50          foreach ( array_keys( $groups ) as $key )
  51          {
  52              if ( in_array( $groups[$key]->attribute( 'group_id' ), $selectedGroup ) )
  53              {
  54                  unset( $groups[$key] );
  55              }
  56          }
  57  
  58          if ( count( $groups ) == 0 )
  59          {
  60              return false;
  61          }
  62          else
  63          {
  64              foreach(  $selectedGroup as $group_id )
  65              {
  66                  eZContentClassClassGroup::remove( $classID, $classVersion, $group_id );
  67              }
  68          }
  69          return true;
  70      }
  71  }
  72  
  73  ?>


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