Files | Enumerations | Functions | Variables

InternalLang

Files

file  english.php
file  english.php
file  greek.php
file  languages.php
 

Internationalization constants.


Enumerations

enum  PHPCAS_LANG_DEFAULT
 

phpCAS default language (when phpCAS::setLang() is not used)

More...

Functions

 CASClient::getLang ()
 This method returns the language used by phpCAS.
 CASClient::getString ($str)
 This method returns a string depending on the language.
 CASClient::setLang ($lang)
 This method is used to set the language used by phpCAS.

Variables

 CASClient::$_lang
 A string corresponding to the language used by phpCAS.
 CASClient::$_strings
 array containing the strings used by phpCAS.

Enumeration Type Documentation

phpCAS default language (when phpCAS::setLang() is not used)

Definition at line 160 of file CAS.php.


Function Documentation

CASClient::getLang (  )  [private, inherited]

This method returns the language used by phpCAS.

Returns:
a string representing the language

Definition at line 165 of file client.php.

References CASClient::setLang().

Referenced by CASClient::getString().

    {
      if ( empty($this->_lang) )
        $this->setLang(PHPCAS_LANG_DEFAULT);
      return $this->_lang;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

CASClient::getString ( str  )  [private, inherited]

This method returns a string depending on the language.

Parameters:
$str the index of the string in $_string.
Returns:
the string corresponding to $index in $string.

Definition at line 192 of file client.php.

References _strings, and CASClient::getLang().

Referenced by CASClient::logout(), CASClient::printHTMLFooter(), and CASClient::redirectToCas().

    {
      // call CASclient::getLang() to be sure the language is initialized
      $this->getLang();
      
      if ( !isset($this->_strings[$str]) ) {
        trigger_error('string `'.$str.'\' not defined for language `'.$this->getLang().'\'',E_USER_ERROR);
      }
      return $this->_strings[$str];
    }

Here is the call graph for this function:

Here is the caller graph for this function:

CASClient::setLang ( lang  )  [inherited]

This method is used to set the language used by phpCAS.

Note:
Can be called only once.
Parameters:
$lang a string representing the language.
See also:
CAS_LANG_FRENCH, CAS_LANG_ENGLISH

Definition at line 212 of file client.php.

References $lang, and _strings.

Referenced by CASClient::getLang().

    {
      // include the corresponding language file
      include_once(dirname(__FILE__).'/languages/'.$lang.'.php');

      if ( !is_array($this->_strings) ) {
        trigger_error('language `'.$lang.'\' is not implemented',E_USER_ERROR);
      }
      $this->_lang = $lang;
    }

Here is the caller graph for this function:


Variable Documentation

CASClient::$_lang [private, inherited]

A string corresponding to the language used by phpCAS.

Written by CASClient::setLang(), read by CASClient::getLang().

Note:
debugging information is always in english (debug purposes only).
See also:
CASClient::_strings, CASClient::getString()

Definition at line 156 of file client.php.

CASClient::$_strings [private, inherited]

array containing the strings used by phpCAS.

Written by CASClient::setLang(), read by CASClient::getString() and used by CASClient::setLang().

Note:
This array is filled by instructions in CAS/languages/<$this->_lang>.php
See also:
CASClient::_lang, CASClient::getString(), CASClient::setLang(), CASClient::getLang()

Definition at line 181 of file client.php.