Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
tool_langimport\controller Class Reference

Lang import controller. More...

Public Member Functions

 __construct ()
 Constructor.
 
 install_languagepacks ($langs, $updating=false)
 Install language packs provided. More...
 
 is_installed_lang ($lang, $md5check)
 checks the md5 of the zip file, grabbed from download.moodle.org, against the md5 of the local language file from last update More...
 
 lang_pack_url ($langcode='')
 Returns the URL where a given language pack can be downloaded. More...
 
 uninstall_language ($lang)
 Uninstall language pack. More...
 
 update_all_installed_languages ()
 Updated all install language packs with the latest found on servre. More...
 

Public Attributes

array $availablelangs
 languages available on the remote server
 
array $errors
 list of error messages
 
array $info
 list of informational messages
 

Detailed Description

Lang import controller.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ install_languagepacks()

tool_langimport\controller::install_languagepacks (   $langs,
  $updating = false 
)

Install language packs provided.

Parameters
string | array$langsarray of langcodes or individual langcodes
bool$updatingtrue if updating the langpacks
Return values
intfalse if an error encountered or
Exceptions
moodle_exceptionwhen error is encountered installing langpack

◆ is_installed_lang()

tool_langimport\controller::is_installed_lang (   $lang,
  $md5check 
)

checks the md5 of the zip file, grabbed from download.moodle.org, against the md5 of the local language file from last update

Parameters
string$langlanguage code
string$md5checkmd5 to check
Return values
booltrue if installed

◆ lang_pack_url()

tool_langimport\controller::lang_pack_url (   $langcode = '')

Returns the URL where a given language pack can be downloaded.

Alternatively, if the parameter is empty, returns URL of the page with the list of all available language packs.

Parameters
string$langcodelanguage code like 'cs' or empty for unknown
Return values
stringURL

◆ uninstall_language()

tool_langimport\controller::uninstall_language (   $lang)

Uninstall language pack.

Parameters
string$langlanguage code
Return values
booltrue if language succesfull installed

◆ update_all_installed_languages()

tool_langimport\controller::update_all_installed_languages ( )

Updated all install language packs with the latest found on servre.

Return values
booltrue if languages succesfully updated.

The documentation for this class was generated from the following file: