ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjLanguageExt Class Reference

Class ilObjLanguageExt. More...

+ Inheritance diagram for ilObjLanguageExt:
+ Collaboration diagram for ilObjLanguageExt:

Public Member Functions

 getGlobalLanguageFile ()
 Read and get the global language file as an object. More...
 
 setLocal (bool $a_local=true)
 Set the local status of the language. More...
 
 getLongDescription ()
 Get the full language description. More...
 
 getDataPath ()
 Return the path for language data written by ILIAS. More...
 
 getLangPath ()
 Get the language files path. More...
 
 getCustLangPath ()
 Get the customized language files path. More...
 
 getAllRemarks ()
 Get all remarks from the database. More...
 
 getAllValues (array $a_modules=array(), string $a_pattern="", array $a_topics=array())
 Get all values from the database. More...
 
 getChangedValues (array $a_modules=array(), string $a_pattern="", array $a_topics=array())
 Get only the changed values from the database which differ from the original language file. More...
 
 getUnchangedValues (array $a_modules=array(), string $a_pattern="", array $a_topics=array())
 Get only the unchanged values from the database which are equal to the original language file. More...
 
 getAddedValues (array $a_modules=array(), string $a_pattern='', array $a_topics=array())
 Get only the entries which don't exist in the global language file. More...
 
 getCommentedValues (array $a_modules=array(), string $a_pattern="", array $a_topics=array())
 Get all values from the database for wich the global language file has a comment. More...
 
 getMergedValues ()
 Get the local values merged into the values of the global language file. More...
 
 getMergedRemarks ()
 Get the local remarks merged into the remarks of the global language file. More...
 
- Public Member Functions inherited from ilObjLanguage
 __construct (int $a_id=0, bool $a_call_by_reference=false)
 Constructor. More...
 
 getKey ()
 get language key More...
 
 getStatus ()
 get language status More...
 
 isSystemLanguage ()
 check if language is system language More...
 
 isUserLanguage ()
 check if language is system language More...
 
 isInstalled ()
 Check language object status, and return true if language is installed. More...
 
 isLocal ()
 Check language object status, and return true if a local language file is installed. More...
 
 install (string $scope="")
 install current language More...
 
 uninstall ()
 uninstall current language More...
 
 refresh ()
 refresh current language More...
 
 flush (string $a_mode="all")
 remove language data from database $a_mode "all" or "keep_local" More...
 
 getLocalChanges (string $a_min_date="", string $a_max_date="")
 get locally changed language entries $a_min_date minimum change date "yyyy-mm-dd hh:mm:ss" $a_max_date maximum change date "yyyy-mm-dd hh:mm:ss" Return array [module][identifier] => value More...
 
 insert (string $scope="")
 insert language data from file into database More...
 
 resetUserLanguage (string $lang_key)
 search ILIAS for users which have selected '$lang_key' as their prefered language and reset them to default language (english). More...
 
 optimizeData ()
 optimizes the db-table langdata More...
 
 check (string $scope="")
 Validate the logical structure of a lang file. More...
 
- Public Member Functions inherited from ilObject
 getObjectProperties ()
 
 flushObjectProperties ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id, int $new_obj_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static _getModules (string $a_lang_key)
 Get all modules of a language. More...
 
static _getRemarks (string $a_lang_key, bool $a_all_changed=false)
 Get all remarks of a language. More...
 
static _getValues (string $a_lang_key, array $a_modules=array(), array $a_topics=array(), string $a_pattern='', string $a_state='')
 Get the translations of specified topics. More...
 
static _saveValues (string $a_lang_key, array $a_values=array(), array $a_remarks=array())
 Save a set of translation in the database. More...
 
static _deleteValues (string $a_lang_key, array $a_values=array())
 Delete a set of translation in the database. More...
 
- Static Public Member Functions inherited from ilObjLanguage
static getInstalledLanguages ()
 Get the language objects of the installed languages. More...
 
static refreshAll ()
 Refresh all installed languages. More...
 
static refreshPlugins (?array $a_lang_keys=null)
 Refresh languages of activated plugins $a_lang_keys keys of languages to be refreshed (not yet supported, all available will be refreshed) More...
 
static _deleteLangData (string $a_lang_key, bool $a_keep_local_change=false)
 Delete languge data $a_lang_key lang key. More...
 
static _getLastLocalChange (string $a_key)
 get the date of the last local change $a_key language key Return change_date "yyyy-mm-dd hh:mm:ss" More...
 
static _getLocalChangesByModule (string $a_key, string $a_module)
 Get the local changes of a language module $a_key Language key $a_module Module key Return array identifier => value. More...
 
static replaceLangModule (string $a_key, string $a_module, array $a_array)
 Replace language module array. More...
 
static replaceLangEntry (string $a_module, string $a_identifier, string $a_lang_key, string $a_value, ?string $a_local_change=null, ?string $a_remarks=null)
 Replace lang entry. More...
 
static updateLangEntry (string $a_module, string $a_identifier, string $a_lang_key, string $a_value, ?string $a_local_change=null, ?string $a_remarks=null)
 Replace lang entry. More...
 
static deleteLangEntry (string $a_module, string $a_identifier, string $a_lang_key)
 Delete lang entry. More...
 
static cut_header (array $content)
 remove lang-file haeder information from '$content' This function seeks for a special keyword where the language information starts. More...
 
static countUsers (string $a_lang)
 Count number of users that use a language. More...
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", ?int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static getIconForType (string $type)
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, ?\ilDBInterface $ilDB=null)
 

Static Private Member Functions

static _mergeLanguageEntriesFromRow (?array $databaseRow, array $entries)
 Merge language entries from a database row with existing entries. More...
 

Additional Inherited Members

- Data Fields inherited from ilObjLanguage
string $separator
 separator of module, comment separator, identifier & values in language files More...
 
string $comment_separator
 
string $lang_default
 
string $lang_user
 
string $lang_path
 
string $key
 
string $status
 
string $cust_lang_path
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 
- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
LOMServices $lom_services
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

Member Function Documentation

◆ _deleteValues()

static ilObjLanguageExt::_deleteValues ( string  $a_lang_key,
array  $a_values = array() 
)
static

Delete a set of translation in the database.

$a_lang_key language key $a_values module.separator.topic => value

Definition at line 499 of file class.ilObjLanguageExt.php.

499 : void
500 {
501 global $DIC;
502 $ilDB = $DIC->database();
503 $lng = $DIC->language();
504
505 if (!is_array($a_values)) {
506 return;
507 }
508 $delete_array = array();
509
510 // save the single translations in lng_data
511 foreach ($a_values as $key => $value) {
512 $keys = explode($lng->separator, $key);
513 if (count($keys) === 2) {
514 $module = $keys[0];
515 $topic = $keys[1];
516 $delete_array[$module][$topic] = $value;
517
518 ilObjLanguage::deleteLangEntry($module, $topic, $a_lang_key);
519 }
520 }
521
522 // save the serialized module entries in lng_modules
523 foreach ($delete_array as $module => $entries) {
524 $set = $ilDB->query(sprintf(
525 "SELECT * FROM lng_modules " .
526 "WHERE lang_key = %s AND module = %s",
527 $ilDB->quote($a_lang_key, "text"),
528 $ilDB->quote($module, "text")
529 ));
530 $row = $ilDB->fetchAssoc($set);
531
532 $arr = unserialize($row["lang_array"], ["allowed_classes" => false]);
533 if (is_array($arr)) {
534 $entries = array_diff_key($arr, $entries);
535 }
536 ilObjLanguage::replaceLangModule($a_lang_key, $module, $entries);
537 }
538 }
static deleteLangEntry(string $a_module, string $a_identifier, string $a_lang_key)
Delete lang entry.
static replaceLangModule(string $a_key, string $a_module, array $a_array)
Replace language module array.
ilLanguage $lng
global $DIC
Definition: shib_login.php:26

References $DIC, $ilDB, $lng, ilObjLanguage\deleteLangEntry(), and ilObjLanguage\replaceLangModule().

Referenced by ilObjLanguageExtGUI\maintainExecuteObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getModules()

static ilObjLanguageExt::_getModules ( string  $a_lang_key)
static

Get all modules of a language.

$a_lang_key language key Return list of modules

