Framework language

copyright CONTREXX CMS - COMVATION AG
author Comvation Development Team
version 2.3.0
package contrexx
subpackage lib_framework

 Methods

Return only the languages active in the backend

getActiveBackendLanguages() : \array(
Static
author Stefan Heinemann

Returns

\array(array( 'id' => {lang_id}, 'lang' => {iso_639-1}, 'name' => {name}, 'charset' => 'UTF-8', 'themesid' => {theme_id}, 'frontend' => {bool}, 'backend' => {bool}, 'is_default' => {bool}, 'fallback' => {language_id}, ) )

Return only the languages active in the frontend

getActiveFrontendLanguages() : \array(
Static
author Stefan Heinemann

Returns

\array(array( 'id' => {lang_id}, 'lang' => {iso_639-1}, 'name' => {name}, 'charset' => 'UTF-8', 'themesid' => {theme_id}, 'frontend' => {bool}, 'backend' => {bool}, 'is_default' => {bool}, 'fallback' => {language_id}, ) )

Returns the ID of the default language

getDefaultLangId() : integer
Static

Returns

integerLanguage ID

Builds an array mapping language ids to fallback language ids.

getFallbackLanguageArray() : array
Static

Returns

array( language id => fallback language id )

Return the fallback language ID for the given ID

getFallbackLanguageIdById(integer $langId) : integer
Static

Returns false on failure, or if the ID is invalid

static

Parameters

$langId

integer

The language ID

Returns

integer$langId The language ID, or false

Returns an array of active language IDs

getIdArray(string $mode) : array
Static

Note that the array returned contains the language ID both as key and value, for your convenience.

author Reto Kohli

Parameters

$mode

string

'frontend' or 'backend' languages. Defaults to 'frontend'

Returns

arrayThe array of enabled language IDs

Return the language ID for the ISO 639-1 code specified.

getLangIdByIso639_1(string $langCode) : mixed
Static

If the code cannot be found, returns the default language. If that isn't set either, returns the first language encountered. If none can be found, returns null. Note that you can supply the complete string from the Accept-Language HTTP header. This method will take care of chopping it into pieces and trying to pick a suitable language. However, it will not pick the most suitable one according to RFC2616, but only returns the first language that fits.

static
global ADONewConnection
author Reto Kohli

Parameters

$langCode

string

The ISO 639-1 language code

Returns

mixedThe language ID on success, null otherwise

Returns the complete language data

getLanguageArray() : array
Static
see \FWLanguage()
access public

Returns

arrayThe language data

Return the language code from the database for the given ID

getLanguageCodeById(integer $langId) : mixed
Static

Returns false on failure, or if the ID is invalid

static

Parameters

$langId

integer

The language ID

Returns

mixedThe two letter code, or false

Return the language ID for the given code

getLanguageIdByCode(string $code) : integer
Static

Returns false on failure, or if the code is unknown

static

Parameters

$code

string

The two letter code

Returns

integer$langId The language ID, or false

Returns single language related fields

getLanguageParameter($id, $index) : mixed
Static

Access language data by specifying the language ID and the index as initialized by FWLanguage().

access public

Parameters

$id

$index

Returns

mixedLanguage data field content

Returns HTML code to display a language selection dropdown menu.

getMenu(integer $selectedId, string $menuName, string $onchange) : string
Static

Does only contain the tag pair if the optional $menuName is specified and evaluates to a true value. Frontend use only.

author Reto Kohli
todo Use the Html class instead

Parameters

$selectedId

integer

The optional preselected language ID

$menuName

string

The optional menu name

$onchange

string

The optional onchange code

Returns

stringThe dropdown menu HTML code

Returns HTML code for the language menu options

getMenuoptions(integer $selectedId, boolean $flagInactive) : string
Static
author Reto Kohli
todo Use the Html class instead

Parameters

$selectedId

integer

The optional preselected language ID

$flagInactive

boolean

If true, all languages are added, only the active ones otherwise

Returns

stringThe menu options HTML code

Returns an array of active language names, indexed by language ID

getNameArray(string $mode) : array
Static
author Reto Kohli

Parameters

$mode

string

'frontend' or 'backend' languages. Defaults to 'frontend'

Returns

arrayThe array of enabled language names

Loads the language config from the database

init() 
Static

This used to be in __construct but is also called from core/language.class.php to reload the config, so core/settings.class.php can rewrite .htaccess (virtual lang dirs).

 Properties

 

$arrLanguages 
 

$defaultLangId : integer
access private
© Copyright 2014 by Comvation AG
Generated on 2014-07-11T08:39:26+02:00.