ILIAS  Release_4_4_x_branch Revision 61816
 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 (ilPropertyFormGUI $form=null)
 create new role definition template
 editObject (ilPropertyFormGUI $form=null)
 Create new object.
 updateObject ()
 update role template object
 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
 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
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
- 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 ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 editObject ()
 edit object
 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.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Data Fields

const FORM_MODE_EDIT = 1
const FORM_MODE_CREATE = 2
 $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
const CFORM_NEW = 1
const CFORM_IMPORT = 2
const CFORM_CLONE = 3

Protected Member Functions

 initFormRoleTemplate ($a_mode=self::FORM_MODE_CREATE)
 Init create form.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showMountWebfolderIcon ()
 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)
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 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)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 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
 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="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files.
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting.

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.

Detailed Description

Class ilObjRoleTemplateGUI.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id:
class.ilObjRoleTemplateGUI.php 47571 2014-01-28 10:23:28Z jluetzen

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)

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

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

{
global $ilLocator;
$ilLocator->addItem(ilObject::_lookupTitle(
$this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", "view"));
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::adoptPermSaveObject ( )

adopting permission setting from other roles/role templates

public

Definition at line 565 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 623 of file class.ilObjRoleTemplateGUI.php.

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

create new role definition template

public

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

References initFormRoleTemplate().

{
global $rbacsystem;
if (!$rbacsystem->checkAccess("create_rolt", $this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
if(!$form)
{
$form = $this->initFormRoleTemplate(self::FORM_MODE_CREATE);
}
$this->tpl->setContent($form->getHTML());
return true;
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::editObject ( ilPropertyFormGUI  $form = null)

Create new object.

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

References $GLOBALS, and initFormRoleTemplate().

{
global $rbacsystem;
if (!$rbacsystem->checkAccess("write", $this->rolf_ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
}
if(!$form)
{
$form = $this->initFormRoleTemplate(self::FORM_MODE_EDIT);
}
$GLOBALS['tpl']->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

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

References $cmd, and ilObjectGUI\prepareOutput().

{
global $rbacsystem;
$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 597 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 602 of file class.ilObjRoleTemplateGUI.php.

Referenced by getAdminTabs().

{
global $rbacsystem,$rbacreview;
if ($rbacsystem->checkAccess('write',$this->rolf_ref_id))
{
$tabs_gui->addTarget("settings",
$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 41 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::initFormRoleTemplate (   $a_mode = self::FORM_MODE_CREATE)
protected

Init create form.

Parameters
boolcreation mode
Returns
ilPropertyFormGUI $form

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

References $GLOBALS, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setDisabled(), and ilTextAreaInputGUI\setValue().

Referenced by createObject(), editObject(), saveObject(), and updateObject().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
if($this->creation_mode)
{
$this->ctrl->setParameter($this, "new_type", 'rolt');
}
$form->setFormAction($this->ctrl->getFormAction($this));
if($a_mode == self::FORM_MODE_CREATE)
{
$form->setTitle($this->lng->txt('rolt_new'));
$form->addCommandButton('save', $this->lng->txt('rolt_new'));
}
else
{
$form->setTitle($this->lng->txt('rolt_edit'));
$form->addCommandButton('update', $this->lng->txt('save'));
}
$form->addCommandButton('cancel', $this->lng->txt('cancel'));
$title = new ilTextInputGUI($this->lng->txt('title'),'title');
if($a_mode != self::FORM_MODE_CREATE)
{
if($this->object->isInternalTemplate())
{
$title->setDisabled(true);
}
$title->setValue($this->object->getTitle());
}
$title->setSize(40);
$title->setMaxLength(70);
$title->setRequired(true);
$form->addItem($title);
$desc = new ilTextAreaInputGUI($this->lng->txt('description'),'desc');
if($a_mode != self::FORM_MODE_CREATE)
{
$desc->setValue($this->object->getDescription());
}
$desc->setCols(40);
$desc->setRows(3);
$form->addItem($desc);
$pro = new ilCheckboxInputGUI($this->lng->txt('role_protect_permissions'),'protected');
$pro->setChecked($GLOBALS['rbacreview']->isProtected(
$this->rolf_ref_id,
$this->object->getId()
));
$pro->setValue(1);
$form->addItem($pro);
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjRoleTemplateGUI::permObject ( )

display permissions

public

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

References ilObjectGUI\$objDefinition, $rolf_ref_id, 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 $tpl_filter 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']);
}
elseif(substr($info['operation'],0,6) == 'create')
{
$txt = $this->lng->txt('rbac_'.$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("ADM_CONTENT", "adm_content", "tpl.adm_perm_role.html",
"Services/AccessControl");
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->setVariable("COL_ANZ_PLUS",4);
$this->tpl->setVariable("TXT_SAVE",$this->data["txt_save"]);
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath("icon_".$this->object->getType().".png"));
$this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt($this->object->getType()));
$this->tpl->setVariable("TBL_HELP_IMG",ilUtil::getImagePath("icon_help.png"));
$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 528 of file class.ilObjRoleTemplateGUI.php.

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

{
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
// not applicable for role templates
#$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 225 of file class.ilObjRoleTemplateGUI.php.

References $rolf_ref_id, ilObjectGUI\createObject(), initFormRoleTemplate(), and ilUtil\sendSuccess().

{
global $rbacsystem,$rbacadmin, $rbacreview;
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);
}
$form = $this->initFormRoleTemplate();
if($form->checkInput())
{
include_once("./Services/AccessControl/classes/class.ilObjRoleTemplate.php");
$roltObj = new ilObjRoleTemplate();
$roltObj->setTitle($form->getInput('title'));
$roltObj->setDescription($form->getInput('desc'));
$roltObj->create();
$rbacadmin->assignRoleToFolder($roltObj->getId(), $this->rolf_ref_id,'n');
$rbacadmin->setProtected(
$this->rolf_ref_id,
$roltObj->getId(),
$form->getInput('protected') ? 'y' : 'n'
);
ilUtil::sendSuccess($this->lng->txt("rolt_added"),true);
// redirect to permission screen
$this->ctrl->setParameter($this,'obj_id',$roltObj->getId());
$this->ctrl->redirect($this,'perm');
}
$form->setValuesByPost();
$this->createObject($form);
}

+ Here is the call graph for this function:

ilObjRoleTemplateGUI::updateObject ( )

update role template object

public

Reimplemented from ilObjectGUI.

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

References ilObjectGUI\editObject(), initFormRoleTemplate(), and ilUtil\sendSuccess().

{
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);
}
$form = $this->initFormRoleTemplate(self::FORM_MODE_EDIT);
if($form->checkInput())
{
$this->object->setTitle($form->getInput('title'));
$this->object->setDescription($form->getInput('desc'));
$rbacadmin->setProtected(
$this->rolf_ref_id,
$this->object->getId(),
$form->getInput('protected') ? 'y' : 'n'
);
$this->object->update();
ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
$this->ctrl->returnToParent($this);
}
$form->setValuesByPost();
$this->editObject($form);
}

+ Here is the call graph for this function:

Field Documentation

ilObjRoleTemplateGUI::$rolf_ref_id

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

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

ilObjRoleTemplateGUI::$type

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

const ilObjRoleTemplateGUI::FORM_MODE_CREATE = 2

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

const ilObjRoleTemplateGUI::FORM_MODE_EDIT = 1

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


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