Definition at line 294 of file class.ilObjLanguageExt.php.

294 : array
295 {
296 global $DIC;
297 $ilDB = $DIC->database();
298
299 $q = "SELECT DISTINCT module FROM lng_data WHERE " .
300 " lang_key = " . $ilDB->quote($a_lang_key, "text") . " order by module";
301 $set = $ilDB->query($q);
302
303 $modules = array();
304 while ($rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
305 $modules[] = $rec["module"];
306 }
307 return $modules;
308 }
$q
Definition: shib_logout.php:23

References $DIC, $ilDB, $q, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by ilLanguageStatisticsTable\getItems(), and ilLanguageExtTableGUI\initFilter().

+ Here is the caller graph for this function:

◆ _getRemarks()

static ilObjLanguageExt::_getRemarks ( string  $a_lang_key,
bool  $a_all_changed = false 
)
static

Get all remarks of a language.

$a_lang_key language key $a_all_changed include empty remarks for local changes Return array module.separator.topic => remarks

Definition at line 318 of file class.ilObjLanguageExt.php.

318 : array
319 {
320 global $DIC;
321 $ilDB = $DIC->database();
322 $lng = $DIC->language();
323
324 $q = "SELECT module, identifier, remarks"
325 . " FROM lng_data"
326 . " WHERE lang_key = " . $ilDB->quote($a_lang_key, "text");
327
328 if ($a_all_changed) {
329 $q .= " AND (remarks IS NOT NULL OR local_change IS NOT NULL)";
330 } else {
331 $q .= " AND remarks IS NOT NULL";
332 }
333
334 $result = $ilDB->query($q);
335
336 $remarks = array();
337 while ($row = $ilDB->fetchAssoc($result)) {
338 $remarks[$row["module"] . $lng->separator . $row["identifier"]] = $row["remarks"];
339 }
340 return $remarks;
341 }

References $DIC, $ilDB, ilObject\$lng, and $q.

Referenced by getAllRemarks(), getMergedRemarks(), and ilObjLanguageExtGUI\viewObject().

+ Here is the caller graph for this function:

◆ _getValues()

static ilObjLanguageExt::_getValues ( string  $a_lang_key,
array  $a_modules = array(),
array  $a_topics = array(),
string  $a_pattern = '',
string  $a_state = '' 
)
static

Get the translations of specified topics.

$a_lang_key language key $a_modules list of modules $a_topics list of topics $a_pattern search pattern $a_state local change state ('changed', 'unchanged', '') Return array module.separator.topic => value

Definition at line 354 of file class.ilObjLanguageExt.php.

360 : array {
361 global $DIC;
362 $ilDB = $DIC->database();
363 $lng = $DIC->language();
364
365 $q = "SELECT * FROM lng_data WHERE" .
366 " lang_key = " . $ilDB->quote($a_lang_key, "text") . " ";
367
368 if (is_array($a_modules) && count($a_modules) > 0) {
369 $q .= " AND " . $ilDB->in("module", $a_modules, false, "text");
370 }
371 if (is_array($a_topics) && count($a_topics) > 0) {
372 $q .= " AND " . $ilDB->in("identifier", $a_topics, false, "text");
373 }
374 if ($a_pattern) {
375 $q .= " AND " . $ilDB->like("value", "text", "%" . $a_pattern . "%");
376 }
377 if ($a_state === "changed") {
378 $q .= " AND NOT local_change IS NULL ";
379 }
380 if ($a_state === "unchanged") {
381 $q .= " AND local_change IS NULL ";
382 }
383 $q .= " ORDER BY module, identifier";
384
385 $set = $ilDB->query($q);
386
387 $values = array();
388 while ($rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
389 $values[$rec["module"] . $lng->separator . $rec["identifier"]] = $rec["value"];
390 }
391 return $values;
392 }

References $ilDB, and $q.

Referenced by getAddedValues(), getAllValues(), getChangedValues(), getCommentedValues(), getMergedValues(), getUnchangedValues(), and ilObjLanguageExtGUI\viewObject().

+ Here is the caller graph for this function:

◆ _mergeLanguageEntriesFromRow()

static ilObjLanguageExt::_mergeLanguageEntriesFromRow ( ?array  $databaseRow,
array  $entries 
)
staticprivate

Merge language entries from a database row with existing entries.

$databaseRow associative array representing a row from the database, may be null $entries array of existing language entries to be merged Return array merged array of language entries

Definition at line 478 of file class.ilObjLanguageExt.php.

478 : array
479 {
480 if ($databaseRow === null || !isset($databaseRow["lang_array"])) {
481 return $entries;
482 }
483
484 $languageEntries = unserialize($databaseRow["lang_array"], ["allowed_classes" => false]);
485 if (!is_array($languageEntries)) {
486 return $entries;
487 }
488
489 return array_merge($languageEntries, $entries);
490 }

◆ _saveValues()

static ilObjLanguageExt::_saveValues ( string  $a_lang_key,
array  $a_values = array(),
array  $a_remarks = array() 
)
static

Save a set of translation in the database.

$a_lang_key language key $a_values module.separator.topic => value $a_remarks module.separator.topic => remarks

Definition at line 401 of file class.ilObjLanguageExt.php.

401 : void
402 {
403 global $DIC;
404 $ilDB = $DIC->database();
405 $lng = $DIC->language();
406
407 if (!is_array($a_values)) {
408 return;
409 }
410 $save_array = [];
411 $save_date = (new DateTimeImmutable('now', new DateTimeZone('UTC')))
412 ->format('Y-m-d H:i:s');
413
414 // read and get the global values
415 $global_file_obj = ilLanguageFile::_getGlobalLanguageFile($a_lang_key);
416 $file_values = $global_file_obj->getAllValues();
417 $file_comments = $global_file_obj->getAllComments();
418 $db_values = self::_getValues($a_lang_key);
419 $db_comments = self::_getRemarks($a_lang_key);
420 $global_values = array_merge($db_values, $file_values);
421 $global_comments = array_merge($db_comments, $file_comments);
422
423 // save the single translations in lng_data
424 foreach ($a_values as $key => $value) {
425 $keys = explode($lng->separator, $key);
426
427 if (count($keys) !== 2) {
428 continue;
429 }
430
431 list($module, $topic) = $keys;
432 $save_array[$module][$topic] = $value;
433
434 $are_comments_set = array_key_exists($key, $global_comments) && array_key_exists($key, $a_remarks);
435 $are_changes_made = (isset($global_values[$key]) ? $global_values[$key] != $value : true) || (isset($db_values[$key]) ? $db_values[$key] != $value : true);
436 if ($are_changes_made || ($are_comments_set ? $global_comments[$key] != $a_remarks[$key] : $are_comments_set)) {
437 $local_change = (isset($db_values[$key]) ? $db_values[$key] == $value : true) || (isset($global_values[$key]) ? $global_values[$key] != $value : true) ? $save_date : null;
439 $module,
440 $topic,
441 $a_lang_key,
442 $value,
443 $local_change,
444 $a_remarks[$key] ?? null
445 );
446 }
447 }
448
449 // save the serialized module entries in lng_modules
450 foreach ($save_array as $module => $entries) {
451 $set = $ilDB->query(sprintf(
452 "SELECT * FROM lng_modules " .
453 "WHERE lang_key = %s AND module = %s",
454 $ilDB->quote($a_lang_key, "text"),
455 $ilDB->quote($module, "text")
456 ));
457 $row = $ilDB->fetchAssoc($set);
458 if (!$row) {
459 $DIC->logger()->root()->warning("Language module '{$module}' not found for language {$a_lang_key}.");
460 continue;
461 }
462
463 $entries = self::_mergeLanguageEntriesFromRow($row, $entries);
464
465 ilObjLanguage::replaceLangModule($a_lang_key, $module, $entries);
466 }
467
468 ilCachedLanguage::getInstance($a_lang_key)->flush();
469 }
static _getGlobalLanguageFile(string $a_lang_key)
Read and get a global language file as a singleton object $a_lang_key language key.
static _mergeLanguageEntriesFromRow(?array $databaseRow, array $entries)
Merge language entries from a database row with existing entries.
static _getRemarks(string $a_lang_key, bool $a_all_changed=false)
Get all remarks of a language.
static _getValues(string $a_lang_key, array $a_modules=array(), array $a_topics=array(), string $a_pattern='', string $a_state='')
Get the translations of specified topics.
static replaceLangEntry(string $a_module, string $a_identifier, string $a_lang_key, string $a_value, ?string $a_local_change=null, ?string $a_remarks=null)
Replace lang entry.

References $DIC, $ilDB, $lng, ilLanguageFile\_getGlobalLanguageFile(), ilCachedLanguage\getInstance(), ilObjLanguage\replaceLangEntry(), and ilObjLanguage\replaceLangModule().

Referenced by ilObjLanguageExtGUI\saveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAddedValues()

ilObjLanguageExt::getAddedValues ( array  $a_modules = array(),
string  $a_pattern = '',
array  $a_topics = array() 
)

Get only the entries which don't exist in the global language file.

$a_modules list of modules $a_pattern search pattern $a_topics list of topics Return array module.separator.topic => value

Definition at line 158 of file class.ilObjLanguageExt.php.

158 : array
159 {
160 $global_file_obj = $this->getGlobalLanguageFile();
161 $global_values = $global_file_obj->getAllValues();
162 $local_values = self::_getValues($this->key, $a_modules, $a_topics, $a_pattern);
163
164 return array_diff_key($local_values, $global_values);
165 }
getGlobalLanguageFile()
Read and get the global language file as an object.

References _getValues(), and getGlobalLanguageFile().

+ Here is the call graph for this function:

◆ getAllRemarks()

ilObjLanguageExt::getAllRemarks ( )

Get all remarks from the database.

Return array module.separator.topic => remark

Definition at line 105 of file class.ilObjLanguageExt.php.

105 : array
106 {
107 return self::_getRemarks($this->key);
108 }

References _getRemarks().

+ Here is the call graph for this function:

◆ getAllValues()

ilObjLanguageExt::getAllValues ( array  $a_modules = array(),
string  $a_pattern = "",
array  $a_topics = array() 
)

Get all values from the database.

$a_modules list of modules $a_pattern search pattern $a_topics list of topics Return array module.separator.topic => value

Definition at line 118 of file class.ilObjLanguageExt.php.

118 : array
119 {
120 return self::_getValues($this->key, $a_modules, $a_topics, $a_pattern);
121 }

References _getValues().

+ Here is the call graph for this function:

◆ getChangedValues()

ilObjLanguageExt::getChangedValues ( array  $a_modules = array(),
string  $a_pattern = "",
array  $a_topics = array() 
)

Get only the changed values from the database which differ from the original language file.

$a_modules list of modules $a_pattern search pattern $a_topics list of topics Return array module.separator.topic => value

Definition at line 133 of file class.ilObjLanguageExt.php.

133 : array
134 {
135 return self::_getValues($this->key, $a_modules, $a_topics, $a_pattern, "changed");
136 }

References _getValues().

+ Here is the call graph for this function:

◆ getCommentedValues()

ilObjLanguageExt::getCommentedValues ( array  $a_modules = array(),
string  $a_pattern = "",
array  $a_topics = array() 
)

Get all values from the database for wich the global language file has a comment.

Note: This function checks the comments in the globel lang file, not the remarks in the database!

$a_modules list of modules $a_pattern search pattern $a_topics list of topics Return array module.separator.topic => value

Definition at line 179 of file class.ilObjLanguageExt.php.

179 : array
180 {
181 $global_file_obj = $this->getGlobalLanguageFile();
182 $global_comments = $global_file_obj->getAllComments();
183 $local_values = self::_getValues($this->key, $a_modules, $a_topics, $a_pattern);
184
185 return array_intersect_key($local_values, $global_comments);
186 }

References _getValues(), and getGlobalLanguageFile().

+ Here is the call graph for this function:

◆ getCustLangPath()

ilObjLanguageExt::getCustLangPath ( )

Get the customized language files path.

Return path of customized language files folder

Definition at line 95 of file class.ilObjLanguageExt.php.

95 : string
96 {
98 }

References ilObjLanguage\$cust_lang_path.

◆ getDataPath()

ilObjLanguageExt::getDataPath ( )

