ILIAS  Release_5_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 
57  global $lng;
58  $this->tpl->setVariable("LANG_KEY", $lang_key);
59  $this->tpl->setVariable("TXT_LANG", $this->lng->txt("lang_".$lang_key));
60 
61  if (in_array($lang_key,$this->installed_langs))
62  {
63  $this->tpl->setVariable("CHECKED", ("checked=\"checked\""));
64  }
65 
66  if (!in_array($lang_key,$this->local_langs))
67  {
68  $this->tpl->setVariable("LOCAL", ("disabled=\"disabled\""));
69  }
70  else if (in_array($lang_key,$this->installed_local_langs))
71  {
72  $this->tpl->setVariable("LOCAL", ("checked=\"checked\""));
73  }
74 
75  if ($lang_key == $this->default_lang)
76  {
77  $this->tpl->setVariable("DEFAULT", ("checked=\"checked\""));
78  }
79  }
80 
81 }
82 ?>