ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSetupLanguageTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
16 
20  function __construct($a_client)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25  $this->setData($lng->getInstallableLanguages());
26  //$this->setTitle($lng->txt(""));
27  $this->setLimit(9999);
28 
29  $this->addColumn($this->lng->txt("language"));
30  $this->addColumn($this->lng->txt("installed"));
31  $this->addColumn($this->lng->txt("include_local"));
32  $this->addColumn($this->lng->txt("default"));
33 
34  $this->setEnableHeader(true);
35  $this->setFormAction("setup.php?cmd=gateway");
36  $this->setRowTemplate("tpl.setup_lang_table_row.html", "setup");
37  $this->disable("footer");
38  $this->setEnableTitle(true);
39  //$this->setWidth("");
40 
41  $this->client = $a_client;
42  $this->installed_langs = $lng->getInstalledLanguages();
43  $this->installed_local_langs = $lng->getInstalledLocalLanguages();
44  $this->local_langs = $lng->getLocalLanguages();
45  $this->default_lang = $this->client->getDefaultLanguage();
46 
47 
48  $this->addCommandButton("saveLanguages", $lng->txt("save"));
49  }
50 
54  protected function fillRow($lang_key)
55  {
56  global $lng;
57  $this->tpl->setVariable("LANG_KEY", $lang_key);
58  $this->tpl->setVariable("TXT_LANG", $this->lng->txt("lang_".$lang_key));
59 
60  if (in_array($lang_key,$this->installed_langs))
61  {
62  $this->tpl->setVariable("CHECKED", ("checked=\"checked\""));
63  }
64 
65  if (!in_array($lang_key,$this->local_langs))
66  {
67  $this->tpl->setVariable("LOCAL", ("disabled=\"disabled\""));
68  }
69  else if (in_array($lang_key,$this->installed_local_langs))
70  {
71  $this->tpl->setVariable("LOCAL", ("checked=\"checked\""));
72  }
73 
74  if ($lang_key == $this->default_lang)
75  {
76  $this->tpl->setVariable("DEFAULT", ("checked=\"checked\""));
77  }
78  }
79 
80 }
81 ?>