ILIAS  Release_4_2_x_branch Revision 61807
 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 $tpl_filter 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  foreach ($rbac_objects as $key => $obj_data)
237  {
238  if ($objDefinition->isPlugin($obj_data["type"]))
239  {
240  $rbac_objects[$key]["name"] = ilPlugin::lookupTxt("rep_robj", $obj_data["type"],
241  "obj_".$obj_data["type"]);
242  }
243  else
244  {
245  $rbac_objects[$key]["name"] = $this->lng->txt("obj_".$obj_data["type"]);
246  }
247 
248  $rbac_objects[$key]["ops"] = $rbac_operations[$key];
249  }
250 
251  sort($rbac_objects);
252 
253  foreach ($rbac_objects as $key => $obj_data)
254  {
255  sort($rbac_objects[$key]["ops"]);
256  }
257 
258  // sort by (translated) name of object type
259  $rbac_objects = ilUtil::sortArray($rbac_objects,"name","asc");
260 
261  // BEGIN CHECK_PERM
262  foreach ($rbac_objects as $key => $obj_data)
263  {
264  $arr_selected = $rbacreview->getOperationsOfRole($this->object->getId(), $obj_data["type"], $this->rolf_ref_id);
265  $arr_checked = array_intersect($arr_selected,array_keys($rbac_operations[$obj_data["obj_id"]]));
266 
267  foreach ($rbac_operations[$obj_data["obj_id"]] as $operation)
268  {
269  $checked = in_array($operation["ops_id"],$arr_checked);
270  $disabled = false;
271 
272  // Es wird eine 2-dim Post Variable �bergeben: perm[rol_id][ops_id]
273  $box = ilUtil::formCheckBox($checked,"template_perm[".$obj_data["type"]."][]",$operation["ops_id"],$disabled);
274  $output["perm"][$obj_data["obj_id"]][$operation["ops_id"]] = $box;
275  }
276  }
277  // END CHECK_PERM
278 
279  $output["col_anz"] = count($rbac_objects);
280  $output["txt_save"] = $this->lng->txt("save");
281  $output["check_protected"] = ilUtil::formCheckBox($rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()),"protected",1);
282  $output["text_protected"] = $this->lng->txt("role_protect_permissions");
283 
284 /************************************/
285 /* adopt permissions form */
286 /************************************/
287 
288  $output["message_middle"] = $this->lng->txt("adopt_perm_from_template");
289 
290  // send message for system role
291  if ($this->object->getId() == SYSTEM_ROLE_ID)
292  {
293  $output["adopt"] = array();
294  ilUtil::sendFailure($this->lng->txt("msg_sysrole_not_editable"));
295  }
296  else
297  {
298  // BEGIN ADOPT_PERMISSIONS
299  $parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
300 
301  // sort output for correct color changing
302  ksort($parent_role_ids);
303 
304  foreach ($parent_role_ids as $key => $par)
305  {
306  if ($par["obj_id"] != SYSTEM_ROLE_ID)
307  {
308  $radio = ilUtil::formRadioButton(0,"adopt",$par["obj_id"]);
309  $output["adopt"][$key]["css_row_adopt"] = ilUtil::switchColor($key, "tblrow1", "tblrow2");
310  $output["adopt"][$key]["check_adopt"] = $radio;
311  $output["adopt"][$key]["type"] = ($par["type"] == 'role' ? 'Role' : 'Template');
312  $output["adopt"][$key]["role_name"] = $par["title"];
313  }
314  }
315 
316  $output["formaction_adopt"] = $this->ctrl->getFormAction($this);
317  // END ADOPT_PERMISSIONS
318  }
319 
320  $output["formaction"] =
321  $this->ctrl->getFormAction($this);
322 
323  $this->data = $output;
324 
325 
326 /************************************/
327 /* generate output */
328 /************************************/
329 
330  $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
331  $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
332  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_perm_role.html");
333 
334  foreach ($rbac_objects as $obj_data)
335  {
336  // BEGIN object_operations
337  $this->tpl->setCurrentBlock("object_operations");
338 
339  foreach ($obj_data["ops"] as $operation)
340  {
341  $ops_ids[] = $operation["ops_id"];
342 
343  $css_row = ilUtil::switchColor($key, "tblrow1", "tblrow2");
344  $this->tpl->setVariable("CSS_ROW",$css_row);
345  $this->tpl->setVariable("PERMISSION",$operation["name"]);
346  $this->tpl->setVariable("CHECK_PERMISSION",$this->data["perm"][$obj_data["obj_id"]][$operation["ops_id"]]);
347  $this->tpl->parseCurrentBlock();
348  } // END object_operations
349 
350  // BEGIN object_type
351  $this->tpl->setCurrentBlock("object_type");
352  $this->tpl->setVariable("TXT_OBJ_TYPE",$obj_data["name"]);
353 
354 // TODO: move this if in a function and query all objects that may be disabled or inactive
355  if ($this->objDefinition->getDevMode($obj_data["type"]))
356  {
357  $this->tpl->setVariable("TXT_NOT_IMPL", "(".$this->lng->txt("not_implemented_yet").")");
358  }
359  else if ($obj_data["type"] == "icrs" and !$this->ilias->getSetting("ilinc_active"))
360  {
361  $this->tpl->setVariable("TXT_NOT_IMPL", "(".$this->lng->txt("not_enabled_or_configured").")");
362  }
363 
364  // js checkbox toggles
365  $this->tpl->setVariable("JS_VARNAME","template_perm_".$obj_data["type"]);
366  $this->tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($ops_ids));
367  $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
368  $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
369 
370 
371  $this->tpl->parseCurrentBlock();
372  // END object_type
373  }
374 
375  // BEGIN ADOPT PERMISSIONS
376  foreach ($this->data["adopt"] as $key => $value)
377  {
378  $this->tpl->setCurrentBlock("ADOPT_PERM_ROW");
379  $this->tpl->setVariable("CSS_ROW_ADOPT",$value["css_row_adopt"]);
380  $this->tpl->setVariable("CHECK_ADOPT",$value["check_adopt"]);
381  $this->tpl->setVariable("TYPE",$value["type"]);
382  $this->tpl->setVariable("ROLE_NAME",$value["role_name"]);
383  $this->tpl->parseCurrentBlock();
384  }
385 
386  $this->tpl->setCurrentBlock("ADOPT_PERM_FORM");
387  $this->tpl->setVariable("MESSAGE_MIDDLE",$this->data["message_middle"]);
388  $this->tpl->setVariable("FORMACTION_ADOPT",$this->data["formaction_adopt"]);
389  $this->tpl->setVariable("ADOPT",$this->lng->txt('copy'));
390  $this->tpl->parseCurrentBlock();
391  // END ADOPT PERMISSIONS
392 
393  $this->tpl->setCurrentBlock("tblfooter_protected");
394  $this->tpl->setVariable("COL_ANZ",3);
395  $this->tpl->setVariable("CHECK_BOTTOM",$this->data["check_protected"]);
396  $this->tpl->setVariable("MESSAGE_TABLE",$this->data["text_protected"]);
397  $this->tpl->parseCurrentBlock();
398 
399  $this->tpl->setCurrentBlock("tblfooter_standard");
400  $this->tpl->setVariable("COL_ANZ_PLUS",4);
401  $this->tpl->setVariable("TXT_SAVE",$this->data["txt_save"]);
402  $this->tpl->parseCurrentBlock();
403 
404 
405  $this->tpl->setCurrentBlock("adm_content");
406  $this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath("icon_".$this->object->getType().".gif"));
407  $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt($this->object->getType()));
408  $this->tpl->setVariable("TBL_HELP_IMG",ilUtil::getImagePath("icon_help.gif"));
409  $this->tpl->setVariable("TBL_HELP_LINK","tbl_help.php");
410  $this->tpl->setVariable("TBL_HELP_IMG_ALT",$this->lng->txt("help"));
411 
412  // compute additional information in title
413  if (substr($this->object->getTitle(),0,3) == "il_")
414  {
415  $desc = $this->lng->txt("predefined_template");//$this->lng->txt("obj_".$parent_node['type'])." (".$parent_node['obj_id'].") : ".$parent_node['title'];
416  }
417 
418  $description = "<br/>&nbsp;<span class=\"small\">".$desc."</span>";
419 
420  // translation for autogenerated roles
421  if (substr($this->object->getTitle(),0,3) == "il_")
422  {
423  include_once('./Services/AccessControl/classes/class.ilObjRole.php');
424 
425  $title = ilObjRole::_getTranslation($this->object->getTitle())." (".$this->object->getTitle().")";
426  }
427  else
428  {
429  $title = $this->object->getTitle();
430  }
431 
432  $this->tpl->setVariable("TBL_TITLE",$title.$description);
433 
434  $this->tpl->setVariable("TXT_PERMISSION",$this->data["txt_permission"]);
435  $this->tpl->setVariable("FORMACTION",$this->data["formaction"]);
436  $this->tpl->parseCurrentBlock();
437  }
438 
439 
445  function permSaveObject()
446  {
447  global $rbacadmin, $rbacsystem, $rbacreview,$objDefinition;
448 
449  if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
450  {
451  $this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
452  }
453  else
454  {
455  // Alle Template Eintraege loeschen
456  $rbacadmin->deleteRolePermission($this->object->getId(), $this->rolf_ref_id);
457 
458  foreach ($_POST["template_perm"] as $key => $ops_array)
459  {
460  // Setzen der neuen template permissions
461  $rbacadmin->setRolePermission($this->object->getId(), $key,$ops_array,$this->rolf_ref_id);
462  }
463  }
464 
465  // update object data entry (to update last modification date)
466  $this->object->update();
467 
468  // set protected flag
469  // not applicable for role templates
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 ?>