ZurmoLanguageHelper Class Reference

Public Member Functions

 setActive ($language)
 load ()
 getBaseLanguage ()
 getForCurrentUser ()
 getByUser (User $user)
 getSupportedLanguagesData ()
 getAllModuleLabelsAsTranslationParameters ()
 flushModuleLabelTranslationParameters ()
 getActiveLanguagesData ()
 canDeactivateLanguage ($language)
 activateLanguage ($languageCode)
 updateLanguage ($languageCode)
 deactivateLanguage ($languageCode)
 formatLanguageLabel ($language)

Protected Member Functions

 isLanguageADefaultLanguageForAnyUsers ($language)

Protected Attributes

 $baseLanguage

Detailed Description

Application loaded component at run time.

See also:
BeginBehavior - calls load() method.

Definition at line 40 of file ZurmoLanguageHelper.php.


Member Function Documentation

setActive ( language  ) 

Sets active language.

Definition at line 51 of file ZurmoLanguageHelper.php.

load (  ) 

Loads language for current user. This is called by BeginBehavior. This will also copy the base language into a parameter $baseLanguage in this class.

Definition at line 62 of file ZurmoLanguageHelper.php.

getForCurrentUser (  ) 

For the current user, get the language setting. The current user is specified here: Yii::app()->user->userModel

Returns:
string - language.

Definition at line 91 of file ZurmoLanguageHelper.php.

getByUser ( User user  ) 

For the specified user, get the language setting. The current user is specified here: Yii::app()->user->userModel

Parameters:
User $user
Returns:
string - language.

Definition at line 106 of file ZurmoLanguageHelper.php.

getSupportedLanguagesData (  ) 

Get supported languages and data of language. Uses language id as key.

Returns:
array of language keys/ data.

Definition at line 120 of file ZurmoLanguageHelper.php.

getAllModuleLabelsAsTranslationParameters (  ) 

Module translation parameters are used by Zurmo::t as the third parameter to define the module labels. These parameter values resolve any custom module label names that have been specified in the module metadata.

Returns:
array of key/value module label pairings. Caches results to improve performance.

Definition at line 141 of file ZurmoLanguageHelper.php.

flushModuleLabelTranslationParameters (  ) 

Used by tests to reset value between tests.

Definition at line 172 of file ZurmoLanguageHelper.php.

getActiveLanguagesData (  ) 

Returns an array of active language models.

Definition at line 183 of file ZurmoLanguageHelper.php.

canDeactivateLanguage ( language  ) 

A language that is the base language or currently selected as a user's default language, cannot be removed.

Returns:
true if the specified language can be removed.

Definition at line 211 of file ZurmoLanguageHelper.php.

activateLanguage ( languageCode  ) 

Activates a language

Definition at line 224 of file ZurmoLanguageHelper.php.

updateLanguage ( languageCode  ) 

Updates a language

Definition at line 270 of file ZurmoLanguageHelper.php.

isLanguageADefaultLanguageForAnyUsers ( language  )  [protected]

Given a language, is it in use as a default language by any of the users.

Parameters:
string $language
Returns:
true if in use, otherwise returns false.

Definition at line 347 of file ZurmoLanguageHelper.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Jun 28 07:10:31 2017