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

Public Member Functions

 __construct ($otherroot, $localroot, $cacheroot, $usediskcache, $translist, $menucache)
 get_language_dependencies ($lang)
 load_component_strings ($component, $lang, $disablecache=false, $disablelocal=false)
 string_exists ($identifier, $component)
 get_string ($identifier, $component= '', $a=NULL, $lang=NULL)
 get_performance_summary ()
 get_list_of_countries ($returnall=false, $lang=NULL)
 get_list_of_languages ($lang=NULL, $standard= 'iso6391')
 translation_exists ($lang, $includeall=true)
 get_list_of_translations ($returnall=false)
 get_list_of_currencies ($lang=NULL)
 reset_caches ()

Protected Attributes

 $otherroot
 $localroot
 $cacheroot
 $cache = array()
 $countgetstring = 0
 $countmemcache = 0
 $countdiskcache = 0
 $usediskcache
 $translist
 $menucache

Detailed Description

Definition at line 6074 of file moodlelib.php.


Constructor & Destructor Documentation

__construct ( otherroot,
localroot,
cacheroot,
usediskcache,
translist,
menucache 
)

Create new instance of string manager

Parameters:
string$otherrootlocation of downlaoded lang packs - usually $CFG->dataroot/lang
string$localrootusually the same as $otherroot
string$cacherootusually lang dir in cache folder
bool$usediskcacheuse disk cache
array$translistlimit list of visible translations
string$menucachethe location of a file that caches the list of available translations

Definition at line 6106 of file moodlelib.php.


Member Function Documentation

Returns dependencies of current language, en is not included.

Parameters:
string$lang
Returns:
array all parents, the lang itself is last

Definition at line 6120 of file moodlelib.php.

Here is the caller graph for this function:

get_list_of_countries ( returnall = false,
lang = NULL 
)

Returns a localised list of all country names, sorted by localised name.

Parameters:
bool$returnallreturn all or just enabled
string$langmoodle translation language, NULL means use current
Returns:
array two-letter country code => translated name.

Implements string_manager.

Definition at line 6407 of file moodlelib.php.

Here is the call graph for this function:

get_list_of_currencies ( lang = NULL)

Returns localised list of currencies.

Parameters:
string$langmoodle translation language, NULL means use current
Returns:
array currency code => localised currency name

Implements string_manager.

Definition at line 6604 of file moodlelib.php.

Here is the call graph for this function:

get_list_of_languages ( lang = NULL,
standard = 'iso6391' 
)

Returns a localised list of languages, sorted by code keys.

Parameters:
string$langmoodle translation language, NULL means use current
string$standardlanguage list standard
  • iso6392: three-letter language code (ISO 639-2/T) => translated name
  • iso6391: two-letter langauge code (ISO 639-1) => translated name
Returns:
array language code => translated name

Implements string_manager.

Definition at line 6439 of file moodlelib.php.

Here is the call graph for this function:

get_list_of_translations ( returnall = false)

Returns localised list of installed translations

Parameters:
bool$returnallreturn all or just enabled
Returns:
array moodle translation code => localised translation name

Implements string_manager.

Definition at line 6512 of file moodlelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns information about the string_manager performance

Returns:
array

Definition at line 6388 of file moodlelib.php.

get_string ( identifier,
component = '',
a = NULL,
lang = NULL 
)

Get String returns a requested string

Parameters:
string$identifierThe identifier of the string to search for
string$componentThe module the string is associated with
string | object | array$aAn object, string or number that can be used within translation strings
string$langmoodle translation language, NULL means use current
Returns:
string The String !

Implements string_manager.

Definition at line 6290 of file moodlelib.php.

Here is the call graph for this function:

load_component_strings ( component,
lang,
disablecache = false,
disablelocal = false 
)

Load all strings for one component

Parameters:
string$componentThe module the string is associated with
string$lang
bool$disablecacheDo not use caches, force fetching the strings from sources
bool$disablelocalDo not use customized strings in xx_local language packs
Returns:
array of all string for given component and lang

Implements string_manager.

Definition at line 6147 of file moodlelib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Clears both in-memory and on-disk caches

Implements string_manager.

Definition at line 6618 of file moodlelib.php.

Here is the call graph for this function:

string_exists ( identifier,
component 
)

Does the string actually exist?

get_string() is throwing debug warnings, sometimes we do not want them or we want to display better explanation of the problem.

Use with care!

Parameters:
string$identifierThe identifier of the string to search for
string$componentThe module the string is associated with
Returns:
boot true if exists

Implements string_manager.

Definition at line 6270 of file moodlelib.php.

Here is the call graph for this function:

translation_exists ( lang,
includeall = true 
)

Does the translation exist?

Parameters:
string$langmoodle translation language code
boolinclude also disabled translations?
Returns:
boot true if exists

Implements string_manager.

Definition at line 6489 of file moodlelib.php.


Field Documentation

$cache = array() [protected]

Definition at line 6082 of file moodlelib.php.

$cacheroot [protected]

Definition at line 6080 of file moodlelib.php.

$countdiskcache = 0 [protected]

Definition at line 6088 of file moodlelib.php.

$countgetstring = 0 [protected]

Definition at line 6084 of file moodlelib.php.

$countmemcache = 0 [protected]

Definition at line 6086 of file moodlelib.php.

$localroot [protected]

Definition at line 6078 of file moodlelib.php.

$menucache [protected]

Definition at line 6094 of file moodlelib.php.

$otherroot [protected]

Definition at line 6076 of file moodlelib.php.

$translist [protected]

Definition at line 6092 of file moodlelib.php.

$usediskcache [protected]

Definition at line 6090 of file moodlelib.php.


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