ILIAS  Release_4_0_x_branch Revision 61816
 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  $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),ilUtil::tf2yn($_POST['protected']));
471 
472  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
473 
474  $this->ctrl->redirect($this, "perm");
475  }
476 
483  {
484  global $rbacadmin, $rbacsystem, $rbacreview;
485 
486  if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
487  {
488  $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
489  }
490  elseif ($this->obj_id == $_POST["adopt"])
491  {
492  ilUtil::sendFailure($this->lng->txt("msg_perm_adopted_from_itself"),true);
493  }
494  else
495  {
496  $rbacadmin->deleteRolePermission($this->obj_id, $this->rolf_ref_id);
497  $parentRoles = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
498  $rbacadmin->copyRoleTemplatePermissions($_POST["adopt"],$parentRoles[$_POST["adopt"]]["parent"],
499  $this->rolf_ref_id,$this->obj_id);
500  // update object data entry (to update last modification date)
501  $this->object->update();
502 
503  // send info
504  $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_POST["adopt"]);
505  ilUtil::sendSuccess($this->lng->txt("msg_perm_adopted_from1")." '".$obj_data->getTitle()."'.<br/>".$this->lng->txt("msg_perm_adopted_from2"),true);
506  }
507 
508  $this->ctrl->redirect($this, "perm");
509  }
510 
516  function editObject()
517  {
518  global $rbacsystem, $rbacreview;
519 
520  if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
521  {
522  $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
523  }
524 
525  $this->getTemplateFile("edit","role");
526 
527  if ($_SESSION["error_post_vars"])
528  {
529  // fill in saved values in case of error
530  if (substr($this->object->getTitle(),0,3) != "il_")
531  {
532  $this->tpl->setVariable("TITLE",ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"]),true);
533  }
534 
535  $this->tpl->setVariable("DESC",ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]));
536  $protect_permissions = ($_SESSION["error_post_vars"]["Fobject"]["protect_permissions"]) ? "checked=\"checked\"" : "";
537  }
538  else
539  {
540  if (substr($this->object->getTitle(),0,3) != "il_")
541  {
542  $this->tpl->setVariable("TITLE",ilUtil::prepareFormOutput($this->object->getTitle()));
543  }
544 
545  $this->tpl->setVariable("DESC",ilUtil::stripSlashes($this->object->getDescription()));
546  $protect_permissions = $rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()) ? "checked=\"checked\"" : "";
547  }
548 
549  $obj_str = "&obj_id=".$this->obj_id;
550 
551  $this->tpl->setVariable("TXT_TITLE",$this->lng->txt("title"));
552  $this->tpl->setVariable("TXT_DESC",$this->lng->txt("desc"));
553 
554  $this->tpl->setCurrentBlock("protect_permissions");
555  $this->tpl->setVariable("TXT_PROTECT_PERMISSIONS",$this->lng->txt('role_protect_permissions'));
556  $this->tpl->setVariable("PROTECT_PERMISSIONS",$protect_permissions);
557  $this->tpl->parseCurrentBlock();
558 
559  $this->tpl->setVariable("FORMACTION",
560  $this->ctrl->getFormAction($this));
561  $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($this->object->getType()."_edit"));
562  $this->tpl->setVariable("TARGET", $this->getTargetFrame("update"));
563  $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
564  $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
565  $this->tpl->setVariable("CMD_SUBMIT", "update");
566  $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
567 
568  if (substr($this->object->getTitle(),0,3) == "il_")
569  {
570  $this->tpl->setVariable("SHOW_TITLE",$this->object->getTitle());
571  }
572  }
573 
577  function getAdminTabs(&$tabs_gui)
578  {
579  $this->getTabs($tabs_gui);
580  }
581 
582  function getTabs(&$tabs_gui)
583  {
584  global $rbacsystem,$rbacreview;
585 
586  if ($rbacsystem->checkAccess('write',$this->rolf_ref_id))
587  {
588  $tabs_gui->addTarget("edit_properties",
589  $this->ctrl->getLinkTarget($this, "edit"),
590  array("edit","update"), get_class($this));
591 
592  $tabs_gui->addTarget("default_perm_settings",
593  $this->ctrl->getLinkTarget($this, "perm"),
594  array("perm"), get_class($this));
595  }
596  }
597 
598 
603  function cancelObject()
604  {
605  $this->ctrl->redirectByClass("ilobjrolefoldergui","view");
606  }
607 
608 
609 
615  function updateObject()
616  {
617  global $rbacsystem, $rbacadmin, $rbacreview;
618 
619  // check write access
620  if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
621  {
622  $this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_rolt"),$this->ilias->error_obj->WARNING);
623  }
624 
625  if (substr($this->object->getTitle(),0,3) != "il_")
626  {
627  // check required fields
628  if (empty($_POST["Fobject"]["title"]))
629  {
630  $this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
631  }
632 
633  // check if role title has il_ prefix
634  if (substr($_POST["Fobject"]["title"],0,3) == "il_")
635  {
636  $this->ilias->raiseError($this->lng->txt("msg_role_reserved_prefix"),$this->ilias->error_obj->MESSAGE);
637  }
638 
639  // update
640  $this->object->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
641  }
642 
643  $this->object->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
644  $rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),ilUtil::tf2yn($_POST["Fobject"]["protect_permissions"]));
645  $this->object->update();
646 
647  ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
648 
649  $this->ctrl->returnToParent($this);
650  }
651 
657  {
658  global $ilLocator;
659 
660  if ($_GET["admin_mode"] == "settings") // system settings
661  {
662  $ilLocator->addItem($this->lng->txt("administration"),
663  $this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
664  ilFrameTargetInfo::_getFrame("MainContent"));
665 
666  $ilLocator->addItem(ilObject::_lookupTitle(
667  ilObject::_lookupObjId($_GET["ref_id"])),
668  $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
669 
670  $ilLocator->addItem($this->object->getTitle(),
671  $this->ctrl->getLinkTarget($this, "perm"));
672  }
673  else // repository administration
674  {
675  //?
676  }
677 
678  }
679 
680  function showUpperIcon()
681  {
682  global $tree, $tpl, $objDefinition;
683 
684  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
685  {
686  $tpl->setUpperIcon(
687  $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
688  }
689  else
690  {
691  if ($this->object->getRefId() != ROOT_FOLDER_ID &&
692  $this->object->getRefId() != SYSTEM_FOLDER_ID)
693  {
694  $par_id = $tree->getParentId($this->object->getRefId());
695  $tpl->setUpperIcon("repository.php?ref_id=".$par_id);
696  }
697  }
698  }
699 
700 
701 } // END class.ilObjRoleTemplateGUI
702 ?>