Class Language

Description

TAM AG CMS

  • author: DevilDev

Located in /language/Language.php (line 11)

ModelAbstract
   |
   --Language
Variable Summary
Method Summary
static array getBrowser ()
static Language getInstance ()
string admin ()
void edit ( $id)
int getDefaultLang ([bool $lang_code = false])
void getLangCode ( $lang_id)
void getLangIdByCode ( $lang_code)
boolean|array getLangs ()
string lagnSelector ([ $type = null])
string loadButtonHtml ()
string saveAliace (string $aliace)
boolean setDefaultLanguage (int $lang)
void settings ()
string translate (string $aliace)
void _init ()
Variables
static Language $_instance = null (line 18)

Singleton instance

  • access: protected
mixed $langCode = array('en'=>1,'de'=>4, 'ru'=>2) (line 21)
  • access: public
Methods
static method getBrowser (line 534)

Check language one by user browser

  • return: languages
  • access: public
static array getBrowser ()
static method getInstance (line 31)

Returns an instance of Language

Singleton pattern implementation

  • return: Provides a fluent interface
  • access: public
static Language getInstance ()
admin (line 103)

Create html page for language module

Allow variable
$def_lang - current language code
$translte_lines - html lines messages
$search_form - html form serach
$pagination - html paginator
Incoming variable
q - serach query
pages - current page
js, json - if load as JSON

  • return: html module
  • access: public
string admin ()
edit (line 293)
  • access: public
void edit ( $id)
  • $id
getDefaultLang (line 389)

Get current language

  • return: language id or string language code if $lang_code is true
  • access: public
int getDefaultLang ([bool $lang_code = false])
  • bool $lang_code
getLangCode (line 451)
  • access: public
void getLangCode ( $lang_id)
  • $lang_id
getLangIdByCode (line 459)
  • access: public
void getLangIdByCode ( $lang_code)
  • $lang_code
getLangs (line 424)

Load all languages

  • access: public
boolean|array getLangs ()
getTranslateAsArray (line 315)

Load all translation for current language

  • return: translations or bool
  • access: public
array getTranslateAsArray ()
lagnSelector (line 483)

Create language selector if enable multilangs

Allow variable
$lang_options - html lines languages
$current_lang = html line for current language
$cfg_lang - default language
$site_url - site domaun url

  • return: language selector
  • access: public
string lagnSelector ([ $type = null])
  • $type
loadButtonHtml (line 48)

Create html button on load translate module

  • return: html button
  • access: public
string loadButtonHtml ()
saveAliace (line 365)

Save current aliace in database

  • return: aliace
  • access: public
string saveAliace (string $aliace)
  • string $aliace
setDefaultLanguage (line 61)

Set default language

  • access: public
boolean setDefaultLanguage (int $lang)
  • int $lang: or string lang code
settings (line 204)
  • access: public
void settings ()
translate (line 347)

Translate message

  • return: translation line or aliace
  • access: public
string translate (string $aliace)
  • string $aliace
_init (line 39)
void _init ()

Documentation generated on Fri, 19 Aug 2016 17:10:32 +0200 by phpDocumentor 1.4.3