ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjRoleTemplateGUI Class Reference

Class ilObjRoleTemplateGUI. More...

+ Inheritance diagram for ilObjRoleTemplateGUI:
+ Collaboration diagram for ilObjRoleTemplateGUI:

Public Member Functions

 ilObjRoleTemplateGUI ($a_data, $a_id, $a_call_by_reference)
 Constructor.
executeCommand ()
 execute command
 createObject ()
 create new role definition template
 saveObject ()
 save a new role template object
 permObject ()
 display permissions
 permSaveObject ()
 save permission templates of role
 adoptPermSaveObject ()
 adopting permission setting from other roles/role templates
 editObject ()
 edit object
 getAdminTabs (&$tabs_gui)
 admin and normal tabs are equal for roles
 getTabs (&$tabs_gui)
 get tabs abstract method.
 cancelObject ()
 cancelObject is called when an operation is canceled, method links back public
 updateObject ()
 update role template object
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 showUpperIcon ()
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Data Fields

 $type
 $rolf_ref_id
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Additional Inherited Members

- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Detailed Description

Class ilObjRoleTemplateGUI.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilObjRoleTemplateGUI.php 25692 2010-09-15 09:44:16Z mwarkus

ilObjRoleTemplateGUI:

Definition at line 17 of file class.ilObjRoleTemplateGUI.php.

Member Function Documentation

ilObjRoleTemplateGUI::addAdminLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 656 of file class.ilObjRoleTemplateGUI.php.

References $_GET, ilFrameTargetInfo\_getFrame(), ilObject\_lookupObjId(), and ilObject\_lookupTitle().

