ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjRoleTemplateGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 require_once "./classes/class.ilObjectGUI.php";
6 
18 {
24  var $type;
25 
37  function ilObjRoleTemplateGUI($a_data,$a_id,$a_call_by_reference)
38  {
39  global $lng;
40 
41  $lng->loadLanguageModule('rbac');
42 
43  $this->type = "rolt";
44  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
45  $this->rolf_ref_id =& $this->ref_id;
46  $this->ctrl->saveParameter($this, "obj_id");
47  }
48 
49  function &executeCommand()
50  {
51  global $rbacsystem;
52 
53  if($this->ctrl->getTargetScript() == 'role.php')
54  {
55  $this->__prepareOutput();
56  }
57  else
58  {
59  $this->prepareOutput();
60  }
61 
62  $next_class = $this->ctrl->getNextClass($this);
63  $cmd = $this->ctrl->getCmd();
64 
65  switch($next_class)
66  {
67  default:
68  if(!$cmd)
69  {
70  $cmd = "perm";
71  }
72  $cmd .= "Object";
73  $this->$cmd();
74 
75  break;
76  }
77 
78  return true;
79  }
80 
81 
87  function createObject()
88  {
89  global $rbacsystem;
90 
91  if (!$rbacsystem->checkAccess("create_rolt", $this->rolf_ref_id))
92  {
93  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
94  }
95  else
96  {
97  // fill in saved values in case of error
98  $data = array();
99  $data["fields"] = array();
100  $data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
101  $data["fields"]["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);
102 
103  $this->getTemplateFile("edit","role");
104 
105  foreach ($data["fields"] as $key => $val)
106  {
107  $this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
108  $this->tpl->setVariable(strtoupper($key), $val);
109 
110  if ($this->prepare_output)
111  {
112  $this->tpl->parseCurrentBlock();
113  }
114  }
115 
116  $this->tpl->setCurrentBlock("protect_permissions");
117  $protect_permissions = $_SESSION["error_post_vars"]["Fobject"]["protect_permissions"] ? "checked=\"checked\"" : "";
118  $this->tpl->setVariable("TXT_PROTECT_PERMISSIONS",$this->lng->txt("role_protect_permissions"));
119  $this->tpl->setVariable("PROTECT_PERMISSIONS",$protect_permissions);
120  $this->tpl->parseCurrentBlock();
121 
122  $this->ctrl->setParameter($this, "new_type", $this->type);
123  $this->tpl->setVariable("FORMACTION",
124  $this->ctrl->getFormAction($this));
125  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($this->type."_new"));
126  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
127  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($this->type."_add"));
128  $this->tpl->setVariable("CMD_SUBMIT", "save");
129  $this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
130  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
131  }
132  }
133 
134 
140  function saveObject()
141  {
142  global $rbacsystem,$rbacadmin, $rbacreview;
143 
144  // CHECK ACCESS 'write' to role folder
145  // TODO: check for create role permission should be better
146  if (!$rbacsystem->checkAccess("create_rolt",$this->rolf_ref_id))
147  {
148  $this->ilias->raiseError($this->lng->txt("msg_no_perm_create_rolt"),$this->ilias->error_obj->WARNING);
149  }
150 
151  // check required fields
152  if (empty($_POST["Fobject"]["title"]))
153  {
154  $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
155  }
156 
157  // check if role title has il_ prefix
158  if (substr($_POST["Fobject"]["title"],0,3) == "il_")
159  {
160  $this->ilias->raiseError($this->lng->txt("msg_role_reserved_prefix"),$this->ilias->error_obj->MESSAGE);
161  }
162 
163  // create new rolt object
164  include_once("./Services/AccessControl/classes/class.ilObjRoleTemplate.php");
165  $roltObj = new ilObjRoleTemplate();
166  $roltObj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
167  $roltObj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
168  $roltObj->create();
169  $rbacadmin->assignRoleToFolder($roltObj->getId(), $this->rolf_ref_id,'n');
170  $rbacadmin->setProtected($this->rolf_ref_id,$roltObj->getId(),ilUtil::tf2yn($_POST["Fobject"]["protect_permissions"]));
171 
172  ilUtil::sendSuccess($this->lng->txt("rolt_added"),true);
173  $this->ctrl->returnToParent($this);
174  }
175 
181  function permObject()
182  {
183  global $rbacadmin, $rbacreview, $rbacsystem,$objDefinition;
184 
185  if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
186  {
187  $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
188  exit();
189  }
190 
191  $to_filter = $objDefinition->getSubobjectsToFilter();
192 
193  $tpl_filter = array();
194  $internal_tpl = false;
195 
196  if (($internal_tpl = $this->object->isInternalTemplate()))
197  {
198  $tpl_filter = $this->object->getFilterOfInternalTemplate();
199  }
200 
201  $operation_info = $rbacreview->getOperationAssignment();
202 
203  foreach($operation_info as $info)
204  {
205  if($objDefinition->getDevMode($info['type']))
206  {
207  continue;
208  }
209  // FILTER SUBOJECTS OF adm OBJECT
210  if(in_array($info['type'],$to_filter))
211  {
212  continue;
213  }
214  if ($internal_tpl and !in_array($info['type'],$tpl_filter))
215  {
216  continue;
217  }
218  $rbac_objects[$info['typ_id']] = array("obj_id" => $info['typ_id'],
219  "type" => $info['type']);
220 
221  $txt = $objDefinition->isPlugin($info['type'])
222  ? ilPlugin::lookupTxt("rep_robj", $info['type'], $info['type']."_".$info['operation'])
223  : $this->lng->txt($info['type']."_".$info['operation']);
224  if (substr($info['operation'], 0, 7) == "create_" &&
225  $objDefinition->isPlugin(substr($info['operation'], 7)))
226  {
227  $txt = ilPlugin::lookupTxt("rep_robj", substr($info['operation'], 7), $info['type']."_".$info['operation']);
228  }
229 
230  $rbac_operations[$info['typ_id']][$info['ops_id']] = array(
231  "ops_id" => $info['ops_id'],
232  "title" => $info['operation'],
233  "name" => $txt);
234  }
235 
236 
237  foreach ($rbac_objects as $key => $obj_data)
238  {
239  if ($objDefinition->isPlugin($obj_data["type"]))
240  {
241  $rbac_objects[$key]["name"] = ilPlugin::lookupTxt("rep_robj", $obj_data["type"],
242  "obj_".$obj_data["type"]);
243  }
244  else
245  {
246  $rbac_objects[$key]["name"] = $this->lng->txt("obj_".$obj_data["type"]);
247  }
248 
249  $rbac_objects[$key]["ops"] = $rbac_operations[$key];
250  }
251 
252  sort($rbac_objects);
253 
254  foreach ($rbac_objects as $key => $obj_data)
255  {
256  sort($rbac_objects[$key]["ops"]);
257  }
258 
259  // sort by (translated) name of object type
260  $rbac_objects = ilUtil::sortArray($rbac_objects,"name","asc");
261 
262  // BEGIN CHECK_PERM
263  foreach ($rbac_objects as $key => $obj_data)
264  {
265  $arr_selected = $rbacreview->getOperationsOfRole($this->object->getId(), $obj_data["type"], $this->rolf_ref_id);
266  $arr_checked = array_intersect($arr_selected,array_keys($rbac_operations[$obj_data["obj_id"]]));
267 
268  foreach ($rbac_operations[$obj_data["obj_id"]] as $operation)
269  {
270  $checked = in_array($operation["ops_id"],$arr_checked);
271  $disabled = false;
272 
273  // Es wird eine 2-dim Post Variable �bergeben: perm[rol_id][ops_id]
274  $box = ilUtil::formCheckBox($checked,"template_perm[".$obj_data["type"]."][]",$operation["ops_id"],$disabled);
275  $output["perm"][$obj_data["obj_id"]][$operation["ops_id"]] = $box;
276  }
277  }
278  // END CHECK_PERM
279 
280  $output["col_anz"] = count($rbac_objects);
281  $output["txt_save"] = $this->lng->txt("save");
282  $output["check_protected"] = ilUtil::formCheckBox($rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()),"protected",1);
283  $output["text_protected"] = $this->lng->txt("role_protect_permissions");
284 
285 /************************************/
286 /* adopt permissions form */
287 /************************************/
288 
289  $output["message_middle"] = $this->lng->txt("adopt_perm_from_template");
290 
291  // send message for system role
292  if ($this->object->getId() == SYSTEM_ROLE_ID)
293  {
294  $output["adopt"] = array();
295  ilUtil::sendFailure($this->lng->txt("msg_sysrole_not_editable"));
296  }
297  else
298  {
299  // BEGIN ADOPT_PERMISSIONS
300  $parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
301 
302  // sort output for correct color changing
303  ksort($parent_role_ids);
304 
305  foreach ($parent_role_ids as $key => $par)
306  {
307  if ($par["obj_id"] != SYSTEM_ROLE_ID)
308  {
309  $radio = ilUtil::formRadioButton(0,"adopt",$par["obj_id"]);
310  $output["adopt"][$key]["css_row_adopt"] = ilUtil::switchColor($key, "tblrow1", "tblrow2");
311  $output["adopt"][$key]["check_adopt"] = $radio;
312  $output["adopt"][$key]["type"] = ($par["type"] == 'role' ? 'Role' : 'Template');
313  $output["adopt"][$key]["role_name"] = $par["title"];
314  }
315  }
316 
317  $output["formaction_adopt"] = $this->ctrl->getFormAction($this);
318  // END ADOPT_PERMISSIONS
319  }
320 
321  $output["formaction"] =
322  $this->ctrl->getFormAction($this);
323 
324  $this->data = $output;
325 
326 
327 /************************************/
328 /* generate output */
329 /************************************/
330 
331  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
332  $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
333  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_perm_role.html");
334 
335  foreach ($rbac_objects as $obj_data)
336  {
337  // BEGIN object_operations
338  $this->tpl->setCurrentBlock("object_operations");
339 
340  foreach ($obj_data["ops"] as $operation)
341  {
342  $ops_ids[] = $operation["ops_id"];
343 
344  $css_row = ilUtil::switchColor($key, "tblrow1", "tblrow2");
345  $this->tpl->setVariable("CSS_ROW",$css_row);
346  $this->tpl->setVariable("PERMISSION",$operation["name"]);
347  $this->tpl->setVariable("CHECK_PERMISSION",$this->data["perm"][$obj_data["obj_id"]][$operation["ops_id"]]);
348  $this->tpl->parseCurrentBlock();
349  } // END object_operations
350 
351  // BEGIN object_type
352  $this->tpl->setCurrentBlock("object_type");
353  $this->tpl->setVariable("TXT_OBJ_TYPE",$obj_data["name"]);
354 
355 // TODO: move this if in a function and query all objects that may be disabled or inactive
356  if ($this->objDefinition->getDevMode($obj_data["type"]))
357  {
358  $this->tpl->setVariable("TXT_NOT_IMPL", "(".$this->lng->txt("not_implemented_yet").")");
359  }
360  else if ($obj_data["type"] == "icrs" and !$this->ilias->getSetting("ilinc_active"))
361  {
362  $this->tpl->setVariable("TXT_NOT_IMPL", "(".$this->lng->txt("not_enabled_or_configured").")");
363  }
364 
365  // js checkbox toggles
366  $this->tpl->setVariable("JS_VARNAME","template_perm_".$obj_data["type"]);
367  $this->tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($ops_ids));
368  $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
369  $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
370 
371 
372  $this->tpl->parseCurrentBlock();
373  // END object_type
374  }
375 
376  // BEGIN ADOPT PERMISSIONS
377  foreach ($this->data["adopt"] as $key => $value)
378  {
379  $this->tpl->setCurrentBlock("ADOPT_PERM_ROW");
380  $this->tpl->setVariable("CSS_ROW_ADOPT",$value["css_row_adopt"]);
381  $this->tpl->setVariable("CHECK_ADOPT",$value["check_adopt"]);
382  $this->tpl->setVariable("TYPE",$value["type"]);
383  $this->tpl->setVariable("ROLE_NAME",$value["role_name"]);
384  $this->tpl->parseCurrentBlock();
385  }
386 
387  $this->tpl->setCurrentBlock("ADOPT_PERM_FORM");
388  $this->tpl->setVariable("MESSAGE_MIDDLE",$this->data["message_middle"]);
389  $this->tpl->setVariable("FORMACTION_ADOPT",$this->data["formaction_adopt"]);
390  $this->tpl->setVariable("ADOPT",$this->lng->txt('copy'));
391  $this->tpl->parseCurrentBlock();
392  // END ADOPT PERMISSIONS
393 
394  $this->tpl->setCurrentBlock("tblfooter_protected");
395  $this->tpl->setVariable("COL_ANZ",3);
396  $this->tpl->setVariable("CHECK_BOTTOM",$this->data["check_protected"]);
397  $this->tpl->setVariable("MESSAGE_TABLE",$this->data["text_protected"]);
398  $this->tpl->parseCurrentBlock();
399 
400  $this->tpl->setCurrentBlock("tblfooter_standard");
401  $this->tpl->setVariable("COL_ANZ_PLUS",4);
402  $this->tpl->setVariable("TXT_SAVE",$this->data["txt_save"]);
403  $this->tpl->parseCurrentBlock();
404 
405 
406  $this->tpl->setCurrentBlock("adm_content");
407  $this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath("icon_".$this->object->getType().".gif"));
408  $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt($this->object->getType()));
409  $this->tpl->setVariable("TBL_HELP_IMG",ilUtil::getImagePath("icon_help.gif"));
410  $this->tpl->setVariable("TBL_HELP_LINK","tbl_help.php");
411  $this->tpl->setVariable("TBL_HELP_IMG_ALT",$this->lng->txt("help"));
412 
413  // compute additional information in title
414  if (substr($this->object->getTitle(),0,3) == "il_")
415  {
416  $desc = $this->lng->txt("predefined_template");//$this->lng->txt("obj_".$parent_node['type'])." (".$parent_node['obj_id'].") : ".$parent_node['title'];
417  }
418 
419  $description = "<br/>&nbsp;<span class=\"small\">".$desc."</span>";
420 
421  // translation for autogenerated roles
422  if (substr($this->object->getTitle(),0,3) == "il_")
423  {
424  include_once('./Services/AccessControl/classes/class.ilObjRole.php');
425 
426  $title = ilObjRole::_getTranslation($this->object->getTitle())." (".$this->object->getTitle().")";
427  }
428  else
429  {
430  $title = $this->object->getTitle();
431  }
432 
433  $this->tpl->setVariable("TBL_TITLE",$title.$description);
434 
435  $this->tpl->setVariable("TXT_PERMISSION",$this->data["txt_permission"]);
436  $this->tpl->setVariable("FORMACTION",$this->data["formaction"]);
437  $this->tpl->parseCurrentBlock();
438  }
439 
440 
446  function permSaveObject()
447  {
448  global $rbacadmin, $rbacsystem, $rbacreview,$objDefinition;
449 
450  if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
451  {
452  $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
453  }
454  else
455  {
456  // Alle Template Eintraege loeschen
457  $rbacadmin->deleteRolePermission($this->object->getId(), $this->rolf_ref_id);
458 
459  foreach ($_POST["template_perm"] as $key => $ops_array)
460  {
461  // Setzen der neuen template permissions
462  $rbacadmin->setRolePermission($this->object->getId(), $key,$ops_array,$this->rolf_ref_id);
463  }
464  }
465 
466  // update object data entry (to update last modification date)
467  $this->object->update();
468 
469  // set protected flag
470  // not applicable for role templates
471  #$rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),ilUtil::tf2yn($_POST['protected']));
472 
473  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
474 
475  $this->ctrl->redirect($this, "perm");
476  }
477 
484  {
485  global $rbacadmin, $rbacsystem, $rbacreview;
486 
487  if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
488  {
489  $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
490  }
491  elseif ($this->obj_id == $_POST["adopt"])
492  {
493  ilUtil::sendFailure($this->lng->txt("msg_perm_adopted_from_itself"),true);
494  }
495  else
496  {
497  $rbacadmin->deleteRolePermission($this->obj_id, $this->rolf_ref_id);
498  $parentRoles = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
499  $rbacadmin->copyRoleTemplatePermissions($_POST["adopt"],$parentRoles[$_POST["adopt"]]["parent"],
500  $this->rolf_ref_id,$this->obj_id);
501  // update object data entry (to update last modification date)
502  $this->object->update();
503 
504  // send info
505  $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_POST["adopt"]);
506  ilUtil::sendSuccess($this->lng->txt("msg_perm_adopted_from1")." '".$obj_data->getTitle()."'.<br/>".$this->lng->txt("msg_perm_adopted_from2"),true);
507  }
508 
509  $this->ctrl->redirect($this, "perm");
510  }
511 
517  function editObject()
518  {
519  global $rbacsystem, $rbacreview;
520 
521  if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
522  {
523  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
524  }
525 
526  $this->getTemplateFile("edit","role");
527 
528  if ($_SESSION["error_post_vars"])
529  {
530  // fill in saved values in case of error
531  if (substr($this->object->getTitle(),0,3) != "il_")
532  {
533  $this->tpl->setVariable("TITLE",ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"]),true);
534  }
535 
536  $this->tpl->setVariable("DESC",ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]));
537  $protect_permissions = ($_SESSION["error_post_vars"]["Fobject"]["protect_permissions"]) ? "checked=\"checked\"" : "";
538  }
539  else
540  {
541  if (substr($this->object->getTitle(),0,3) != "il_")
542  {
543  $this->tpl->setVariable("TITLE",ilUtil::prepareFormOutput($this->object->getTitle()));
544  }
545 
546  $this->tpl->setVariable("DESC",ilUtil::stripSlashes($this->object->getDescription()));
547  $protect_permissions = $rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()) ? "checked=\"checked\"" : "";
548  }
549 
550  $obj_str = "&obj_id=".$this->obj_id;
551 
552  $this->tpl->setVariable("TXT_TITLE",$this->lng->txt("title"));
553  $this->tpl->setVariable("TXT_DESC",$this->lng->txt("desc"));
554 
555  $this->tpl->setCurrentBlock("protect_permissions");
556  $this->tpl->setVariable("TXT_PROTECT_PERMISSIONS",$this->lng->txt('role_protect_permissions'));
557  $this->tpl->setVariable("PROTECT_PERMISSIONS",$protect_permissions);
558  $this->tpl->parseCurrentBlock();
559 
560  $this->tpl->setVariable("FORMACTION",
561  $this->ctrl->getFormAction($this));
562  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($this->object->getType()."_edit"));
563  $this->tpl->setVariable("TARGET", $this->getTargetFrame("update"));
564  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
565  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
566  $this->tpl->setVariable("CMD_SUBMIT", "update");
567  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
568 
569  if (substr($this->object->getTitle(),0,3) == "il_")
570  {
571  $this->tpl->setVariable("SHOW_TITLE",$this->object->getTitle());
572  }
573  }
574 
578  function getAdminTabs(&$tabs_gui)
579  {
580  $this->getTabs($tabs_gui);
581  }
582 
583  function getTabs(&$tabs_gui)
584  {
585  global $rbacsystem,$rbacreview;
586 
587  if ($rbacsystem->checkAccess('write',$this->rolf_ref_id))
588  {
589  $tabs_gui->addTarget("edit_properties",
590  $this->ctrl->getLinkTarget($this, "edit"),
591  array("edit","update"), get_class($this));
592 
593  $tabs_gui->addTarget("default_perm_settings",
594  $this->ctrl->getLinkTarget($this, "perm"),
595  array("perm"), get_class($this));
596  }
597  }
598 
599 
604  function cancelObject()
605  {
606  $this->ctrl->redirectByClass("ilobjrolefoldergui","view");
607  }
608 
609 
610 
616  function updateObject()
617  {
618  global $rbacsystem, $rbacadmin, $rbacreview;
619 
620  // check write access
621  if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
622  {
623  $this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_rolt"),$this->ilias->error_obj->WARNING);
624  }
625 
626  if (substr($this->object->getTitle(),0,3) != "il_")
627  {
628  // check required fields
629  if (empty($_POST["Fobject"]["title"]))
630  {
631  $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
632  }
633 
634  // check if role title has il_ prefix
635  if (substr($_POST["Fobject"]["title"],0,3) == "il_")
636  {
637  $this->ilias->raiseError($this->lng->txt("msg_role_reserved_prefix"),$this->ilias->error_obj->MESSAGE);
638  }
639 
640  // update
641  $this->object->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
642  }
643 
644  $this->object->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
645  $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),ilUtil::tf2yn($_POST["Fobject"]["protect_permissions"]));
646  $this->object->update();
647 
648  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
649 
650  $this->ctrl->returnToParent($this);
651  }
652 
658  {
659  global $ilLocator;
660 
661  if ($_GET["admin_mode"] == "settings") // system settings
662  {
663  $ilLocator->addItem($this->lng->txt("administration"),
664  $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
665  ilFrameTargetInfo::_getFrame("MainContent"));
666 
667  $ilLocator->addItem(ilObject::_lookupTitle(
668  ilObject::_lookupObjId($_GET["ref_id"])),
669  $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
670 
671  $ilLocator->addItem($this->object->getTitle(),
672  $this->ctrl->getLinkTarget($this, "perm"));
673  }
674  else // repository administration
675  {
676  //?
677  }
678 
679  }
680 
681  function showUpperIcon()
682  {
683  global $tree, $tpl, $objDefinition;
684 
685  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
686  {
687  $tpl->setUpperIcon(
688  $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
689  }
690  else
691  {
692  if ($this->object->getRefId() != ROOT_FOLDER_ID &&
693  $this->object->getRefId() != SYSTEM_FOLDER_ID)
694  {
695  $par_id = $tree->getParentId($this->object->getRefId());
696  $tpl->setUpperIcon("repository.php?ref_id=".$par_id);
697  }
698  }
699  }
700 
701 
702 } // END class.ilObjRoleTemplateGUI
703 ?>