ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjAccessibilitySettingsGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 include_once("./Services/Object/classes/class.ilObjectGUI.php");
4 
5 
18 {
22  protected $rbacsystem;
23 
27  protected $error;
28 
32  protected $access;
33 
37  protected $tabs;
38 
44  public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
45  {
46  global $DIC;
47 
48  $this->rbacsystem = $DIC->rbac()->system();
49  $this->error = $DIC["ilErr"];
50  $this->access = $DIC->access();
51  $this->tabs = $DIC->tabs();
52  $this->tpl = $DIC["tpl"];
53  $this->ctrl = $DIC->ctrl();
54  $this->lng = $DIC->language();
55  $this->type = 'accs';
56  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
57 
58  $this->lng->loadLanguageModule('acc');
59  }
60 
67  public function executeCommand()
68  {
71  $ilAccess = $this->access;
72 
73  $next_class = $this->ctrl->getNextClass($this);
74  $cmd = $this->ctrl->getCmd();
75 
76  $this->prepareOutput();
77 
78  if (!$rbacsystem->checkAccess('read', $this->object->getRefId())) {
79  $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
80  }
81 
82  switch ($next_class) {
83  case 'ilpermissiongui':
84  $this->tabs_gui->setTabActive('perm_settings');
85  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
86  $perm_gui = new ilPermissionGUI($this);
87  $ret = $this->ctrl->forwardCommand($perm_gui);
88  break;
89 
90  default:
91  if (!$cmd || $cmd == 'view') {
92  $cmd = "editAccessibilitySettings";
93  }
94 
95  $this->$cmd();
96  break;
97  }
98  return true;
99  }
100 
104  protected function getSettingsForm()
105  {
106  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
107  $form = new ilPropertyFormGUI();
108  $form->setTitle($this->lng->txt('settings'));
109 
110  require_once 'Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php';
113  $form,
114  $this
115  );
116 
117  return $form;
118  }
119 
124  {
125  $this->tabs_gui->setTabActive('acc_settings');
126  if (!$form) {
127  $form = $this->getSettingsForm();
128  }
129 
130  $this->tpl->setContent($form->getHTML());
131  }
132 
139  public function getAdminTabs()
140  {
142  $ilAccess = $this->access;
143  $ilTabs = $this->tabs;
144 
145  if ($rbacsystem->checkAccess("read", $this->object->getRefId())) {
146  $ilTabs->addTab('acc_settings', $this->lng->txt('settings'), $this->ctrl->getLinkTarget($this, 'editAccessibilitySettings'));
147  }
148 
149  if ($rbacsystem->checkAccess("read", $this->object->getRefId())) {
150  $ilTabs->addTarget(
151  "acc_access_keys",
152  $this->ctrl->getLinkTarget($this, "editAccessKeys"),
153  array("editAccessKeys", "view")
154  );
155  }
156 
157  if ($rbacsystem->checkAccess("edit_permission", $this->object->getRefId())) {
158  $ilTabs->addTarget(
159  "perm_settings",
160  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
161  array(),
162  'ilpermissiongui'
163  );
164  }
165  }
166 
170  public function editAccessKeys()
171  {
172  $tpl = $this->tpl;
173 
174  $this->tabs_gui->setTabActive('acc_access_keys');
175 
176  include_once("./Services/Accessibility/classes/class.ilAccessKeyTableGUI.php");
177  $table = new ilAccessKeyTableGUI($this, "editAccessKeys");
178 
179  $tpl->setContent($table->getHTML());
180  }
181 
185  public function saveAccessKeys()
186  {
188  $lng = $this->lng;
189  $ilAccess = $this->access;
190 
191  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
192  include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
194  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
195  }
196  $ilCtrl->redirect($this, "editAccessKeys");
197  }
198 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static writeKeys($a_keys, $a_lang_key="0")
Write keys.
TableGUI class for access keys.
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
global $ilCtrl
Definition: ilias.php:18
prepareOutput($a_show_subobjects=true)
prepare output
if(isset($_POST['submit'])) $form
Class ilObjectGUI Basic methods of all Output classes.
editAccessibilitySettings(ilPropertyFormGUI $form=null)
Create styles array
The data for the language used.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if(empty($password)) $table
Definition: pwgen.php:24
$_POST["username"]