Return the path for language data written by ILIAS.

Definition at line 72 of file class.ilObjLanguageExt.php.

72 : string
73 {
74 if (!is_dir(CLIENT_DATA_DIR . "/lang_data")) {
76 }
77 return CLIENT_DATA_DIR . "/lang_data";
78 }
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
const CLIENT_DATA_DIR
Definition: constants.php:46

References CLIENT_DATA_DIR, and ilFileUtils\makeDir().

+ Here is the call graph for this function:

◆ getGlobalLanguageFile()

ilObjLanguageExt::getGlobalLanguageFile ( )

Read and get the global language file as an object.

Returns
object global language file

Definition at line 35 of file class.ilObjLanguageExt.php.

35 : object
36 {
38 }

References ilLanguageFile\_getGlobalLanguageFile().

Referenced by getAddedValues(), getCommentedValues(), getMergedRemarks(), and getMergedValues().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLangPath()

ilObjLanguageExt::getLangPath ( )

Get the language files path.

Return path of language files folder

Definition at line 85 of file class.ilObjLanguageExt.php.

85 : string
86 {
87 return $this->lang_path;
88 }

References ilObjLanguage\$lang_path.

◆ getLongDescription()

ilObjLanguageExt::getLongDescription ( )

Get the full language description.

Return description

Reimplemented from ilObject.

Definition at line 63 of file class.ilObjLanguageExt.php.

63 : string
64 {
65 return $this->lng->txt($this->desc);
66 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getMergedRemarks()

ilObjLanguageExt::getMergedRemarks ( )

Get the local remarks merged into the remarks of the global language file.

The returned array contains:

  1. all remarks that exist globally, with their local values, ordered like in the global language file
  2. all additional local remarks, ordered by module and identifier

Return array module.separator.topic => value

Definition at line 220 of file class.ilObjLanguageExt.php.

220 : array
221 {
222 $global_file_obj = $this->getGlobalLanguageFile();
223 $global_comments = $global_file_obj->getAllComments();
224
225 // get remarks including empty remarks for local changes
226 $local_remarks = self::_getRemarks($this->key, true);
227
228 return array_merge($global_comments, $local_remarks);
229 }

References _getRemarks(), and getGlobalLanguageFile().

+ Here is the call graph for this function:

◆ getMergedValues()

ilObjLanguageExt::getMergedValues ( )

Get the local values merged into the values of the global language file.

The returned array contains:

  1. all entries that exist globally, with their local values, ordered like in the global language file
  2. all additional local entries, ordered by module and identifier

Return array module.separator.topic => value

Definition at line 200 of file class.ilObjLanguageExt.php.

200 : array
201 {
202 $global_file_obj = $this->getGlobalLanguageFile();
203 $global_values = $global_file_obj->getAllValues();
204 $local_values = self::_getValues($this->key);
205
206 return array_merge($global_values, $local_values);
207 }

References _getValues(), and getGlobalLanguageFile().

+ Here is the call graph for this function:

◆ getUnchangedValues()

ilObjLanguageExt::getUnchangedValues ( array  $a_modules = array(),
string  $a_pattern = "",
array  $a_topics = array() 
)

Get only the unchanged values from the database which are equal to the original language file.

Return array module.separator.topic => value

Definition at line 145 of file class.ilObjLanguageExt.php.

145 : array
146 {
147 return self::_getValues($this->key, $a_modules, $a_topics, $a_pattern, "unchanged");
148 }

References _getValues().

+ Here is the call graph for this function:

◆ setLocal()

ilObjLanguageExt::setLocal ( bool  $a_local = true)

Set the local status of the language.

$a_local local status (true/false)

Definition at line 45 of file class.ilObjLanguageExt.php.

45 : void
46 {
47 if ($this->isInstalled()) {
48 if ($a_local) {
49 $this->setDescription("installed_local");
50 } else {
51 $this->setDescription("installed");
52 }
53 $this->update();
54 }
55 }
isInstalled()
Check language object status, and return true if language is installed.
setDescription(string $description)

References ilObjLanguage\isInstalled(), ilObject\setDescription(), and ilObject\update().

+ Here is the call graph for this function:

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