[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Created on: <27-Sep-2004 11:41:73 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 ezworkflowfunctions.php 28 */ 29 30 class eZWorkflowFunctions 31 { 32 function addGroup( $workflowID, $workflowVersion, $selectedGroup ) 33 { 34 include_once ( "kernel/classes/ezworkflowgrouplink.php" ); 35 36 list ( $groupID, $groupName ) = split( "/", $selectedGroup ); 37 $ingroup = eZWorkflowGroupLink::create( $workflowID, $workflowVersion, $groupID, $groupName ); 38 $ingroup->store(); 39 return true; 40 } 41 42 function removeGroup( $workflowID, $workflowVersion, $selectedGroup ) 43 { 44 include_once ( "kernel/classes/ezworkflow.php" ); 45 include_once ( "kernel/classes/ezworkflowgrouplink.php" ); 46 47 $workflow = eZWorkflow::fetch( $workflowID ); 48 if ( !$workflow ) 49 return false; 50 $groups = $workflow->attribute( 'ingroup_list' ); 51 foreach ( array_keys( $groups ) as $key ) 52 { 53 if ( in_array( $groups[$key]->attribute( 'group_id' ), $selectedGroup ) ) 54 { 55 unset( $groups[$key] ); 56 } 57 } 58 59 if ( count( $groups ) == 0 ) 60 { 61 return false; 62 } 63 else 64 { 65 $db =& eZDB::instance(); 66 $db->begin(); 67 foreach( $selectedGroup as $group_id ) 68 { 69 eZWorkflowGroupLink::remove( $workflowID, $workflowVersion, $group_id ); 70 } 71 $db->commit(); 72 } 73 return true; 74 } 75 } 76 77 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 10:30:04 2007 | par Balluche grâce à PHPXref 0.7 |