{
global $ilLocator;
if ($_GET["admin_mode"] == "settings") // system settings
{
$ilLocator->addItem($this->lng->txt("administration"),
$this->ctrl->getLinkTargetByClass("iladministrationgui", "frameset"),
$ilLocator->addItem(ilObject::_lookupTitle(
$this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
$ilLocator->addItem($this->object->getTitle(),
$this->ctrl->getLinkTarget($this, "perm"));
}
else // repository administration
{
//?
}
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::adoptPermSaveObject ( )

adopting permission setting from other roles/role templates

public

Definition at line 482 of file class.ilObjRoleTemplateGUI.php.

References $_POST, ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $rbacadmin, $rbacsystem, $rbacreview;
if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
}
elseif ($this->obj_id == $_POST["adopt"])
{
ilUtil::sendFailure($this->lng->txt("msg_perm_adopted_from_itself"),true);
}
else
{
$rbacadmin->deleteRolePermission($this->obj_id, $this->rolf_ref_id);
$parentRoles = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
$rbacadmin->copyRoleTemplatePermissions($_POST["adopt"],$parentRoles[$_POST["adopt"]]["parent"],
$this->rolf_ref_id,$this->obj_id);
// update object data entry (to update last modification date)
$this->object->update();
// send info
$obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_POST["adopt"]);
ilUtil::sendSuccess($this->lng->txt("msg_perm_adopted_from1")." '".$obj_data->getTitle()."'.<br/>".$this->lng->txt("msg_perm_adopted_from2"),true);
}
$this->ctrl->redirect($this, "perm");
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::cancelObject ( )

cancelObject is called when an operation is canceled, method links back public

Definition at line 603 of file class.ilObjRoleTemplateGUI.php.

{
$this->ctrl->redirectByClass("ilobjrolefoldergui","view");
}
ilObjRoleTemplateGUI::createObject ( )

create new role definition template

public

Reimplemented from ilObjectGUI.

Definition at line 87 of file class.ilObjRoleTemplateGUI.php.

References $_SESSION, ilObjectGUI\$data, ilObjectGUI\getTargetFrame(), ilObjectGUI\getTemplateFile(), ilUtil\prepareFormOutput(), and ilUtil\stripSlashes().

{
global $rbacsystem;
if (!$rbacsystem->checkAccess("create_rolt", $this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
else
{
// fill in saved values in case of error
$data = array();
$data["fields"] = array();
$data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
$data["fields"]["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);
$this->getTemplateFile("edit","role");
foreach ($data["fields"] as $key => $val)
{
$this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
$this->tpl->setVariable(strtoupper($key), $val);
if ($this->prepare_output)
{
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setCurrentBlock("protect_permissions");
$protect_permissions = $_SESSION["error_post_vars"]["Fobject"]["protect_permissions"] ? "checked=\"checked\"" : "";
$this->tpl->setVariable("TXT_PROTECT_PERMISSIONS",$this->lng->txt("role_protect_permissions"));
$this->tpl->setVariable("PROTECT_PERMISSIONS",$protect_permissions);
$this->tpl->parseCurrentBlock();
$this->ctrl->setParameter($this, "new_type", $this->type);
$this->tpl->setVariable("FORMACTION",
$this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_HEADER", $this->lng->txt($this->type."_new"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($this->type."_add"));
$this->tpl->setVariable("CMD_SUBMIT", "save");
$this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
}
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::editObject ( )

edit object

public

Reimplemented from ilObjectGUI.

Definition at line 516 of file class.ilObjRoleTemplateGUI.php.

References $_SESSION, ilObjectGUI\getTargetFrame(), ilObjectGUI\getTemplateFile(), ilUtil\prepareFormOutput(), and ilUtil\stripSlashes().

{
global $rbacsystem, $rbacreview;
if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
}
$this->getTemplateFile("edit","role");
if ($_SESSION["error_post_vars"])
{
// fill in saved values in case of error
if (substr($this->object->getTitle(),0,3) != "il_")
{
$this->tpl->setVariable("TITLE",ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"]),true);
}
$this->tpl->setVariable("DESC",ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]));
$protect_permissions = ($_SESSION["error_post_vars"]["Fobject"]["protect_permissions"]) ? "checked=\"checked\"" : "";
}
else
{
if (substr($this->object->getTitle(),0,3) != "il_")
{
$this->tpl->setVariable("TITLE",ilUtil::prepareFormOutput($this->object->getTitle()));
}
$this->tpl->setVariable("DESC",ilUtil::stripSlashes($this->object->getDescription()));
$protect_permissions = $rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()) ? "checked=\"checked\"" : "";
}
$obj_str = "&obj_id=".$this->obj_id;
$this->tpl->setVariable("TXT_TITLE",$this->lng->txt("title"));
$this->tpl->setVariable("TXT_DESC",$this->lng->txt("desc"));
$this->tpl->setCurrentBlock("protect_permissions");
$this->tpl->setVariable("TXT_PROTECT_PERMISSIONS",$this->lng->txt('role_protect_permissions'));
$this->tpl->setVariable("PROTECT_PERMISSIONS",$protect_permissions);
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable("FORMACTION",
$this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_HEADER", $this->lng->txt($this->object->getType()."_edit"));
$this->tpl->setVariable("TARGET", $this->getTargetFrame("update"));
$this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt("save"));
$this->tpl->setVariable("CMD_SUBMIT", "update");
$this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
if (substr($this->object->getTitle(),0,3) == "il_")
{
$this->tpl->setVariable("SHOW_TITLE",$this->object->getTitle());
}
}

+ Here is the call graph for this function:

& ilObjRoleTemplateGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 49 of file class.ilObjRoleTemplateGUI.php.

References $cmd, and ilObjectGUI\prepareOutput().

{
global $rbacsystem;
if($this->ctrl->getTargetScript() == 'role.php')
{
$this->__prepareOutput();
}
else
{
$this->prepareOutput();
}
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
default:
if(!$cmd)
{
$cmd = "perm";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::getAdminTabs ( $tabs_gui)

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

Definition at line 577 of file class.ilObjRoleTemplateGUI.php.

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::getTabs ( $tabs_gui)

get tabs abstract method.

overwrite in derived GUI class of your object type public

Parameters
objectinstance of ilTabsGUI

Reimplemented from ilObjectGUI.

Definition at line 582 of file class.ilObjRoleTemplateGUI.php.

Referenced by getAdminTabs().

{
global $rbacsystem,$rbacreview;
if ($rbacsystem->checkAccess('write',$this->rolf_ref_id))
{
$tabs_gui->addTarget("edit_properties",
$this->ctrl->getLinkTarget($this, "edit"),
array("edit","update"), get_class($this));
$tabs_gui->addTarget("default_perm_settings",
$this->ctrl->getLinkTarget($this, "perm"),
array("perm"), get_class($this));
}
}

+ Here is the caller graph for this function:

ilObjRoleTemplateGUI::ilObjRoleTemplateGUI (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor.

public

Definition at line 37 of file class.ilObjRoleTemplateGUI.php.

References ilObjectGUI\$lng, ilObjectGUI\$ref_id, and ilObjectGUI\ilObjectGUI().

{
global $lng;
$lng->loadLanguageModule('rbac');
$this->type = "rolt";
$this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
$this->rolf_ref_id =& $this->ref_id;
$this->ctrl->saveParameter($this, "obj_id");
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::permObject ( )

display permissions

public

Definition at line 181 of file class.ilObjRoleTemplateGUI.php.

References $desc, ilObjectGUI\$objDefinition, $rolf_ref_id, $title, ilObjRole\_getTranslation(), ilUtil\array_php2js(), exit, ilUtil\formRadioButton(), ilUtil\getImagePath(), ilPlugin\lookupTxt(), ilUtil\sendFailure(), ilUtil\sortArray(), and ilUtil\switchColor().

{
global $rbacadmin, $rbacreview, $rbacsystem,$objDefinition;
if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
exit();
}
$to_filter = $objDefinition->getSubobjectsToFilter();
$tpl_filter = array();
$internal_tpl = false;
if (($internal_tpl = $this->object->isInternalTemplate()))
{
$tpl_filter = $this->object->getFilterOfInternalTemplate();
}
$operation_info = $rbacreview->getOperationAssignment();
foreach($operation_info as $info)
{
if($objDefinition->getDevMode($info['type']))
{
continue;
}
// FILTER SUBOJECTS OF adm OBJECT
if(in_array($info['type'],$to_filter))
{
continue;
}
if ($internal_tpl and !in_array($info['type'],$tpl_filter))
{
continue;
}
$rbac_objects[$info['typ_id']] = array("obj_id" => $info['typ_id'],
"type" => $info['type']);
$txt = $objDefinition->isPlugin($info['type'])
? ilPlugin::lookupTxt("rep_robj", $info['type'], $info['type']."_".$info['operation'])
: $this->lng->txt($info['type']."_".$info['operation']);
if (substr($info['operation'], 0, 7) == "create_" &&
$objDefinition->isPlugin(substr($info['operation'], 7)))
{
$txt = ilPlugin::lookupTxt("rep_robj", substr($info['operation'], 7), $info['type']."_".$info['operation']);
}
$rbac_operations[$info['typ_id']][$info['ops_id']] = array(
"ops_id" => $info['ops_id'],
"title" => $info['operation'],
"name" => $txt);
}
foreach ($rbac_objects as $key => $obj_data)
{
if ($objDefinition->isPlugin($obj_data["type"]))
{
$rbac_objects[$key]["name"] = ilPlugin::lookupTxt("rep_robj", $obj_data["type"],
"obj_".$obj_data["type"]);
}
else
{
$rbac_objects[$key]["name"] = $this->lng->txt("obj_".$obj_data["type"]);
}
$rbac_objects[$key]["ops"] = $rbac_operations[$key];
}
sort($rbac_objects);
foreach ($rbac_objects as $key => $obj_data)
{
sort($rbac_objects[$key]["ops"]);
}
// sort by (translated) name of object type
$rbac_objects = ilUtil::sortArray($rbac_objects,"name","asc");
// BEGIN CHECK_PERM
foreach ($rbac_objects as $key => $obj_data)
{
$arr_selected = $rbacreview->getOperationsOfRole($this->object->getId(), $obj_data["type"], $this->rolf_ref_id);
$arr_checked = array_intersect($arr_selected,array_keys($rbac_operations[$obj_data["obj_id"]]));
foreach ($rbac_operations[$obj_data["obj_id"]] as $operation)
{
$checked = in_array($operation["ops_id"],$arr_checked);
$disabled = false;
// Es wird eine 2-dim Post Variable �bergeben: perm[rol_id][ops_id]
$box = ilUtil::formCheckBox($checked,"template_perm[".$obj_data["type"]."][]",$operation["ops_id"],$disabled);
$output["perm"][$obj_data["obj_id"]][$operation["ops_id"]] = $box;
}
}
// END CHECK_PERM
$output["col_anz"] = count($rbac_objects);
$output["txt_save"] = $this->lng->txt("save");
$output["check_protected"] = ilUtil::formCheckBox($rbacreview->isProtected($this->rolf_ref_id,$this->object->getId()),"protected",1);
$output["text_protected"] = $this->lng->txt("role_protect_permissions");
/************************************/
/* adopt permissions form */
/************************************/
$output["message_middle"] = $this->lng->txt("adopt_perm_from_template");
// send message for system role
if ($this->object->getId() == SYSTEM_ROLE_ID)
{
$output["adopt"] = array();
ilUtil::sendFailure($this->lng->txt("msg_sysrole_not_editable"));
}
else
{
// BEGIN ADOPT_PERMISSIONS
$parent_role_ids = $rbacreview->getParentRoleIds($this->rolf_ref_id,true);
// sort output for correct color changing
ksort($parent_role_ids);
foreach ($parent_role_ids as $key => $par)
{
if ($par["obj_id"] != SYSTEM_ROLE_ID)
{
$radio = ilUtil::formRadioButton(0,"adopt",$par["obj_id"]);
$output["adopt"][$key]["css_row_adopt"] = ilUtil::switchColor($key, "tblrow1", "tblrow2");
$output["adopt"][$key]["check_adopt"] = $radio;
$output["adopt"][$key]["type"] = ($par["type"] == 'role' ? 'Role' : 'Template');
$output["adopt"][$key]["role_name"] = $par["title"];
}
}
$output["formaction_adopt"] = $this->ctrl->getFormAction($this);
// END ADOPT_PERMISSIONS
}
$output["formaction"] =
$this->ctrl->getFormAction($this);
$this->data = $output;
/************************************/
/* generate output */
/************************************/
$this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
$this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html", "Services/Locator");
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.adm_perm_role.html");
foreach ($rbac_objects as $obj_data)
{
// BEGIN object_operations
$this->tpl->setCurrentBlock("object_operations");
foreach ($obj_data["ops"] as $operation)
{
$ops_ids[] = $operation["ops_id"];
$css_row = ilUtil::switchColor($key, "tblrow1", "tblrow2");
$this->tpl->setVariable("CSS_ROW",$css_row);
$this->tpl->setVariable("PERMISSION",$operation["name"]);
$this->tpl->setVariable("CHECK_PERMISSION",$this->data["perm"][$obj_data["obj_id"]][$operation["ops_id"]]);
$this->tpl->parseCurrentBlock();
} // END object_operations
// BEGIN object_type
$this->tpl->setCurrentBlock("object_type");
$this->tpl->setVariable("TXT_OBJ_TYPE",$obj_data["name"]);
// TODO: move this if in a function and query all objects that may be disabled or inactive
if ($this->objDefinition->getDevMode($obj_data["type"]))
{
$this->tpl->setVariable("TXT_NOT_IMPL", "(".$this->lng->txt("not_implemented_yet").")");
}
else if ($obj_data["type"] == "icrs" and !$this->ilias->getSetting("ilinc_active"))
{
$this->tpl->setVariable("TXT_NOT_IMPL", "(".$this->lng->txt("not_enabled_or_configured").")");
}
// js checkbox toggles
$this->tpl->setVariable("JS_VARNAME","template_perm_".$obj_data["type"]);
$this->tpl->setVariable("JS_ONCLICK",ilUtil::array_php2js($ops_ids));
$this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
$this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
$this->tpl->parseCurrentBlock();
// END object_type
}
// BEGIN ADOPT PERMISSIONS
foreach ($this->data["adopt"] as $key => $value)
{
$this->tpl->setCurrentBlock("ADOPT_PERM_ROW");
$this->tpl->setVariable("CSS_ROW_ADOPT",$value["css_row_adopt"]);
$this->tpl->setVariable("CHECK_ADOPT",$value["check_adopt"]);
$this->tpl->setVariable("TYPE",$value["type"]);
$this->tpl->setVariable("ROLE_NAME",$value["role_name"]);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("ADOPT_PERM_FORM");
$this->tpl->setVariable("MESSAGE_MIDDLE",$this->data["message_middle"]);
$this->tpl->setVariable("FORMACTION_ADOPT",$this->data["formaction_adopt"]);
$this->tpl->setVariable("ADOPT",$this->lng->txt('copy'));
$this->tpl->parseCurrentBlock();
// END ADOPT PERMISSIONS
$this->tpl->setCurrentBlock("tblfooter_protected");
$this->tpl->setVariable("COL_ANZ",3);
$this->tpl->setVariable("CHECK_BOTTOM",$this->data["check_protected"]);
$this->tpl->setVariable("MESSAGE_TABLE",$this->data["text_protected"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("tblfooter_standard");
$this->tpl->setVariable("COL_ANZ_PLUS",4);
$this->tpl->setVariable("TXT_SAVE",$this->data["txt_save"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath("icon_".$this->object->getType().".gif"));
$this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt($this->object->getType()));
$this->tpl->setVariable("TBL_HELP_IMG",ilUtil::getImagePath("icon_help.gif"));
$this->tpl->setVariable("TBL_HELP_LINK","tbl_help.php");
$this->tpl->setVariable("TBL_HELP_IMG_ALT",$this->lng->txt("help"));
// compute additional information in title
if (substr($this->object->getTitle(),0,3) == "il_")
{
$desc = $this->lng->txt("predefined_template");//$this->lng->txt("obj_".$parent_node['type'])." (".$parent_node['obj_id'].") : ".$parent_node['title'];
}
$description = "<br/>&nbsp;<span class=\"small\">".$desc."</span>";
// translation for autogenerated roles
if (substr($this->object->getTitle(),0,3) == "il_")
{
include_once('./Services/AccessControl/classes/class.ilObjRole.php');
$title = ilObjRole::_getTranslation($this->object->getTitle())." (".$this->object->getTitle().")";
}
else
{
$title = $this->object->getTitle();
}
$this->tpl->setVariable("TBL_TITLE",$title.$description);
$this->tpl->setVariable("TXT_PERMISSION",$this->data["txt_permission"]);
$this->tpl->setVariable("FORMACTION",$this->data["formaction"]);
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::permSaveObject ( )

save permission templates of role

public

Definition at line 446 of file class.ilObjRoleTemplateGUI.php.

References $_POST, ilObjectGUI\$objDefinition, $rolf_ref_id, ilUtil\sendSuccess(), and ilUtil\tf2yn().

{
global $rbacadmin, $rbacsystem, $rbacreview,$objDefinition;
if (!$rbacsystem->checkAccess('write',$this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_perm"),$this->ilias->error_obj->WARNING);
}
else
{
// Alle Template Eintraege loeschen
$rbacadmin->deleteRolePermission($this->object->getId(), $this->rolf_ref_id);
foreach ($_POST["template_perm"] as $key => $ops_array)
{
// Setzen der neuen template permissions
$rbacadmin->setRolePermission($this->object->getId(), $key,$ops_array,$this->rolf_ref_id);
}
}
// update object data entry (to update last modification date)
$this->object->update();
// set protected flag
$rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),ilUtil::tf2yn($_POST['protected']));
ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
$this->ctrl->redirect($this, "perm");
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::saveObject ( )

save a new role template object

public

Reimplemented from ilObjectGUI.

Definition at line 140 of file class.ilObjRoleTemplateGUI.php.

References $_POST, $rolf_ref_id, ilUtil\sendSuccess(), ilUtil\stripSlashes(), and ilUtil\tf2yn().

{
global $rbacsystem,$rbacadmin, $rbacreview;
// CHECK ACCESS 'write' to role folder
// TODO: check for create role permission should be better
if (!$rbacsystem->checkAccess("create_rolt",$this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_create_rolt"),$this->ilias->error_obj->WARNING);
}
// check required fields
if (empty($_POST["Fobject"]["title"]))
{
$this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
}
// check if role title has il_ prefix
if (substr($_POST["Fobject"]["title"],0,3) == "il_")
{
$this->ilias->raiseError($this->lng->txt("msg_role_reserved_prefix"),$this->ilias->error_obj->MESSAGE);
}
// create new rolt object
include_once("./Services/AccessControl/classes/class.ilObjRoleTemplate.php");
$roltObj = new ilObjRoleTemplate();
$roltObj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
$roltObj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
$roltObj->create();
$rbacadmin->assignRoleToFolder($roltObj->getId(), $this->rolf_ref_id,'n');
$rbacadmin->setProtected($this->rolf_ref_id,$roltObj->getId(),ilUtil::tf2yn($_POST["Fobject"]["protect_permissions"]));
ilUtil::sendSuccess($this->lng->txt("rolt_added"),true);
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::showUpperIcon ( )

Reimplemented from ilObjectGUI.

Definition at line 680 of file class.ilObjRoleTemplateGUI.php.

References $_GET, ilObjectGUI\$objDefinition, ilObjectGUI\$tpl, and ilObjectGUI\$tree.

{
if (strtolower($_GET["baseClass"]) == "iladministrationgui")
{
$tpl->setUpperIcon(
$this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
}
else
{
if ($this->object->getRefId() != ROOT_FOLDER_ID &&
$this->object->getRefId() != SYSTEM_FOLDER_ID)
{
$par_id = $tree->getParentId($this->object->getRefId());
$tpl->setUpperIcon("repository.php?ref_id=".$par_id);
}
}
}
ilObjRoleTemplateGUI::updateObject ( )

update role template object

public

Reimplemented from ilObjectGUI.

Definition at line 615 of file class.ilObjRoleTemplateGUI.php.

References $_POST, ilUtil\sendSuccess(), ilUtil\stripSlashes(), and ilUtil\tf2yn().

{
global $rbacsystem, $rbacadmin, $rbacreview;
// check write access
if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_modify_rolt"),$this->ilias->error_obj->WARNING);
}
if (substr($this->object->getTitle(),0,3) != "il_")
{
// check required fields
if (empty($_POST["Fobject"]["title"]))
{
$this->ilias->raiseError($this->lng->txt("fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
}
// check if role title has il_ prefix
if (substr($_POST["Fobject"]["title"],0,3) == "il_")
{
$this->ilias->raiseError($this->lng->txt("msg_role_reserved_prefix"),$this->ilias->error_obj->MESSAGE);
}
// update
$this->object->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
}
$this->object->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
$rbacadmin->setProtected($this->rolf_ref_id,$this->object->getId(),ilUtil::tf2yn($_POST["Fobject"]["protect_permissions"]));
$this->object->update();
ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
$this->ctrl->returnToParent($this);
}

+ Here is the call graph for this function:

Field Documentation

ilObjRoleTemplateGUI::$rolf_ref_id

Definition at line 31 of file class.ilObjRoleTemplateGUI.php.

Referenced by permObject(), permSaveObject(), and saveObject().

ilObjRoleTemplateGUI::$type

Definition at line 24 of file class.ilObjRoleTemplateGUI.php.


The documentation for this class was generated from the following file: