Moodle  2.2.1
http://www.collinsharper.com
HTMLPurifier_Language Class Reference
Inheritance diagram for HTMLPurifier_Language:

Public Member Functions

 __construct ($config, $context)
 load ()
 getMessage ($key)
 getErrorName ($int)
 listify ($array)
 formatMessage ($key, $args=array())

Data Fields

 $code = 'en'
 $fallback = false
 $messages = array()
 $errorNames = array()
 $error = false
 $_loaded = false
 $context

Protected Attributes

 $config

Detailed Description

Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.

Definition at line 7 of file Language.php.


Constructor & Destructor Documentation

__construct ( config,
context 
)

Definition at line 48 of file Language.php.


Member Function Documentation

formatMessage ( key,
args = array() 
)

Formats a localised message with passed parameters

Parameters:
$keystring identifier of message
$argsParameters to substitute in
Returns:
string localised message
Todo:
Implement conditionals? Right now, some messages make reference to line numbers, but those aren't always available

Definition at line 117 of file Language.php.

Here is the call graph for this function:

getErrorName ( int)

Retrieves a localised error name.

Parameters:
$intinteger error number, corresponding to PHP's error reporting
Returns:
string localised message

Definition at line 84 of file Language.php.

Here is the call graph for this function:

getMessage ( key)

Retrieves a localised message.

Parameters:
$keystring identifier of message
Returns:
string localised message

Definition at line 72 of file Language.php.

Here is the call graph for this function:

Here is the caller graph for this function:

listify ( array)

Converts an array list into a string readable representation

Definition at line 93 of file Language.php.

Here is the call graph for this function:

Here is the caller graph for this function:

load ( )

Loads language object with necessary info from factory cache

Note:
This is a lazy loader

Definition at line 57 of file Language.php.

Here is the caller graph for this function:


Field Documentation

$_loaded = false

Has the language object been loaded yet?

Todo:
Make it private, fix usage in HTMLPurifier_LanguageTest

Definition at line 41 of file Language.php.

$code = 'en'

ISO 639 language code of language. Prefers shortest possible version

Definition at line 13 of file Language.php.

$config [protected]

Instances of HTMLPurifier_Config and HTMLPurifier_Context

Definition at line 46 of file Language.php.

Definition at line 46 of file Language.php.

$error = false

True if no message file was found for this language, so English is being used instead. Check this if you'd like to notify the user that they've used a non-supported language.

Definition at line 35 of file Language.php.

$errorNames = array()

Array of localizable error codes

Definition at line 28 of file Language.php.

$fallback = false

Fallback language code

Definition at line 18 of file Language.php.

$messages = array()

Array of localizable messages

Definition at line 23 of file Language.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations