ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 __construct (int $id=0, bool $reference=true)
 
 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 $desc)
 
 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)
 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 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 _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)
 

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
 
int $id
 
bool $referenced
 
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 = ""
 
bool $offline = false
 
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 477 of file class.ilObjLanguageExt.php.

References $DIC, $ilDB, ilObjLanguage\$key, $keys, ilObject\$lng, and ilObjLanguage\deleteLangEntry().

Referenced by ilObjLanguageExtGUI\maintainExecuteObject().

477  : void
478  {
479  global $DIC;
480  $ilDB = $DIC->database();
481  $lng = $DIC->language();
482 
483  if (!is_array($a_values)) {
484  return;
485  }
486  $delete_array = array();
487 
488  // save the single translations in lng_data
489  foreach ($a_values as $key => $value) {
490  $keys = explode($lng->separator, $key);
491  if (count($keys) === 2) {
492  $module = $keys[0];
493  $topic = $keys[1];
494  $delete_array[$module][$topic] = $value;
495 
496  ilObjLanguage::deleteLangEntry($module, $topic, $a_lang_key);
497  }
498  }
499 
500  // save the serialized module entries in lng_modules
501  foreach ($delete_array as $module => $entries) {
502  $set = $ilDB->query(sprintf(
503  "SELECT * FROM lng_modules " .
504  "WHERE lang_key = %s AND module = %s",
505  $ilDB->quote($a_lang_key, "text"),
506  $ilDB->quote($module, "text")
507  ));
508  $row = $ilDB->fetchAssoc($set);
509 
510  $arr = unserialize($row["lang_array"], ["allowed_classes" => false]);
511  if (is_array($arr)) {
512  $entries = array_diff_key($arr, $entries);
513  }
514  ilObjLanguage::replaceLangModule($a_lang_key, $module, $entries);
515  }
516  }
global $DIC
Definition: feed.php:28
$keys
Definition: metadata.php:204
ilLanguage $lng
static deleteLangEntry(string $a_module, string $a_identifier, string $a_lang_key)
Delete lang entry.
+ 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 296 of file class.ilObjLanguageExt.php.

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

Referenced by ilLanguageExtTableGUI\initFilter(), and ilObjLanguageExtGUI\statisticsObject().

296  : array
297  {
298  global $DIC;
299  $ilDB = $DIC->database();
300 
301  $q = "SELECT DISTINCT module FROM lng_data WHERE " .
302  " lang_key = " . $ilDB->quote($a_lang_key, "text") . " order by module";
303  $set = $ilDB->query($q);
304 
305  $modules = array();
306  while ($rec = $set->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) {
307  $modules[] = $rec["module"];
308  }
309  return $modules;
310  }
global $DIC
Definition: feed.php:28
+ 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 320 of file class.ilObjLanguageExt.php.

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

Referenced by ilObjLanguageExtGUI\viewObject().

320  : array
321  {
322  global $DIC;
323  $ilDB = $DIC->database();
324  $lng = $DIC->language();
325 
326  $q = "SELECT module, identifier, remarks"
327  . " FROM lng_data"
328  . " WHERE lang_key = " . $ilDB->quote($a_lang_key, "text");
329 
330  if ($a_all_changed) {
331  $q .= " AND (remarks IS NOT NULL OR local_change IS NOT NULL)";
332  } else {
333  $q .= " AND remarks IS NOT NULL";
334  }
335 
336  $result = $ilDB->query($q);
337 
338  $remarks = array();
339  while ($row = $ilDB->fetchAssoc($result)) {
340  $remarks[$row["module"] . $lng->separator . $row["identifier"]] = $row["remarks"];
341  }
342  return $remarks;
343  }
global $DIC
Definition: feed.php:28
ilLanguage $lng
+ 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 356 of file class.ilObjLanguageExt.php.

References $DIC, $ilDB, ilObject\$lng, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by ilObjLanguageExtGUI\viewObject().

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

