ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilAuthLoginPageEditorTableGUI.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 include_once './Services/Authentication/classes/class.ilAuthLoginPageEditorSettings.php';
6 
14 {
15  protected $lng = null;
16 
22  public function __construct($a_parent_obj, $a_parent_cmd = "")
23  {
24  global $lng;
25 
26  parent::__construct($a_parent_obj, $a_parent_cmd);
27 
28  $this->lng = $lng;
29  $this->lng->loadLanguageModule('meta');
30 
31  $this->initTable();
32  }
33 
37  public function parse()
38  {
39  $installed = $this->lng->getInstalledLanguages();
40 
41  $tbl_data = array();
42  $counter = 0;
43  foreach ($installed as $key => $langkey) {
44  $tbl_data[$counter]['key'] = $langkey;
45  $tbl_data[$counter]['id'] = ilLanguage::lookupId($langkey);
46  $tbl_data[$counter]['status'] = ilAuthLoginPageEditorSettings::getInstance()->isIliasEditorEnabled($langkey);
47 
48  ++$counter;
49  }
50  $this->setData($tbl_data);
51  }
52 
57  protected function fillRow($a_set)
58  {
59  global $ilCtrl;
60 
61  $this->tpl->setVariable('LANGID', $a_set['key']);
62  $this->tpl->setVariable('LANGKEY_CHECKED', $a_set['status'] ? 'checked="checked' : '');
63  $this->tpl->setVariable('TXT_LANGUAGE', $this->lng->txt('meta_l_' . $a_set['key']));
64 
65  if ($this->lng->getDefaultLanguage() == $a_set['key']) {
66  $this->tpl->setVariable('TXT_SYSTEM', $this->lng->txt('system_language'));
67  }
68  if ($a_set['status']) {
69  $this->tpl->setVariable('STATUS_SRC', ilUtil::getImagePath('icon_ok.svg'));
70  $this->tpl->setVariable('STATUS_ALT', $this->lng->txt('active'));
71  $this->tpl->setVariable('CHECKED_LANGKEY', 'checked="checked"');
72  } else {
73  $this->tpl->setVariable('STATUS_SRC', ilUtil::getImagePath('icon_not_ok.svg'));
74  $this->tpl->setVariable('STATUS_ALT', $this->lng->txt('inactive'));
75  }
76  $this->tpl->setVariable('LINK_TXT', $this->lng->txt('edit'));
77  $ilCtrl->setParameter($this->getParentObject(), 'key', $a_set['id']);
78  $this->tpl->setVariable('LINK_NAME', $ilCtrl->getLinkTargetByClass('illoginpagegui', 'edit'));
79  }
80 
81 
82 
86  protected function initTable()
87  {
88  global $ilCtrl;
89 
90  $this->setFormAction($ilCtrl->getFormAction($this->getParentObject()));
91  $this->setRowTemplate('tpl.auth_login_page_editor_table_row.html', 'Services/Authentication');
92  $this->setId('loginpageeditor');
93  $this->setSelectAllCheckbox('languages');
94  $this->setFormName('login_pages');
95  $this->addColumn('', 'c', '1px');
96  $this->addColumn($this->lng->txt('language'), 'language', '85%');
97  $this->addColumn($this->lng->txt('active'), 'active', '5%');
98  $this->addColumn($this->lng->txt('actions'), 'actions', '10%');
99 
100  $this->addMultiCommand('activate', $this->lng->txt('login_page_activate'));
101 
102  $this->setDefaultOrderField('language');
103  $this->enable('sort');
104  $this->enable('header');
105  $this->disable('numinfo');
106  $this->enable('select_all');
107  }
108 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getParentObject()
Get parent object.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
$counter
Class ilTable2GUI.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
static lookupId($a_lang_key)
Lookup obj_id of language ilDB $ilDB.
static getInstance()
Get singelton instance.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
$key
Definition: croninfo.php:18