4require_once 
"./Services/Language/classes/class.ilObjLanguage.php";
 
   31                require_once 
"./Services/Language/classes/class.ilLanguageFile.php";
 
   64                return $this->lng->txt($this->desc);
 
   84                return $this->cust_lang_path;
 
  120                return self::_getValues($this->key, $a_modules, NULL, $a_pattern, 
'changed');
 
  134                return self::_getValues($this->key, $a_modules, NULL, $a_pattern, 
'unchanged');
 
  147                $global_values = $global_file_obj->getAllValues();
 
  150                return array_diff_key($local_values, $global_values);
 
  167                $global_comments = $global_file_obj->getAllComments();
 
  170                return array_intersect_key($local_values, $global_comments);
 
  189                $global_values = $global_file_obj->getAllValues();
 
  192                return array_merge($global_values, $local_values);
 
  210                $global_comments = $global_file_obj->getAllComments();
 
  215                return array_merge($global_comments, $local_remarks);
 
  231                require_once 
"./Services/Language/classes/class.ilLanguageFile.php";
 
  233                if (!$import_file_obj->read())
 
  235                        $ilErr->raiseError($import_file_obj->getErrorMessage(),
$ilErr->MESSAGE);
 
  238                switch($a_mode_existing)
 
  258                                $ilDB->manipulate(
"DELETE FROM lng_modules WHERE lang_key = ".
 
  259                                        $ilDB->quote($this->key, 
"text"));
 
  269                foreach ($import_file_obj->getAllValues() as 
$key => $value)
 
  271                        if (!isset($to_keep[
$key]))
 
  273                                $to_save[
$key] = $value;
 
  290                $q = 
"SELECT DISTINCT module FROM lng_data WHERE ".
 
  291                        " lang_key = ".$ilDB->quote($a_lang_key, 
"text").
" order by module";
 
  292                $set = 
$ilDB->query($q);
 
  296                        $modules[] = $rec[
"module"];
 
  310        public static function _getRemarks($a_lang_key, $a_all_changed = 
false)
 
  314            $q = 
"SELECT module, identifier, remarks" 
  316                .       
" WHERE lang_key = ".$ilDB->quote($a_lang_key, 
"text");
 
  320                        $q .= 
" AND (remarks IS NOT NULL OR local_change IS NOT NULL)";
 
  324                $q .= 
" AND remarks IS NOT NULL";
 
  332                        $remarks[
$row[
"module"].$lng->separator.$row[
"identifier"]] = 
$row[
"remarks"];
 
  350                        $a_modules = array(), $a_topics = array(),
 
  351                        $a_pattern = 
'', $a_state = 
'')
 
  355                $q = 
"SELECT * FROM lng_data WHERE".
 
  356                        " lang_key = ".$ilDB->quote($a_lang_key, 
"text").
" ";
 
  358                if (is_array($a_modules) && count($a_modules) > 0)
 
  360                        $q .= 
" AND ".$ilDB->in(
"module", $a_modules, 
false, 
"text");
 
  362                if (is_array($a_topics) && count($a_topics) > 0)
 
  364                        $q .= 
" AND ".$ilDB->in(
"identifier", $a_topics, 
false, 
"text");
 
  368                        $q .= 
" AND ".$ilDB->like(
"value", 
"text", 
"%".$a_pattern.
"%");
 
  370                if ($a_state == 
"changed")
 
  372                        $q .= 
" AND NOT local_change IS NULL ";
 
  374                if ($a_state == 
"unchanged")
 
  376                        $q .= 
" AND local_change IS NULL ";
 
  378                $q .= 
" ORDER BY module, identifier";
 
  380                $set = 
$ilDB->query($q);
 
  385                        $values[$rec[
"module"].$lng->separator.$rec[
"identifier"]] = $rec[
"value"];
 
  401        public static function _saveValues($a_lang_key, $a_values = array(), $a_remarks = array())
 
  405                if (!is_array($a_values))
 
  409                $save_array = array();
 
  410                $save_date = date(
"Y-m-d H:i:s", time());
 
  413                require_once 
