ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilPageMultiLangGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/COPage/classes/class.ilPageMultiLang.php");
6 
16 {
20  protected $ctrl;
21 
25  protected $lng;
26 
27  protected $single_page_mode = false;
28 
36  public function __construct($a_parent_type, $a_parent_id, $a_single_page_mode = false)
37  {
38  global $DIC;
39 
40  $this->ctrl = $DIC->ctrl();
41  $this->lng = $DIC->language();
42  //$this->ml = new ilPageMultiLang($a_parent_type, $a_parent_id);
43 
44  // object translation
45  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
46  $this->ot = ilObjectTranslation::getInstance($a_parent_id);
47 
48  // $this->single_page_mode = $a_single_page_mode;
49  }
50 
54  public function executeCommand()
55  {
57 
58  $next_class = $ilCtrl->getNextClass();
59 
60  switch ($next_class) {
61  default:
62  $cmd = $ilCtrl->getCmd("settings");
63  if (in_array($cmd, array("settings", "activateMultilinguality", "cancel",
64  "saveMultilingualitySettings", "confirmDeactivateMultiLanguage", "addLanguage",
65  "saveLanguages", "deactivateMultiLang", "confirmRemoveLanguages",
66  "removeLanguages"))) {
67  $this->$cmd();
68  }
69  }
70  }
71 
75  public function getMultiLangInfo($a_page_lang = "-")
76  {
77  $lng = $this->lng;
78 
79  if ($a_page_lang == "") {
80  $a_page_lang = "-";
81  }
82 
83  $lng->loadLanguageModule("meta");
84 
85  $tpl = new ilTemplate("tpl.page_multi_lang_info.html", true, true, "Services/COPage");
86  $tpl->setVariable("TXT_MASTER_LANG", $lng->txt("obj_master_lang"));
87  $tpl->setVariable("VAL_ML", $lng->txt("meta_l_" . $this->ot->getMasterLanguage()));
88  $cl = ($a_page_lang == "-")
89  ? $this->ot->getMasterLanguage()
90  : $a_page_lang;
91  $tpl->setVariable("TXT_CURRENT_LANG", $lng->txt("cont_current_lang"));
92  $tpl->setVariable("VAL_CL", $lng->txt("meta_l_" . $cl));
93  return $tpl->get();
94  }
95 }
__construct($a_parent_type, $a_parent_id, $a_single_page_mode=false)
Constructur.
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
executeCommand()
Execute command.
global $ilCtrl
Definition: ilias.php:18
getMultiLangInfo($a_page_lang="-")
Get multi lang info.
special template class to simplify handling of ITX/PEAR
Page multilinguality GUI class.
Create styles array
The data for the language used.
static getInstance($a_obj_id)
Get instance.