ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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("./classes/class.ilObjectGUI.php");
4 
5 
18 {
24  public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
25  {
26  $this->type = 'accs';
27  parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
28 
29  $this->lng->loadLanguageModule('acc');
30  }
31 
38  public function executeCommand()
39  {
40  global $rbacsystem,$ilErr,$ilAccess;
41 
42  $next_class = $this->ctrl->getNextClass($this);
43  $cmd = $this->ctrl->getCmd();
44 
45  $this->prepareOutput();
46 
47  if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
48  {
49  $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
50  }
51 
52  switch($next_class)
53  {
54  case 'ilpermissiongui':
55  $this->tabs_gui->setTabActive('perm_settings');
56  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
57  $perm_gui =& new ilPermissionGUI($this);
58  $ret =& $this->ctrl->forwardCommand($perm_gui);
59  break;
60 
61  default:
62  if(!$cmd || $cmd == 'view')
63  {
64  $cmd = "editAccessKeys";
65  }
66 
67  $this->$cmd();
68  break;
69  }
70  return true;
71  }
72 
79  public function getAdminTabs()
80  {
81  global $rbacsystem, $ilAccess, $ilTabs;
82 
83  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
84  {
85  $ilTabs->addTarget("acc_access_keys",
86  $this->ctrl->getLinkTarget($this, "editAccessKeys"),
87  array("editAccessKeys", "view"));
88  }
89 
90  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
91  {
92  $ilTabs->addTarget("perm_settings",
93  $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
94  array(),'ilpermissiongui');
95  }
96  }
97 
101  function editAccessKeys()
102  {
103  global $tpl;
104 
105  include_once("./Services/Accessibility/classes/class.ilAccessKeyTableGUI.php");
106  $table = new ilAccessKeyTableGUI($this, "editAccessKeys");
107 
108  $tpl->setContent($table->getHTML());
109  }
110 
114  function saveAccessKeys()
115  {
116  global $ilCtrl, $lng, $ilAccess;
117 
118  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
119  {
120  include_once("./Services/Accessibility/classes/class.ilAccessKey.php");
122  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
123  }
124  $ilCtrl->redirect($this, "editAccessKeys");
125  }
126 
127 
128 }
129 ?>