[ Index ] |
|
Code source de eZ Publish 3.9.0 |
1 <?php 2 // 3 // Created on: <11-Aug-2003 13:10:28 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 $module =& $Params['Module']; 28 $http =& eZHTTPTool::instance(); 29 $function =& $Params['Function']; 30 $key =& $Params['Key']; 31 $value =& $Params['Value']; 32 33 include_once ( 'kernel/classes/ezpreferences.php' ); 34 35 eZPreferences::setValue( $key, $value ); 36 37 // Extract URL to redirect to from user parameters. 38 $urlArray = array_splice( $Params['Parameters'], 3 ); 39 foreach ( $urlArray as $key => $val ) // remove all the array elements that don't seem like URL parts 40 { 41 if ( !is_numeric( $key ) ) 42 unset( $urlArray[$key] ); 43 } 44 $url = implode( '/', $urlArray ); 45 unset( $urlArray ); 46 47 if ( $url ) 48 { 49 foreach ( array_keys( $Params['UserParameters'] ) as $key ) 50 { 51 if ( $key == 'offset' ) 52 continue; 53 $url .= '/(' . $key . ')/' . $Params['UserParameters'][$key]; 54 } 55 $module->redirectTo( '/'.$url ); 56 } 57 else 58 { 59 include_once ( 'kernel/classes/ezredirectmanager.php' ); 60 $preferredRedirectionURI = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : false; 61 // We should exclude OFFSET from $preferredRedirectionURI 62 $exploded = explode( '/', $preferredRedirectionURI ); 63 foreach ( array_keys( $exploded ) as $itemKey ) 64 { 65 $item = $exploded[$itemKey]; 66 if ( $item == '(offset)' ) 67 { 68 array_splice( $exploded, $itemKey, 2 ); 69 break; 70 } 71 } 72 $redirectURI = implode( '/', $exploded ); 73 eZRedirectManager::redirectTo( $module, /* $default = */ false, /* $view = */ true, /* $disallowed = */ false, $redirectURI ); 74 return; 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 |