[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Created on: <27-Aug-2002 16:31:33 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 ( "kernel/classes/ezsection.php" ); 29 include_once ( "kernel/common/template.php" ); 30 31 $http =& eZHTTPTool::instance(); 32 $SectionID =& $Params["SectionID"]; 33 $Module =& $Params["Module"]; 34 35 if ( $SectionID == 0 ) 36 { 37 $section = array( 'id' => 0, 38 'name' => ezi18n( 'kernel/section', 'New section' ), 39 'navigation_part_identifier' => 'ezcontentnavigationpart' ); 40 } 41 else 42 { 43 $section = eZSection::fetch( $SectionID ); 44 if( is_null( $section ) ) 45 { 46 return $Module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' ); 47 } 48 } 49 50 if ( $http->hasPostVariable( "StoreButton" ) ) 51 { 52 if ( $SectionID == 0 ) 53 { 54 $section = new eZSection( array() ); 55 } 56 $section->setAttribute( 'name', $http->postVariable( 'Name' ) ); 57 $section->setAttribute( 'navigation_part_identifier', $http->postVariable( 'NavigationPartIdentifier' ) ); 58 if ( $http->hasPostVariable( 'Locale' ) ) 59 $section->setAttribute( 'locale', $http->postVariable( 'Locale' ) ); 60 $section->store(); 61 include_once ( 'kernel/classes/ezcontentcachemanager.php' ); 62 eZContentCacheManager::clearContentCacheIfNeededBySectionID( $section->attribute( 'id' ) ); 63 $Module->redirectTo( $Module->functionURI( 'list' ) ); 64 return; 65 } 66 67 if ( $http->hasPostVariable( 'CancelButton' ) ) 68 { 69 $Module->redirectTo( $Module->functionURI( 'list' ) ); 70 } 71 72 $tpl =& templateInit(); 73 74 $tpl->setVariable( "section", $section ); 75 76 $Result = array(); 77 $Result['content'] =& $tpl->fetch( "design:section/edit.tpl" ); 78 $Result['path'] = array( array( 'url' => false, 79 'text' => ezi18n( 'kernel/section', 'Edit Section' ) ) ); 80 81 ?>
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 |