eZ Publish Community Project (Legacy Stack) 2013.4
Interface

ezpLanguageSwitcherCapable

interface ezpLanguageSwitcherCapable

Interface for classes providing language switcher functionality.

Methods

ezpLanguageSwitcherCapable __construct(array $params = null)

Constructs a ezpLanguageSwitcherCapable object.

void setDestinationSiteAccess(string $destinationSiteAccess)

Sets the name of the destination translation siteaccess.

void process()

This is added to serve as a hook, and can be used as seen fit.

string destinationUrl()

Calculates the full destination URL.

static mixed setupTranslationSAList(string $url = null)

Creates array structure for iterating over language switcher URLs in templates.

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 40
public void setDestinationSiteAccess(string $destinationSiteAccess)

Sets the name of the destination translation siteaccess.

This name is picked up and passed on in the switchlanguage module.

Parameters

string $destinationSiteAccess

Return Value

void

at line 49
public void process()

This is added to serve as a hook, and can be used as seen fit.

The default implementation perform some initialisation logic here.

Return Value

void

at line 59
public string destinationUrl()

Calculates the full destination URL.

The returned URL consists of correct hostname and URL alias for translated content.

Return Value

string

at line 91
static public mixed setupTranslationSAList(string $url = null)

Creates array structure for iterating over language switcher URLs in templates.

This method uses the site.ini.[RegionalSettings].TranslationSA setting to build an array of the defined translation siteaccess, their language switcher URL and chosen text string representing that translation.

Example return value: Array ( ????????[eng] => Array ????????????????( ????????????????????????[url] => /switchlanguage/to/eng/Demo-content ????????????????????????[text] => Eng ????????????????)

????????[nor] => Array ????????????????( ????????????????????????[url] => /switchlanguage/to/nor/Demo-content ????????????????????????[text] => Nor ????????????????) )

Parameters

string $url

Return Value

mixed