[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // 4 // SOFTWARE NAME: eZ publish 5 // SOFTWARE RELEASE: 3.9.0 6 // BUILD VERSION: 17785 7 // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS 8 // SOFTWARE LICENSE: GNU General Public License v2.0 9 // NOTICE: > 10 // This program is free software; you can redistribute it and/or 11 // modify it under the terms of version 2.0 of the GNU General 12 // Public License as published by the Free Software Foundation. 13 // 14 // This program is distributed in the hope that it will be useful, 15 // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 // GNU General Public License for more details. 18 // 19 // You should have received a copy of version 2.0 of the GNU General 20 // Public License along with this program; if not, write to the Free 21 // Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 22 // MA 02110-1301, USA. 23 // 24 // 25 26 27 include_once ( "kernel/classes/ezcontentclass.php" ); 28 include_once ( "lib/ezutils/classes/ezhttppersistence.php" ); 29 include_once ( "kernel/classes/ezcontentclassclassgroup.php" ); 30 31 $Module =& $Params["Module"]; 32 $http =& eZHTTPTool::instance(); 33 $deleteIDArray = $http->sessionVariable( "DeleteGroupIDArray" ); 34 $groupsInfo = array(); 35 $deleteResult = array(); 36 $deleteClassIDList = array(); 37 foreach ( $deleteIDArray as $deleteID ) 38 { 39 $deletedClassName = ''; 40 $group = eZContentClassGroup::fetch( $deleteID ); 41 if ( $group != null ) 42 { 43 $GroupName = $group->attribute( 'name' ); 44 $classList = eZContentClassClassGroup::fetchClassList( null, $deleteID ); 45 $groupClassesInfo = array(); 46 foreach ( $classList as $class ) 47 { 48 $classID = $class->attribute( "id" ); 49 $classGroups = eZContentClassClassGroup::fetchGroupList( $classID, 0); 50 if ( count( $classGroups ) == 1 ) 51 { 52 $classObject = eZContentclass::fetch( $classID ); 53 $className = $classObject->attribute( "name" ); 54 $deletedClassName .= " '" . $className . "'" ; 55 $deleteClassIDList[] = $classID; 56 $groupClassesInfo[] = array( 'class_name' => $className, 57 'object_count' => $classObject->objectCount() ); 58 } 59 } 60 if ( $deletedClassName == '' ) 61 $deletedClassName = ezi18n( 'kernel/class', '(no classes)' ); 62 $deleteResult[] = array( 'groupName' => $GroupName, 63 'deletedClassName' => $deletedClassName ); 64 $groupsInfo[] = array( 'group_name' => $GroupName, 65 'class_list' => $groupClassesInfo ); 66 } 67 } 68 if ( $http->hasPostVariable( "ConfirmButton" ) ) 69 { 70 foreach ( $deleteIDArray as $deleteID ) 71 { 72 eZContentClassGroup::removeSelected( $deleteID ); 73 eZContentClassClassGroup::removeGroupMembers( $deleteID ); 74 foreach ( $deleteClassIDList as $deleteClassID ) 75 { 76 $deleteClass = eZContentClass::fetch( $deleteClassID ); 77 if ( $deleteClass ) 78 $deleteClass->remove( true ); 79 $deleteClass = eZContentClass::fetch( $deleteClassID, true, EZ_CLASS_VERSION_STATUS_TEMPORARY ); 80 if ( $deleteClass ) 81 $deleteClass->remove( true ); 82 } 83 } 84 $Module->redirectTo( '/class/grouplist/' ); 85 } 86 if ( $http->hasPostVariable( "CancelButton" ) ) 87 { 88 $Module->redirectTo( '/class/grouplist/' ); 89 } 90 $Module->setTitle( ezi18n( 'kernel/class', 'Remove class groups' ) . ' ' . $GroupName ); 91 include_once ( "kernel/common/template.php" ); 92 $tpl =& templateInit(); 93 94 $tpl->setVariable( "DeleteResult", $deleteResult ); 95 $tpl->setVariable( "module", $Module ); 96 $tpl->setVariable( "groups_info", $groupsInfo ); 97 $Result = array(); 98 $Result['content'] =& $tpl->fetch( "design:class/removegroup.tpl" ); 99 $Result['path'] = array( array( 'url' => '/class/removegroup/', 100 'text' => ezi18n( 'kernel/class', 'Remove class groups' ) ) ); 101 ?>
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 |