| [ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Created on: <27-Aug-2002 15:42:43 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 ( 'kernel/classes/ezsection.php' ); 28 include_once ( 'kernel/common/template.php' ); 29 include_once ( 'kernel/classes/ezpreferences.php' ); 30 31 $http =& eZHTTPTool::instance(); 32 $Module =& $Params["Module"]; 33 $tpl =& templateInit(); 34 $tpl->setVariable( 'module', $Module ); 35 36 $offset = $Params['Offset']; 37 38 if( eZPreferences::value( 'admin_section_list_limit' ) ) 39 { 40 switch( eZPreferences::value( 'admin_section_list_limit' ) ) 41 { 42 case '2': { $limit = 25; } break; 43 case '3': { $limit = 50; } break; 44 default: { $limit = 10; } break; 45 } 46 } 47 else 48 { 49 $limit = 10; 50 } 51 52 if ( $http->hasPostVariable( 'CreateSectionButton' ) ) 53 { 54 $Module->redirectTo( $Module->functionURI( "edit" ) . '/0/' ); 55 return; 56 } 57 58 if ( $http->hasPostVariable( 'RemoveSectionButton' ) ) 59 { 60 $sectionIDArray = $http->postVariable( 'SectionIDArray' ); 61 $http->setSessionVariable( 'SectionIDArray', $sectionIDArray ); 62 $sections = array(); 63 foreach ( $sectionIDArray as $sectionID ) 64 { 65 $section = eZSection::fetch( $sectionID ); 66 $sections[] =& $section; 67 } 68 $tpl->setVariable( 'delete_result', $sections ); 69 $Result = array(); 70 $Result['content'] =& $tpl->fetch( "design:section/confirmremove.tpl" ); 71 $Result['path'] = array( array( 'url' => false, 72 'text' => ezi18n( 'kernel/section', 'Sections' ) ) ); 73 return; 74 75 } 76 77 if ( $http->hasPostVariable( 'ConfirmRemoveSectionButton' ) ) 78 { 79 $sectionIDArray =& $http->sessionVariable( 'SectionIDArray' ); 80 81 $db =& eZDB::instance(); 82 $db->begin(); 83 include_once ( 'kernel/classes/ezcontentcachemanager.php' ); 84 foreach ( $sectionIDArray as $sectionID ) 85 { 86 $section = eZSection::fetch( $sectionID ); 87 if( $section === null ) 88 continue; 89 // Clear content cache if needed 90 eZContentCacheManager::clearContentCacheIfNeededBySectionID( $sectionID ); 91 $section->remove( ); 92 } 93 $db->commit(); 94 } 95 96 $viewParameters = array( 'offset' => $offset ); 97 $sectionArray = eZSection::fetchByOffset( $offset, $limit ); 98 $sectionCount = eZSection::sectionCount(); 99 100 $tpl->setVariable( "limit", $limit ); 101 $tpl->setVariable( 'section_array', $sectionArray ); 102 $tpl->setVariable( 'section_count', $sectionCount ); 103 $tpl->setVariable( 'view_parameters', $viewParameters ); 104 105 $Result = array(); 106 $Result['content'] =& $tpl->fetch( "design:section/list.tpl" ); 107 $Result['path'] = array( array( 'url' => false, 108 'text' => ezi18n( 'kernel/section', 'Sections' ) ) ); 109 110 ?>
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 |