XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
HTMLPurifier_Language Class Reference
Inheritance diagram for HTMLPurifier_Language:
Inheritance graph

Public Member Functions

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

Public Attributes

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

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

HTMLPurifier_Language::__construct (   $config,
  $context 
)

Definition at line 48 of file Language.php.

References $config, and $context.

Member Function Documentation

HTMLPurifier_Language::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.

References $i, listify(), and load().

Here is the call graph for this function:

HTMLPurifier_Language::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.

References load().

Here is the call graph for this function:

HTMLPurifier_Language::getMessage (   $key)

Retrieves a localised message.

Parameters
$keystring identifier of message
Returns
string localised message

Definition at line 72 of file Language.php.

References load().

Referenced by listify().

Here is the call graph for this function:

Here is the caller graph for this function:

HTMLPurifier_Language::listify (   $array)

Converts an array list into a string readable representation

Definition at line 93 of file Language.php.

References $i, $ret, and getMessage().

Referenced by formatMessage().

Here is the call graph for this function:

Here is the caller graph for this function:

HTMLPurifier_Language::load ( )

Loads language object with necessary info from factory cache

Note
This is a lazy loader

Definition at line 57 of file Language.php.

References $code, and HTMLPurifier_LanguageFactory\instance().

Referenced by formatMessage(), getErrorName(), and getMessage().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

HTMLPurifier_Language::$_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.

HTMLPurifier_Language::$code = 'en'

ISO 639 language code of language. Prefers shortest possible version

Definition at line 13 of file Language.php.

Referenced by load().

HTMLPurifier_Language::$config
protected

Instances of HTMLPurifier_Config and HTMLPurifier_Context

Definition at line 46 of file Language.php.

Referenced by __construct().

HTMLPurifier_Language::$context

Definition at line 46 of file Language.php.

Referenced by __construct().

HTMLPurifier_Language::$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.

HTMLPurifier_Language::$errorNames = array()

Array of localizable error codes

Definition at line 28 of file Language.php.

HTMLPurifier_Language::$fallback = false

Fallback language code

Definition at line 18 of file Language.php.

HTMLPurifier_Language::$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: