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