ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilPageMultiLangGUI.php
Go to the documentation of this file.
1 <?php
2 
26 {
28  protected \ilCtrl $ctrl;
29  protected ilLanguage $lng;
30  protected bool $single_page_mode = false;
31 
39  public function __construct(
40  string $a_parent_type,
41  int $a_parent_id,
42  bool $a_single_page_mode = false
43  ) {
44  global $DIC;
45 
46  $this->ctrl = $DIC->ctrl();
47  $this->lng = $DIC->language();
48  //$this->ml = new ilPageMultiLang($a_parent_type, $a_parent_id);
49 
50  // object translation
51  $this->ot = ilObjectTranslation::getInstance($a_parent_id);
52  }
53 
57  public function executeCommand(): void
58  {
59  $ilCtrl = $this->ctrl;
60 
61  $next_class = $ilCtrl->getNextClass();
62 
63  switch ($next_class) {
64  default:
65  $cmd = $ilCtrl->getCmd("settings");
66  if (in_array($cmd, array("settings", "activateMultilinguality", "cancel",
67  "saveMultilingualitySettings", "confirmDeactivateMultiLanguage", "addLanguage",
68  "saveLanguages", "deactivateMultiLang", "confirmRemoveLanguages",
69  "removeLanguages"))) {
70  $this->$cmd();
71  }
72  break;
73  }
74  }
75 
76  public function getMultiLangInfo(
77  string $a_page_lang = "-"
78  ): string {
79  $lng = $this->lng;
80 
81  if ($a_page_lang == "") {
82  $a_page_lang = "-";
83  }
84 
85  $lng->loadLanguageModule("meta");
86 
87  $tpl = new ilTemplate("tpl.page_multi_lang_info.html", true, true, "Services/COPage");
88  $tpl->setVariable("TXT_MASTER_LANG", $lng->txt("obj_master_lang"));
89  $tpl->setVariable("VAL_ML", $lng->txt("meta_l_" . $this->ot->getMasterLanguage()));
90  $cl = ($a_page_lang == "-")
91  ? $this->ot->getMasterLanguage()
92  : $a_page_lang;
93  $tpl->setVariable("TXT_CURRENT_LANG", $lng->txt("cont_current_lang"));
94  $tpl->setVariable("VAL_CL", $lng->txt("meta_l_" . $cl));
95  return $tpl->get();
96  }
97 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
__construct(string $a_parent_type, int $a_parent_id, bool $a_single_page_mode=false)
Constructur.
executeCommand()
Execute command.
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
getNextClass($a_gui_class=null)
static getInstance(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMultiLangInfo(string $a_page_lang="-")
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...