◆ _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 403 of file class.ilObjLanguageExt.php.

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

Referenced by ilObjLanguageExtGUI\saveObject().

403  : void
404  {
405  global $DIC;
406  $ilDB = $DIC->database();
407  $lng = $DIC->language();
408 
409  if (!is_array($a_values)) {
410  return;
411  }
412  $save_array = [];
413  $save_date = (new DateTime())->format("Y-m-d H:i:s");
414 
415  // read and get the global values
416  $global_file_obj = ilLanguageFile::_getGlobalLanguageFile($a_lang_key);
417  $file_values = $global_file_obj->getAllValues();
418  $file_comments = $global_file_obj->getAllComments();
419  $db_values = self::_getValues($a_lang_key);
420  $db_comments = self::_getRemarks($a_lang_key);
421  $global_values = array_merge($db_values, $file_values);
422  $global_comments = array_merge($db_comments, $file_comments);
423 
424  // save the single translations in lng_data
425  foreach ($a_values as $key => $value) {
426  $keys = explode($lng->separator, $key);
427 
428  if (count($keys) !== 2) {
429  continue;
430  }
431 
432  list($module, $topic) = $keys;
433  $save_array[$module][$topic] = $value;
434 
435  $are_comments_set = array_key_exists($key, $global_comments) && array_key_exists($key, $a_remarks);
436  $are_changes_made = (isset($global_values[$key]) ? $global_values[$key] != $value : true) || (isset($db_values[$key]) ? $db_values[$key] != $value : true);
437  if ($are_changes_made || ($are_comments_set ? $global_comments[$key] != $a_remarks[$key] : $are_comments_set)) {
438  $local_change = (isset($db_values[$key]) ? $db_values[$key] == $value : true) || (isset($global_values[$key]) ? $global_values[$key] != $value : true) ? $save_date : null;
440  $module,
441  $topic,
442  $a_lang_key,
443  $value,
444  $local_change,
445  $a_remarks[$key] ?? null
446  );
447  }
448  }
449 
450  // save the serialized module entries in lng_modules
451  foreach ($save_array as $module => $entries) {
452  $set = $ilDB->query(sprintf(
453  "SELECT * FROM lng_modules " .
454  "WHERE lang_key = %s AND module = %s",
455  $ilDB->quote($a_lang_key, "text"),
456  $ilDB->quote($module, "text")
457  ));
458  $row = $ilDB->fetchAssoc($set);
459 
460  $arr = isset($row["lang_array"]) ? unserialize($row["lang_array"], ["allowed_classes" => false]) : "";
461  if (is_array($arr)) {
462  $entries = array_merge($arr, $entries);
463  }
464  ilObjLanguage::replaceLangModule($a_lang_key, $module, $entries);
465  }
466 
467  require_once("class.ilCachedLanguage.php");
468  ilCachedLanguage::getInstance($a_lang_key)->flush();
469  }
global $DIC
Definition: feed.php:28
$keys
Definition: metadata.php:204
ilLanguage $lng
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.
static _getGlobalLanguageFile(string $a_lang_key)
Read and get a global language file as a singleton object $a_lang_key language key.
+ 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 159 of file class.ilObjLanguageExt.php.

References getGlobalLanguageFile().

159  : array
160  {
161  $global_file_obj = $this->getGlobalLanguageFile();
162  $global_values = $global_file_obj->getAllValues();
163  $local_values = self::_getValues($this->key, $a_modules, $a_topics, $a_pattern);
164 
165  return array_diff_key($local_values, $global_values);
166  }
getGlobalLanguageFile()
Read and get the global language file as an object.
+ 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 106 of file class.ilObjLanguageExt.php.

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

◆ 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 119 of file class.ilObjLanguageExt.php.

Referenced by getMergedRemarks().

