Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

to.php
Go to the documentation of this file.
1 <?php
12 $handlerOptions = new ezpExtensionOptions();
13 $handlerOptions->iniFile = 'site.ini';
14 $handlerOptions->iniSection = 'RegionalSettings';
15 $handlerOptions->iniVariable = 'LanguageSwitcherClass';
16
17 if ( isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] )
18 {
19 $Params['QueryString'] = $_SERVER['QUERY_STRING'];
20 }
21
22 // 0. Module params are sent to constructor to process the request.
23 $handlerOptions->handlerParams = array( $Params );
24
25 $langSwitch = eZExtension::getHandlerClass( $handlerOptions );
26
27 $Module = $Params['Module'];
28 $destinationSiteAccess = $Params['SiteAccess'];
29
30 // Steps for language switcher classes
31
32 // 1. destination siteaccess is set
33 $langSwitch->setDestinationSiteAccess( $destinationSiteAccess );
34
35 // 2. The process hook is called, it is up to each class what this step involves.
36 $langSwitch->process();
37
38 // 3. The final URL is fetched from the language switcher class. This URL must
39 // point to the correct full URL including host (for host based mapping) and
40 // translated URL alias where applicable.
41 $destinationUrl = $langSwitch->destinationUrl();
42
43 // 4. The browser is redirected to the URL of the translated content.
44 $Module->redirectTo( $destinationUrl );
45
46 ?>
eZExtension\getHandlerClass
static getHandlerClass(ezpExtensionOptions $options)
Definition: ezextension.php:480
ezpExtensionOptions
Definition: ezpextensionoptions.php:59
$destinationSiteAccess
$destinationSiteAccess
Definition: to.php:28
$Module
$Module
Definition: to.php:27
$langSwitch
$langSwitch
Definition: to.php:25
$destinationUrl
$destinationUrl
Definition: to.php:41
$handlerOptions
$handlerOptions
Definition: to.php:12
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.