eZ Publish Community Project (Legacy Stack) 2013.4
Class

ezpLanguageSwitcher

class ezpLanguageSwitcher implements ezpLanguageSwitcherCapable

Utility class for transforming URLs between siteaccesses.

This class will generate URLs for various siteaccess, and translate URL-aliases into other languages as necessary.

Methods

ezpLanguageSwitcherCapable __construct(array $params = null)

Constructs a ezpLanguageSwitcherCapable object.

void destinationUrl()

Returns URL alias for the specified $locale

void setDestinationSiteAccess(string $saName)

Sets the siteaccess name, $saName, we want to redirect to.

void process()

This is a hook which is called by the language switcher module on implementation classes.

static void setupTranslationSAList(string $url = null)

Creates an array of corresponding language switcher links and logical names.

Details

at line 30
public ezpLanguageSwitcherCapable __construct(array $params = null)

Constructs a ezpLanguageSwitcherCapable object.

The $params array is the module-params array returned in the switchlanguage/to view. In addition, the value in $params['QueryString'] might also be taken into account (if present) to keep the query string while redirecting to another language. This is used to construct the destination URL.

Parameters

array $params

Return Value

ezpLanguageSwitcherCapable

at line 115
public void destinationUrl()

Returns URL alias for the specified $locale

Return Value

void

at line 187
public void setDestinationSiteAccess(string $saName)

Sets the siteaccess name, $saName, we want to redirect to.

Parameters

string $saName

Return Value

void

at line 200
public void process()

This is a hook which is called by the language switcher module on implementation classes.

In this implementation it is doing initialisation as an example.

Return Value

void

at line 234
static public void setupTranslationSAList(string $url = null)

Creates an array of corresponding language switcher links and logical names.

This mapping is set up in site.ini.[RegionalSettings].TranslationSA. The purpose of this method is to assist creation of language switcher links into the available translation siteaccesses on the system.

This is used by the language_switcher template operator.

Parameters

string $url

Return Value

void