119  : array
120  {
121  return self::_getValues($this->key, $a_modules, $a_topics, $a_pattern);
122  }
+ Here is the caller 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 134 of file class.ilObjLanguageExt.php.

Referenced by getMergedRemarks().

134  : array
135  {
136  return self::_getValues($this->key, $a_modules, $a_topics, $a_pattern, "changed");
137  }
+ Here is the caller 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 180 of file class.ilObjLanguageExt.php.

References getGlobalLanguageFile().

180  : array
181  {
182  $global_file_obj = $this->getGlobalLanguageFile();
183  $global_comments = $global_file_obj->getAllComments();
184  $local_values = self::_getValues($this->key, $a_modules, $a_topics, $a_pattern);
185 
186  return array_intersect_key($local_values, $global_comments);
187  }
getGlobalLanguageFile()
Read and get the global language file as an object.
+ 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 96 of file class.ilObjLanguageExt.php.

References ilObjLanguage\$cust_lang_path.

96  : string
97  {
98  return $this->cust_lang_path;
99  }

◆ getDataPath()

ilObjLanguageExt::getDataPath ( )

Return the path for language data written by ILIAS.

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

References CLIENT_DATA_DIR, and ilFileUtils\makeDir().

73  : string
74  {
75  if (!is_dir(CLIENT_DATA_DIR . "/lang_data")) {
76  ilFileUtils::makeDir(CLIENT_DATA_DIR . "/lang_data");
77  }
78  return CLIENT_DATA_DIR . "/lang_data";
79  }
const CLIENT_DATA_DIR
Definition: constants.php:46
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ 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.

References ilLanguageFile\_getGlobalLanguageFile().

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

35  : object
36  {
37  require_once "./Services/Language/classes/class.ilLanguageFile.php";
38  return ilLanguageFile::_getGlobalLanguageFile($this->key);
39  }
static _getGlobalLanguageFile(string $a_lang_key)
Read and get a global language file as a singleton object $a_lang_key language key.
+ 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 86 of file class.ilObjLanguageExt.php.

References ilObjLanguage\$lang_path.

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

◆ getLongDescription()

ilObjLanguageExt::getLongDescription ( )

Get the full language description.

Return description

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

References ILIAS\Repository\lng().

64  : string
65  {
66  return $this->lng->txt($this->desc);
67  }
+ 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 221 of file class.ilObjLanguageExt.php.

References $DIC, $ilDB, $ilErr, ilObjLanguage\$key, ilObjLanguage\_deleteLangData(), getAllValues(), getChangedValues(), and getGlobalLanguageFile().

221  : array
222  {
223  $global_file_obj = $this->getGlobalLanguageFile();
224  $global_comments = $global_file_obj->getAllComments();
225 
226  // get remarks including empty remarks for local changes
227  $local_remarks = self::_getRemarks($this->key, true);
228 
229  return array_merge($global_comments, $local_remarks);
230  }
getGlobalLanguageFile()
Read and get the global language file as an object.
+ 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 201 of file class.ilObjLanguageExt.php.

References getGlobalLanguageFile().

201  : array
202  {
203  $global_file_obj = $this->getGlobalLanguageFile();
204  $global_values = $global_file_obj->getAllValues();
205  $local_values = self::_getValues($this->key);
206 
207  return array_merge($global_values, $local_values);
208  }
getGlobalLanguageFile()
Read and get the global language file as an object.
+ 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 146 of file class.ilObjLanguageExt.php.

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

◆ setLocal()

ilObjLanguageExt::setLocal ( bool  $a_local = true)

Set the local status of the language.

$a_local local status (true/false)

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

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

46  : void
47  {
48  if ($this->isInstalled()) {
49  if ($a_local) {
50  $this->setDescription("installed_local");
51  } else {
52  $this->setDescription("installed");
53  }
54  $this->update();
55  }
56  }
isInstalled()
Check language object status, and return true if language is installed.
setDescription(string $desc)
+ Here is the call graph for this function:

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