4 define(
"ILIAS_LANGUAGE_MODULE",
"Services/Language");
6 require_once(
"./Services/Object/classes/class.ilObjectGUI.php");
7 require_once(
"Services/Language/classes/class.ilObjLanguageAccess.php");
49 $lng->loadLanguageModule(
"administration");
50 $lng->loadLanguageModule(
"meta");
53 $ilCtrl->saveParameter($this,
"view_mode");
57 if (! $this->
id =
$_GET[
'obj_id'])
63 $this->
ilObjectGUI($a_data, $this->
id,
false,
true);
66 if (!is_array(
$_SESSION[get_class($this)]))
70 $this->session =&
$_SESSION[get_class($this)];
74 $this->langmode = $ilClientIniFile->readVariable(
"system",
"LANGMODE");
86 require_once(
"Services/Language/classes/class.ilObjLanguageExt.php");
100 $this->ilErr->raiseError($this->lng->txt(
"permission_denied"),$this->ilErr->MESSAGE);
104 $cmd = $this->ctrl->getCmd(
"view").
"Object";
107 $ilHelp->setScreenIdComponent(
"lng");
127 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lang_edit_items.html",
"Services/Language");
130 $compare = $this->
getPar(
'compare', $this->lng->getDefaultLanguage());
133 if ($compare == $this->object->key)
135 $compare_object = $this->
object->getGlobalLanguageFile();
136 $compare_content = $compare_object->getAllValues();
137 $compare_comments = $compare_object->getAllComments();
138 $compare_note =
" ". $this->lng->txt(
"language_default_entries");
142 $remarks = $this->
object->getAllRemarks();
152 $modules = $this->
getPar(
"page_modules", array());
153 $topics = $this->
getPar(
"page_topics", array());
155 if (!isset($compare_content))
158 $compare, $modules, $topics);
164 $this->object->key, $modules, $topics);
172 $offset = $this->
getPar(
'offset',
'0');
173 $limit = $ilUser->getPref(
"hits_per_page");
175 $filter_mode = $this->
getPar(
'filter_mode',
'all');
176 $filter_pattern = $this->
getPar(
'filter_pattern',
'');
177 $filter_module = $this->
getPar(
'filter_module',
'administration');
178 $filter_modules = $filter_module ? array($filter_module) : array();
180 if (!isset($compare_content))
183 $compare, $filter_modules);
188 switch ($filter_mode)
191 $translations = $this->
object->getChangedValues(
192 $filter_modules, $filter_pattern);
196 $translations = $this->
object->getAddedValues(
197 $filter_modules, $filter_pattern);
201 $translations = $this->
object->getUnchangedValues(
202 $filter_modules, $filter_pattern);
206 $translations = $this->
object->getCommentedValues(
207 $filter_modules, $filter_pattern);
211 $translations = $this->
object->getAllValues(
212 $filter_modules, $filter_pattern);
214 $translations = array_intersect_key($translations, $remarks);
218 $translations = $this->
object->getAllValues(
219 $filter_modules, $filter_pattern);
221 $translations = array_intersect_assoc($translations, $compare_content);
225 $translations = $this->
object->getAllValues(
226 $filter_modules, $filter_pattern);
228 $translations = array_diff_assoc($translations, $compare_content);
232 $former_file = $this->
object->getCustLangPath() .
'/ilias_' . $this->
object->key .
'.lang';
233 if (!is_readable($former_file))
236 .
'<br />'. $this->lng->txt(
"language_former_file_description") ,
false);
237 $translations = array();
240 $global_file_obj = $this->
object->getGlobalLanguageFile();
242 $former_file_obj->read();
243 $global_changes = array_diff_assoc(
244 $global_file_obj->getAllValues(),
245 $former_file_obj->getAllValues());
246 if (!count($global_changes))
248 ilUtil::sendInfo(sprintf($this->lng->txt(
"language_former_file_equal"), $former_file)
249 .
'<br />'. $this->lng->txt(
"language_former_file_description") ,
false);
250 $translations = array();
253 $translations = $this->
object->getChangedValues(
254 $filter_modules, $filter_pattern);
256 $translations = array_intersect_key($translations, $global_changes);
261 $translations = $this->
object->getAllValues(
262 $filter_modules, $filter_pattern);
266 $this->tpl->setCurrentBlock(
"filter");
270 $options[
""] = $this->lng->txt(
"language_all_modules");
272 foreach ($modules as $mod)
276 $this->tpl->setVariable(
"SELECT_MODULE",
281 $options[
"all"] = $this->lng->txt(
"language_scope_global");
282 $options[
"changed"] = $this->lng->txt(
"language_scope_local");
285 $options[
"added"] = $this->lng->txt(
"language_scope_added");
287 $options[
"unchanged"] = $this->lng->txt(
"language_scope_unchanged");
288 $options[
"equal"] = $this->lng->txt(
"language_scope_equal");
289 $options[
"different"] = $this->lng->txt(
"language_scope_different");
290 $options[
"commented"] = $this->lng->txt(
"language_scope_commented");
293 $options[
"dbremarks"] = $this->lng->txt(
"language_scope_dbremarks");
295 $options[
"conflicts"] = $this->lng->txt(
"language_scope_conflicts");
296 $this->tpl->setVariable(
"SELECT_MODE",
300 $this->tpl->setVariable(
"PATTERN_NAME",
"filter_pattern");
304 $this->tpl->setVariable(
"FILTER_ACTION", $this->ctrl->getFormAction($this));
305 $this->tpl->setVariable(
"TXT_FILTER", $this->lng->txt(
"filter"));
306 $this->tpl->setVariable(
"OFFSET_NAME",
"offset");
307 $this->tpl->setVariable(
"OFFSET_VALUE",
"0");
308 $this->tpl->setVariable(
"TXT_APPLY_FILTER", $this->lng->txt(
"apply_filter"));
309 $this->tpl->setVariable(
"CMD_FILTER",
"view");
310 $this->tpl->parseCurrentBlock();
314 $this->tpl->setCurrentBlock(
"compare");
315 $this->tpl->setVariable(
"COMPARE_ACTION", $this->ctrl->getFormAction($this));
316 $this->tpl->setVariable(
"TXT_COMPARE", $this->lng->txt(
"language_compare"));
317 $this->tpl->setVariable(
"TXT_CHANGE", $this->lng->txt(
"change"));
319 $langlist = $this->lng->getInstalledLanguages();
320 foreach ($langlist as $lang_key)
322 $options[$lang_key] = $this->lng->txt(
"meta_l_".$lang_key);
324 $this->tpl->setVariable(
"SELECT_COMPARE",
326 $this->tpl->setVariable(
"CMD_COMPARE",
"view");
327 $this->tpl->parseCurrentBlock();
330 $sort_by = $this->
getPar(
'sort_by',
'translation');
331 $sort_order = $this->
getPar(
'sort_order',
'asc');
334 foreach($translations as $name => $translation)
336 $keys = explode($this->lng->separator, $name);
339 $data[
"module"] = $keys[0];
340 $data[
"topic"] = $keys[1];
341 $data[
"name"] = $name;
342 $data[
"translation"] = $translation;
343 $data[
"default"] = $compare_content[$name];
344 $data[
"default_comment"] = $compare_comments[$name];
351 $list = array_slice($list, $offset, $limit);
355 include_once
'Services/Table/classes/class.ilTableGUI.php';
358 $tbl->disable(
'title');
360 $tbl->setHeaderNames(array($this->lng->txt(
"module"),
361 $this->lng->txt(
"identifier"),
362 $this->lng->txt(
"meta_l_".$this->object->key),
363 $this->lng->txt(
"meta_l_".$compare).$compare_note));
365 $tbl->setHeaderVars(array(
"module",
369 $this->ctrl->getParameterArray($this));
372 $tbl->setColumnWidth(array(
"10%",
377 $tbl->setOrderColumn($sort_by);
378 $tbl->setOrderDirection($sort_order);
379 $tbl->setLimit($limit);
380 $tbl->setOffset($offset);
381 $tbl->setMaxCount(count($translations));
386 $tpl->setCurrentBlock(
"tbl_form_header");
387 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
388 $tpl->parseCurrentBlock();
390 $tpl->setCurrentBlock(
"tbl_action_btn");
391 $tpl->setVariable(
"BTN_NAME",
'save');
392 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'save'));
393 $tpl->parseCurrentBlock();
395 $tpl->setCurrentBlock(
"tbl_action_row");
396 $tpl->setVariable(
"COLUMN_COUNTS",
"4");
397 $tpl->parseCurrentBlock();
400 $tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.lang_items_row.html",
"Services/Language");
401 foreach ($list as
$data)
405 $tpl->setCurrentBlock(
'comment');
409 $tpl->setVariable(
"COM_SIZE", $this->commentsize);
410 $tpl->setVariable(
"COM_MAX", 250);
411 $tpl->setVariable(
"TXT_COMMENT", $this->lng->txt(
'comment'));
412 $tpl->parseCurrentBlock();
416 $tpl->setCurrentBlock(
'hidden_comment');
419 $tpl->parseCurrentBlock();
422 $tpl->setCurrentBlock(
"row");
423 $tpl->setVariable(
"T_ROWS", ceil(strlen($data[
"translation"]) / $this->inputsize));
424 $tpl->setVariable(
"T_SIZE", $this->inputsize);
432 $tpl->parseCurrentBlock();
436 $tbl->setTemplate(
$tpl);
438 $this->tpl->setVariable(
"TRANSLATION_TABLE",
$tpl->get());
449 $save_array = array();
450 $remarks_array = array();
451 foreach (
$_POST as $key => $value)
455 if (count($keys) == 2)
458 $value = preg_replace(
"/(\015\012)|(\015)|(\012)/",
"<br />",$value);
460 $save_array[$key] = $value;
462 $remarks_array[$key] =
$_POST[$key.$this->lng->separator.
"comment"];
479 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lang_file_import.html",
"Services/Language");
481 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
482 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"language_import_file"));
483 $this->tpl->setVariable(
"TXT_FILE",$this->lng->txt(
"file"));
485 $this->tpl->setVariable(
"TXT_MODE",$this->lng->txt(
"language_mode_existing"));
486 $this->tpl->setVariable(
"TXT_MODE_KEEPALL",$this->lng->txt(
"language_mode_existing_keepall"));
487 $this->tpl->setVariable(
"TXT_MODE_KEEPNEW",$this->lng->txt(
"language_mode_existing_keepnew"));
488 $this->tpl->setVariable(
"TXT_MODE_REPLACE",$this->lng->txt(
"language_mode_existing_replace"));
489 $this->tpl->setVariable(
"TXT_MODE_DELETE",$this->lng->txt(
"language_mode_existing_delete"));
491 $this->tpl->setVariable(
"TXT_UPLOAD",$this->lng->txt(
"upload"));
492 $this->tpl->setVariable(
"CMD_UPLOAD",
"upload");
502 if (
$_POST[
'cmd'][
'upload'])
504 $file = $_FILES[
'userfile'][
'tmp_name'].
'x';
507 $_FILES[
'userfile'][
'name'],
510 $this->
object->importLanguageFile(
$file,
$_POST[
'mode_existing']);
511 ilUtil::sendSuccess(sprintf($this->lng->txt(
"language_file_imported"), $_FILES[
'userfile'][
'name']) ,
false);
533 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lang_file_export.html",
"Services/Language");
535 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
536 $this->tpl->setVariable(
"TXT_HEADER",$this->lng->txt(
"language_export_file"));
538 $this->tpl->setVariable(
"TXT_SCOPE",$this->lng->txt(
"language_file_scope"));
539 $this->tpl->setVariable(
"TXT_SCOPE_GLOBAL",$this->lng->txt(
"language_scope_global"));
540 $this->tpl->setVariable(
"TXT_SCOPE_LOCAL",$this->lng->txt(
"language_scope_local"));
541 $this->tpl->setVariable(
"TXT_SCOPE_UNCHANGED",$this->lng->txt(
"language_scope_unchanged"));
543 $this->tpl->setVariable(
"CHECKED_GLOBAL",$scope ==
'global' ?
'checked="checked"' :
'');
544 $this->tpl->setVariable(
"CHECKED_LOCAL",$scope ==
'local' ?
'checked="checked"' :
'');
545 $this->tpl->setVariable(
"CHECKED_UNCHANGED",$scope ==
'unchanged' ?
'checked="checked"' :
'');
549 $this->tpl->setVariable(
"TXT_SCOPE_ADDED",$this->lng->txt(
"language_scope_added"));
550 $this->tpl->setVariable(
"CHECKED_ADDED",$scope ==
'added' ?
'checked="checked"' :
'');
552 $this->tpl->setVariable(
"TXT_SCOPE_MERGED",$this->lng->txt(
"language_scope_merged"));
553 $this->tpl->setVariable(
"CHECKED_MERGED",$scope ==
'merged' ?
'checked="checked"' :
'');
556 $this->tpl->setVariable(
"TXT_DOWNLOAD",$this->lng->txt(
"download"));
557 $this->tpl->setVariable(
"CMD_DOWNLOAD",
"download");
567 $filename =
'ilias_' . $this->
object->key .
'_' 569 .
"-" . date(
'Y-m-d')
570 .
".lang.".$_POST[
"scope"];
572 $global_file_obj = $this->
object->getGlobalLanguageFile();
575 if (
$_POST[
"scope"] ==
'global')
577 $local_file_obj->setParam(
"author", $global_file_obj->getParam(
'author'));
578 $local_file_obj->setParam(
"version", $global_file_obj->getParam(
'version'));
579 $local_file_obj->setAllValues($this->object->getAllValues());
582 $local_file_obj->setAllComments($this->object->getAllRemarks());
585 elseif (
$_POST[
"scope"] ==
'local')
587 $local_file_obj->setParam(
"based_on", $global_file_obj->getParam(
'version'));
588 $local_file_obj->setAllValues($this->object->getChangedValues());
591 $local_file_obj->setAllComments($this->object->getAllRemarks());
594 elseif (
$_POST[
"scope"] ==
'added')
596 $local_file_obj->setParam(
"author", $global_file_obj->getParam(
'author'));
597 $local_file_obj->setParam(
"version", $global_file_obj->getParam(
'version'));
598 $local_file_obj->setAllValues($this->object->getAddedValues());
599 $local_file_obj->setAllComments($this->object->getAllRemarks());
601 elseif (
$_POST[
"scope"] ==
'unchanged')
603 $local_file_obj->setParam(
"author", $global_file_obj->getParam(
'author'));
604 $local_file_obj->setParam(
"version", $global_file_obj->getParam(
'version'));
605 $local_file_obj->setAllValues($this->object->getUnchangedValues());
608 $local_file_obj->setAllComments($this->object->getAllRemarks());
611 elseif (
$_POST[
"scope"] ==
'merged')
613 $local_file_obj->setParam(
"author", $global_file_obj->getParam(
'author'));
614 $local_file_obj->setParam(
"version", $global_file_obj->getParam(
'version'));
615 $local_file_obj->setAllValues($this->object->getMergedValues());
616 $local_file_obj->setAllComments($this->object->getMergedRemarks());
630 switch (
$_POST[
"maintain"])
634 $lang_file = $this->
object->getCustLangPath() .
'/ilias_' . $this->
object->key .
'.lang.local';
636 if ((is_file($lang_file) and is_writable($lang_file))
637 or (!file_exists($lang_file) and is_writable($this->object->getCustLangPath())))
640 $orig_file = $this->
object->getLangPath() .
'/ilias_' . $this->
object->key .
'.lang';
641 $copy_file = $this->
object->getCustLangPath() .
'/ilias_' . $this->
object->key .
'.lang';
642 @copy($orig_file, $copy_file);
645 @rename($lang_file, $lang_file.
".bak");
648 $global_file_obj = $this->
object->getGlobalLanguageFile();
649 $local_file_obj =
new ilLanguageFile($lang_file, $this->object->key,
'local');
650 $local_file_obj->setParam(
'based_on', $global_file_obj->getParam(
'version'));
651 $local_file_obj->setAllValues($this->object->getChangedValues());
654 $local_file_obj->setAllComments($this->object->getAllRemarks());
656 $local_file_obj->write();
658 $this->
object->setLocal(
true);
669 $lang_file = $this->
object->getCustLangPath() .
'/ilias_' . $this->
object->key .
'.lang.local';
670 if (is_file($lang_file) and is_readable($lang_file))
672 $this->
object->importLanguageFile($lang_file,
'replace');
673 $this->
object->setLocal(
true);
684 $lang_file = $this->
object->getLangPath() .
'/ilias_' . $this->
object->key .
'.lang';
685 if (is_file($lang_file) and is_readable($lang_file))
687 $this->
object->importLanguageFile($lang_file,
'delete');
688 $this->
object->setLocal(
false);
705 $orig_file = $this->
object->getLangPath() .
'/ilias_' . $this->
object->key .
'.lang';
706 $copy_file = $this->
object->getCustLangPath() .
'/ilias_' . $this->
object->key .
'.lang';
708 if (is_file($orig_file) and is_writable($orig_file))
711 @copy($orig_file, $copy_file);
714 $global_file_obj = $this->
object->getGlobalLanguageFile();
715 $global_file_obj->setAllValues($this->object->getMergedValues());
716 $global_file_obj->setAllComments($this->object->getMergedRemarks());
717 $global_file_obj->write();
727 case "remove_local_file":
728 $lang_file = $this->
object->getCustLangPath() .
'/ilias_' . $this->
object->key .
'.lang.local';
730 if (!is_file($lang_file))
732 $this->
object->setLocal(
false);
735 elseif (@unlink($lang_file))
737 $this->
object->setLocal(
false);
748 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lang_maintenance.html",
"Services/Language");
749 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
750 $this->tpl->setVariable(
"TXT_MAINTENANCE",$this->lng->txt(
"language_maintenance"));
751 $this->tpl->setVariable(
"TXT_MAINTAIN_LOCAL",$this->lng->txt(
"language_maintain_local_changes"));
752 $this->tpl->setVariable(
"TXT_SELECT",$this->lng->txt(
"please_select"));
753 $this->tpl->setVariable(
"TXT_SAVE",$this->lng->txt(
"language_save_local_changes"));
754 $this->tpl->setVariable(
"TXT_LOAD",$this->lng->txt(
"language_load_local_changes"));
755 $this->tpl->setVariable(
"TXT_CLEAR",$this->lng->txt(
"language_clear_local_changes"));
758 $this->tpl->setVariable(
"TXT_DELETE_ADDED",$this->lng->txt(
"language_delete_local_additions"));
759 $this->tpl->setVariable(
"TXT_MERGE",$this->lng->txt(
"language_merge_local_changes"));
760 $this->tpl->setVariable(
"TXT_REMOVE_LOCAL_FILE",$this->lng->txt(
"language_remove_local_file"));
762 $this->tpl->setVariable(
"TXT_NOTE_SAVE",$this->lng->txt(
"language_note_save_local"));
763 $this->tpl->setVariable(
"TXT_MAINTAIN",$this->lng->txt(
"language_process_maintenance"));
764 $this->tpl->setVariable(
"VAR_MAINTAIN",
"maintain");
765 $this->tpl->setVariable(
"CMD_MAINTAIN",
"maintain");
776 $translate_key =
"lang_translate_". $this->
object->key;
779 switch (
$_POST[
"translation"])
782 $ilSetting->set($translate_key,
true);
785 $ilSetting->set($translate_key,
false);
787 $translate = $ilSetting->get($translate_key,
false);
789 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lang_settings.html",
"Services/Language");
791 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
792 $this->tpl->setVariable(
"TXT_SETTINGS",$this->lng->txt(
"language_settings"));
793 $this->tpl->setVariable(
"TXT_TRANSLATION",$this->lng->txt(
"language_translation_mode"));
794 $this->tpl->setVariable(
"TXT_TRANSLATION_ENABLED",$this->lng->txt(
"language_translation_enabled"));
795 $this->tpl->setVariable(
"TXT_TRANSLATION_DISABLED",$this->lng->txt(
"language_translation_disabled"));
796 $this->tpl->setVariable(
"CHECKED_ENABLE", $translate ?
'checked="checked"':
'');
797 $this->tpl->setVariable(
"CHECKED_DISABLE", $translate ?
'' :
'checked="checked"');
798 $this->tpl->setVariable(
"TXT_NOTE_TRANSLATION",$this->lng->txt(
"language_note_translation"));
799 $this->tpl->setVariable(
"TXT_CHANGE_SETTINGS",$this->lng->txt(
"language_change_settings"));
800 $this->tpl->setVariable(
"CMD_SETTINGS",
"settings");
813 foreach($modules as $module)
817 $row[1] = count($this->object->getAllValues(array($module)));
818 $row[2] = count($this->object->getChangedValues(array($module)));
819 $row[3] = $row[1]-$row[2];
825 $total[0] =
"<b>".$this->lng->txt(
"language_all_modules").
"</b>";
826 $total[1] =
"<b>".$total[1].
"</b>";
827 $total[2] =
"<b>".$total[2].
"</b>";
828 $total[3] =
"<b>".$total[3].
"</b>";
832 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lang_statistics.html",
"Services/Language");
833 $this->tpl->addBlockFile(
"TABLE_STATISTICS",
"table_statistics",
"tpl.table.html");
834 $this->tpl->addBlockFile(
"TBL_CONTENT",
"tbl_content",
"tpl.obj_tbl_rows.html");
837 include_once
'Services/Table/classes/class.ilTableGUI.php';
839 $tbl->disable(
'title');
840 $tbl->disable(
'sort');
841 $tbl->disable(
'numinfo');
843 $tbl->setHeaderNames(array($this->lng->txt(
"module"),
844 $this->lng->txt(
"language_scope_global"),
845 $this->lng->txt(
"language_scope_local"),
846 $this->lng->txt(
"language_scope_unchanged")));
847 $tbl->setColumnWidth(array(
"25%",
"25%",
"25%",
"25%"));
848 $tbl->setLimit(count(
$data));
849 $tbl->setData(
$data);
866 function getPar($a_request_name, $a_default_value)
869 if (isset(
$_GET[$a_request_name]))
871 $param =
$_GET[$a_request_name];
872 $from_request =
true;
874 elseif (isset(
$_POST[$a_request_name]))
876 $param =
$_POST[$a_request_name];
877 $from_request =
true;
879 elseif (isset($this->session[$a_request_name]))
881 $param = $this->session[$a_request_name];
882 $from_request =
false;
886 $param = $a_default_value;
887 $from_request =
false;
893 if (is_array($param))
895 foreach ($param as $key => $value)
907 $this->session[$a_request_name] = $param;
920 $tabs_gui->addTarget(
"edit",
921 $this->ctrl->getLinkTarget($this,
"view"),
922 array(
"",
"view",
"cancel",
"save"));
924 $tabs_gui->addTarget(
"export",
925 $this->ctrl->getLinkTarget($this,
"export"),
926 array(
"export",
"download"));
928 $tabs_gui->addTarget(
"import",
929 $this->ctrl->getLinkTarget($this,
"import"),
930 array(
"import",
"upload"));
932 $tabs_gui->addTarget(
"language_maintain",
933 $this->ctrl->getLinkTarget($this,
"maintain"),
936 $tabs_gui->addTarget(
"settings",
937 $this->ctrl->getLinkTarget($this,
"settings"),
940 $tabs_gui->addTarget(
"language_statistics",
941 $this->ctrl->getLinkTarget($this,
"statistics"),
942 array(
"statistics"));
955 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_translate.html",
"Services/Language");
956 $this->tpl->setHeaderPageTitle($this->lng->txt(
"translation"));
957 $this->tpl->setTitle($this->lng->txt(
"translation").
" " 958 .$this->lng->txt(
"meta_l_".$this->object->key));
960 $this->lng->txt(
"obj_" . $this->object->getType()));
965 parent::prepareOutput();
976 global $ilLocator,
$tpl;
978 $ilLocator->addItem($this->lng->txt(
"administration"),
979 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
982 $ilLocator->addItem($this->lng->txt(
"languages"),
983 $this->ctrl->getLinkTargetByClass(
"ilobjlanguagefoldergui",
""));
985 $ilLocator->addItem($this->lng->txt(
"meta_l_". $this->object->getTitle()),
986 $this->ctrl->getLinkTarget($this,
"view"));
996 $this->tpl->setTitle($this->lng->txt(
"meta_l_".$this->object->getTitle()));
998 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
"_b.png"), $this->lng->txt(
"obj_" . $this->object->getType()));
1020 return (
$_GET[
'view_mode'] ==
"translate");
1038 if (self::_isPageTranslation()
1039 or !$ilSetting->get(
"lang_translate_".$lng->getLangKey()))
1046 $action =
"ilias.php" 1047 .
"?ref_id=".ilobjLanguageAccess::_lookupLangFolderRefId()
1048 .
"&baseClass=ilAdministrationGUI" 1049 .
"&cmdClass=ilobjlanguageextgui" 1050 .
"&view_mode=translate";
1052 $tpl =
new ilTemplate(
"tpl.translation_link.html",
true,
true,
"Services/Language");
1054 foreach($lng->getUsedModules() as $module => $dummy)
1056 $tpl->setCurrentBlock(
"hidden");
1057 $tpl->setVariable(
"NAME",
"page_modules[]");
1059 $tpl->parseCurrentBlock();
1062 foreach($lng->getUsedTopics() as $topic => $dummy)
1064 $tpl->setCurrentBlock(
"hidden");
1065 $tpl->setVariable(
"NAME",
"page_topics[]");
1067 $tpl->parseCurrentBlock();
1070 $tpl->setVariable(
"ACTION", $action);
1071 $tpl->setVariable(
"TXT_TRANSLATE",$lng->txt(
"translation"));
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
downloadObject()
Download a language file.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
assignObject()
Assign the extended language object.
prepareOutput()
Prepare the standard template for output (Overwritten from ilObjectGUI)
viewObject()
Show the edit screen.
uploadObject()
Process an uploaded language file.
static _getRemarks($a_lang_key, $a_all_changed=false)
Get all remarks of a language.
_checkMaintenance()
Permission check for language maintenance (import/export)
static _deleteValues($a_lang_key, $a_values=array())
Delete a set of translation in the database.
cancelObject()
Cancel the current action.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
static _getTranslationLink()
Get the HTML code for calling the page translation.
static _isPageTranslation()
Check if the GUI is in page translation mode.
Class ilObjLanguageExtGUI.
exportObject()
Show the screen to export a language file.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
ilObjLanguageExtGUI($a_data, $a_id=0, $a_call_by_reference=false)
Constructor.
importObject()
Show the screen to import a language file.
if(!is_array($argv)) $options
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjectGUI Basic methods of all Output classes.
special template class to simplify handling of ITX/PEAR
static _getValues($a_lang_key, $a_modules=array(), $a_topics=array(), $a_pattern='', $a_state='')
Get the translations of specified topics.
statisticsObject()
Print out statistics about the language.
settingsObject()
Set the language settings.
setTitleAndDescription()
Set the Title and the description (Overwritten from ilObjectGUI, called by prepareOutput) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
& executeCommand()
execute command
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
saveObject()
Save the changed translations.
static _saveValues($a_lang_key, $a_values=array(), $a_remarks=array())
Save a set of translation in the database.
getAdminTabs(&$tabs_gui)
Get tabs for admin mode.
static _getModules($a_lang_key)
Get all modules of a language.
maintainObject()
Process the language maintenance.
_lookupId($a_key)
Lookup the object ID for a language key.
getPar($a_request_name, $a_default_value)
Read a param that is either coming from GET, POST or is taken from the session variables of this GUI...
addAdminLocatorItems()
Set the locator for admin mode (called from prepareOutput in parent class)