"./Services/Language/classes/class.ilLanguageFile.php";
 
  415                $global_values = $global_file_obj->getAllValues();
 
  416                $global_comments = $global_file_obj->getAllComments();
 
  419                foreach ($a_values as 
$key => $value)
 
  421                        $keys = explode(
$lng->separator, 
$key);
 
  422                        if (count($keys) == 2)
 
  426                                $save_array[$module][$topic] = $value;
 
  428                if ($global_values[
$key] != $value
 
  429                                or  $global_comments[
$key] != $a_remarks[
$key])
 
  431                                        $local_change = $save_date;
 
  435                        $local_change = 
null;
 
  439                                        $a_lang_key, $value, $local_change, $a_remarks[
$key]);
 
  444                foreach ($save_array as $module => $entries)
 
  446                        $set = 
$ilDB->query(sprintf(
"SELECT * FROM lng_modules " .
 
  447                                "WHERE lang_key = %s AND module = %s",
 
  448                                $ilDB->quote($a_lang_key, 
"text"), 
$ilDB->quote($module, 
"text")));
 
  451                        $arr = unserialize(
$row[
"lang_array"]);
 
  454                                $entries = array_merge($arr, $entries);
 
  456                        ilObjLanguage::replaceLangModule($a_lang_key, $module, $entries);
 
  460                require_once(
'class.ilCachedLanguage.php');
 
  476                if (!is_array($a_values))
 
  480                $delete_array = array();
 
  483                foreach ($a_values as 
$key => $value)
 
  485                        $keys = explode(
$lng->separator, 
$key);
 
  486                        if (count($keys) == 2)
 
  490                                $delete_array[$module][$topic] = $value;
 
  497                foreach ($delete_array as $module => $entries)
 
  499                        $set = 
$ilDB->query(sprintf(
"SELECT * FROM lng_modules " .
 
  500                                "WHERE lang_key = %s AND module = %s",
 
  501                                $ilDB->quote($a_lang_key, 
"text"), 
$ilDB->quote($module, 
"text")));
 
  504                        $arr = unserialize(
$row[
"lang_array"]);
 
  507                                $entries = array_diff_key($arr, $entries);
 
  509                        ilObjLanguage::replaceLangModule($a_lang_key, $module, $entries);
 
static _getGlobalLanguageFile($a_lang_key)
Read and get a global language file as a singleton object.
getGlobalLanguageFile()
Read and get the global language file as an object.
getCommentedValues($a_modules=array(), $a_pattern='')
Get all values from the database for wich the global language file has a comment.
getAllValues($a_modules=array(), $a_pattern='')
Get all values from the database.
importLanguageFile($a_file, $a_mode_existing='keepnew')
Import a language file into the ilias database.
ilObjLanguageExt($a_id=0, $a_call_by_reference=false)
Constructor.
static _getValues($a_lang_key, $a_modules=array(), $a_topics=array(), $a_pattern='', $a_state='')
Get the translations of specified topics.
getUnchangedValues($a_modules=array(), $a_pattern='')
Get only the unchanged values from the database which are equal to the original language file.
static _deleteValues($a_lang_key, $a_values=array())
Delete a set of translation in the database.
getLongDescription()
Get the full language description.
static _getModules($a_lang_key)
Get all modules of a language.
getMergedValues()
Get the local values merged into the values of the global language file.
getCustLangPath()
Get the customized language files path.
static _getRemarks($a_lang_key, $a_all_changed=false)
Get all remarks of a language.
setLocal($a_local=true)
Set the local status of the language.
getAddedValues($a_modules=array(), $a_pattern='')
Get only the entries which don't exist in the global language file.
getLangPath()
Get the language files path.
static _saveValues($a_lang_key, $a_values=array(), $a_remarks=array())
Save a set of translation in the database.
getMergedRemarks()
Get the local remarks merged into the remarks of the global language file.
getChangedValues($a_modules=array(), $a_pattern='')
Get only the changed values from the database which differ from the original language file.
getAllRemarks()
Get all remarks from the database.
static _deleteLangData($a_lang_key, $a_keep_local_change=false)
Delete languge data.
ilObjLanguage($a_id=0, $a_call_by_reference=false)
Constructor.
static deleteLangEntry($a_module, $a_identifier, $a_lang_key)
Delete lang entry.
isInstalled()
Check language object status, and return true if language is installed.
static replaceLangEntry($a_module, $a_identifier, $a_lang_key, $a_value, $a_local_change=null, $a_remarks=null)
Replace lang entry.
update()
update object in db
setDescription($a_desc)
set object description