oxLang Class Reference

Inheritance diagram for oxLang:

Inheritance graph
[legend]
Collaboration diagram for oxLang:

Collaboration graph
[legend]

List of all members.


Detailed Description

Language related utility class

Definition at line 6 of file oxlang.php.


Public Member Functions

 resetBaseLanguage ()
 getBaseLanguage ()
 getTplLanguage ()
 getEditLanguage ()
 getLanguageArray ($iLanguage=null, $blOnlyActive=false, $blSort=false)
 getLanguageAbbr ($iLanguage=null)
 getLanguageNames ()
 getLanguageIds ()
 translateString ($sStringToTranslate, $iLang=null, $blAdminMode=null)
 formatCurrency ($dValue, $oActCur=null)
 formatVat ($dValue, $oActCur=null)
 getLanguageTag ($iLanguage=null)
 validateLanguage ($iLang=null)
 setBaseLanguage ($iLang=null)
 setTplLanguage ($iLang=null)

Static Public Member Functions

static getInstance ()

Protected Member Functions

 _recodeLangArray ($aLangArray, $sCharset)
 _getLanguageFileData ($blAdmin=false, $iLang=0)
 _getCacheLanguageId ($blAdmin, $iLang=null)
 _getLangTranslationArray ($iLang=null, $blAdmin=null)
 _readTranslateStrFromTextFile ($sStringToTranslate, $iLang=null, $blIsAdmin=null)
 _sortLanguagesCallback ($a1, $a2)

Protected Attributes

 $_iBaseLanguageId = null
 $_iTplLanguageId = null
 $_iEditLanguageId = null
 $_aLangCache = array()
 $_aAdminLangCache = array()

Static Private Attributes

static $_instance = null

Member Function Documentation

static oxLang.getInstance (  )  [static]

resturns a single instance of this class

Returns:
oxLang

Definition at line 55 of file oxlang.php.

oxLang.resetBaseLanguage (  ) 

resetBaseLanguage resets base language id cache

public

Returns:
void

Definition at line 80 of file oxlang.php.

oxLang.getBaseLanguage (  ) 

Returns active shop language id

Returns:
string

Definition at line 90 of file oxlang.php.

oxLang.getTplLanguage (  ) 

Returns active shop templates language id If it is not an admin area, template language id is same as base shop language id

Returns:
string

Definition at line 145 of file oxlang.php.

oxLang.getEditLanguage (  ) 

Returns editing object working language id

Returns:
string

Definition at line 177 of file oxlang.php.

oxLang.getLanguageArray ( iLanguage = null,
blOnlyActive = false,
blSort = false 
)

Returns array of available languages.

Parameters:
integer $iLanguage Number if current language (default null)
bool $blOnlyActive load only current language or all
bool $blSort enable sorting or not
Returns:
array

Definition at line 220 of file oxlang.php.

oxLang.getLanguageAbbr ( iLanguage = null  ) 

Returns selected language abbervation

Parameters:
int $iLanguage language number
public
Returns:
string

Definition at line 286 of file oxlang.php.

oxLang.getLanguageNames (  ) 

getLanguageNames returns array of language names e.g. array('Deutch', 'English')

public

Returns:
array

Definition at line 309 of file oxlang.php.

oxLang.getLanguageIds (  ) 

Returns available language IDs (abbervations)

Returns:
array

Definition at line 319 of file oxlang.php.

oxLang.translateString ( sStringToTranslate,
iLang = null,
blAdminMode = null 
)

Searches for translation string in file and on success returns translation, otherwise returns initial string.

Parameters:
string $sStringToTranslate Initial string
int $iLang optional language number
bool $blAdminMode on special case you can force mode, to load language constant from admin/shops language file
Exceptions:
oxLanguageException in debug mode
Returns:
string

Definition at line 350 of file oxlang.php.

oxLang.formatCurrency ( dValue,
oActCur = null 
)

Returns formatted currency string, according to formatting standards.

Parameters:
double $dValue Plain price
object $oActCur Object of active currency
Returns:
string

Definition at line 371 of file oxlang.php.

oxLang.formatVat ( dValue,
oActCur = null 
)

Returns formatted vat value, according to formatting standards.

Parameters:
double $dValue Plain price
object $oActCur Object of active currency
Returns:
string

Definition at line 387 of file oxlang.php.

oxLang.getLanguageTag ( iLanguage = null  ) 

According to user configuration forms and return language prefix.

Parameters:
integer $iLanguage User selected language (default null)
Returns:
string

Definition at line 408 of file oxlang.php.

oxLang.validateLanguage ( iLang = null  ) 

Validate language id. If not valid id, returns default value

Parameters:
int $iLang Language id
Returns:
int

Definition at line 426 of file oxlang.php.

oxLang.setBaseLanguage ( iLang = null  ) 

Set base shop language

Parameters:
int $iLang Language id
Returns:
null

Definition at line 448 of file oxlang.php.

oxLang.setTplLanguage ( iLang = null  ) 

Set templates language id

Parameters:
int $iLang Language id
Returns:
null

Definition at line 470 of file oxlang.php.

oxLang._recodeLangArray ( aLangArray,
sCharset 
) [protected]

Goes through language array and recodes its values. Returns recoded data

Parameters:
array $aLangArray language data
string $sCharset charset which was used while making file
Returns:
array

Definition at line 493 of file oxlang.php.

oxLang._getLanguageFileData ( blAdmin = false,
iLang = 0 
) [protected]

Returns language cache array

Parameters:
bool $blAdmin admin or not [optional]
int $iLang current language id [optional]
Returns:
array

Definition at line 510 of file oxlang.php.

oxLang._getCacheLanguageId ( blAdmin,
iLang = null 
) [protected]

Returns current language cache language id

Parameters:
bool $blAdmin admin mode
int $iLang language id [optional]
Returns:
int

Definition at line 559 of file oxlang.php.

oxLang._getLangTranslationArray ( iLang = null,
blAdmin = null 
) [protected]

get language array from lang translation file

Parameters:
int $iLang optional language
bool $blAdmin admin mode switch
Returns:
array

Definition at line 580 of file oxlang.php.

oxLang._readTranslateStrFromTextFile ( sStringToTranslate,
iLang = null,
blIsAdmin = null 
) [protected]

translates a given string

Parameters:
string $sStringToTranslate string that should be translated
int $iLang language id (optional)
bool $blIsAdmin admin mode switch (default null)
Returns:
string translation

Definition at line 615 of file oxlang.php.

oxLang._sortLanguagesCallback ( a1,
a2 
) [protected]

Language sorting callback function

Parameters:
object $a1 first value to check
object $a2 second value to check
Returns:
bool

Definition at line 675 of file oxlang.php.


Member Data Documentation

oxLang.$_instance = null [static, private]

Definition at line 13 of file oxlang.php.

oxLang.$_iBaseLanguageId = null [protected]

Definition at line 20 of file oxlang.php.

oxLang.$_iTplLanguageId = null [protected]

Definition at line 27 of file oxlang.php.

oxLang.$_iEditLanguageId = null [protected]

Definition at line 34 of file oxlang.php.

oxLang.$_aLangCache = array() [protected]

Definition at line 41 of file oxlang.php.

oxLang.$_aAdminLangCache = array() [protected]

Definition at line 48 of file oxlang.php.


The documentation for this class was generated from the following file:

Generated on Wed Apr 22 12:31:34 2009 for OXID eShop CE by  doxygen 1.5.5