ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilObjRoleFolderGUI Class Reference

Class ilObjRoleFolderGUI. More...

+ Inheritance diagram for ilObjRoleFolderGUI:
+ Collaboration diagram for ilObjRoleFolderGUI:

Public Member Functions

 ilObjRoleFolderGUI ($a_data, $a_id, $a_call_by_reference)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 viewObject ()
 @global ilErrorHandler $ilErr @global ilRbacSystem $rbacsystem @global ilToolbarGUI $ilToolbar More...
 
 resetFilterObject ()
 Reset role filter. More...
 
 createObject ()
 role folders are created automatically DEPRECATED !!! @access public More...
 
 deleteObject ()
 display deletion confirmation screen DEPRECATED !!! @access public More...
 
 adoptPermSaveObject ()
 ??? TODO: what is the purpose of this function? @access public More...
 
 showPossibleSubObjects ($a_tpl)
 show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders More...
 
 saveObject ()
 save object @access public More...
 
 getAdminTabs (&$tabs_gui)
 Add role folder tabs @global ilTree $tree @global ilLanguage $lng. More...
 
 editSettingsObject (ilPropertyFormGUI $a_form=null)
 
 saveSettingsObject ()
 
 addToExternalSettingsForm ($a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 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 More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Data Fields

 $type
 
- 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

 roleSearchObject ()
 Search target roles. More...
 
 initRoleSearchForm ()
 Init role search form. More...
 
 roleSearchFormObject ()
 Parse search query @global type $ilCtrl. More...
 
 roleSearchListObject ()
 List roles. More...
 
 chooseCopyBehaviourObject ()
 Chosse change existing objects,... More...
 
 initCopyBehaviourForm ()
 Show copy behaviour form. More...
 
 copyRoleObject ()
 Copy role. More...
 
 addRolePermissionsObject ()
 Add role permissions. More...
 
 doAddRolePermissions ($source, $target, $change_existing)
 do add role permission More...
 
 removeRolePermissionsObject ()
 Remove role permissions. More...
 
 doRemoveRolePermissions ($source, $target, $change_existing)
 do add role permission More...
 
 doCopyRole ($source, $target, $change_existing)
 Perform copy of role @global ilTree $tree @global <type> $rbacadmin @global <type> $rbacreview. More...
 
 applyFilterObject ()
 Apply role filter. More...
 
 confirmDeleteObject ()
 Confirm deletion of roles. More...
 
 deleteRoleObject ()
 Delete roles. More...
 
 initSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __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 More...
 
 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 More...
 
 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. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ addRolePermissionsObject()

ilObjRoleFolderGUI::addRolePermissionsObject ( )
protected

Add role permissions.

Definition at line 332 of file class.ilObjRoleFolderGUI.php.

333 {
334 global $ilCtrl;
335
336 // Finally copy role/rolt
337 $roles = explode(',',$_POST['roles']);
338 $source = (int) $_REQUEST['copy_source'];
339
340 $form = $this->initCopyBehaviourForm();
341 if($form->checkInput())
342 {
343 foreach((array) $roles as $role_id)
344 {
345 if($role_id != $source)
346 {
347 $this->doAddRolePermissions($source,$role_id,$form->getInput('change_existing'));
348 }
349 }
350
351 ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
352 $ilCtrl->redirect($this,'view');
353 }
354 }
initCopyBehaviourForm()
Show copy behaviour form.
doAddRolePermissions($source, $target, $change_existing)
do add role permission
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_POST, $_REQUEST, $ilCtrl, doAddRolePermissions(), initCopyBehaviourForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ addToExternalSettingsForm()

ilObjRoleFolderGUI::addToExternalSettingsForm (   $a_form_id)

Definition at line 817 of file class.ilObjRoleFolderGUI.php.

818 {
819 switch($a_form_id)
820 {
822
823 include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
825
826 $fields = array('adm_adm_role_protect' => array($security->isAdminRoleProtected(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
827
828 return array(array("editSettings", $fields));
829
831
832 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
834
835 $subitems = null;
836 if((bool)$privacy->enabledRbacLog())
837 {
838 $subitems = array('rbac_log_age' => $privacy->getRbacLogAge());
839 }
840 $fields = array('rbac_log' => array($privacy->enabledRbacLog(), ilAdministrationSettingsFormHandler::VALUE_BOOL, $subitems));
841
842 return array(array("editSettings", $fields));
843 }
844 }
static _getInstance()
Get instance of ilPrivacySettings.
static _getInstance()
Get instance of ilSecuritySettings.

References ilPrivacySettings\_getInstance(), ilSecuritySettings\_getInstance(), ilAdministrationSettingsFormHandler\FORM_PRIVACY, ilAdministrationSettingsFormHandler\FORM_SECURITY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

+ Here is the call graph for this function:

◆ adoptPermSaveObject()

ilObjRoleFolderGUI::adoptPermSaveObject ( )

??? TODO: what is the purpose of this function? @access public

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

604 {
605 ilUtil::sendSuccess($this->lng->txt("saved_successfully"),true);
606
607 $this->ctrl->redirect($this, "view");
608 }

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ applyFilterObject()

ilObjRoleFolderGUI::applyFilterObject ( )
protected

Apply role filter.

Definition at line 472 of file class.ilObjRoleFolderGUI.php.

473 {
474 include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
475 $table = new ilRoleTableGUI($this,'view');
476 $table->init();
477 $table->resetOffset();
478 $table->writeFilterToSession();
479
480 $this->viewObject();
481 }
viewObject()
@global ilErrorHandler $ilErr @global ilRbacSystem $rbacsystem @global ilToolbarGUI $ilToolbar
TableGUI for the presentation og roles and role templates.

References viewObject().

+ Here is the call graph for this function:

◆ chooseCopyBehaviourObject()

ilObjRoleFolderGUI::chooseCopyBehaviourObject ( )
protected

Chosse change existing objects,...

Definition at line 241 of file class.ilObjRoleFolderGUI.php.

242 {
243 global $ilCtrl, $ilTabs;
244
245 $ilTabs->clearTargets();
246 $ilTabs->setBackTarget(
247 $this->lng->txt('rbac_back_to_overview'),
248 $this->ctrl->getLinkTarget($this,'roleSearchList')
249 );
250
251 $GLOBALS['ilLog']->write(__METHOD__.': '.$_REQUEST['copy_source']);
252
253 $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
254
255 $form = $this->initCopyBehaviourForm();
256 $this->tpl->setContent($form->getHTML());
257 }
$GLOBALS['ct_recipient']

References $_REQUEST, $GLOBALS, $ilCtrl, and initCopyBehaviourForm().

+ Here is the call graph for this function:

◆ confirmDeleteObject()

ilObjRoleFolderGUI::confirmDeleteObject ( )
protected

Confirm deletion of roles.

Definition at line 500 of file class.ilObjRoleFolderGUI.php.

501 {
502 global $ilCtrl;
503
504 if(!count($_POST['roles']))
505 {
506 ilUtil::sendFailure($this->lng->txt('select_one'),true);
507 $ilCtrl->redirect($this,'view');
508 }
509
510 $question = $this->lng->txt('rbac_role_delete_qst');
511
512 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
513 $confirm = new ilConfirmationGUI();
514 $confirm->setHeaderText($question);
515 $confirm->setFormAction($ilCtrl->getFormAction($this));
516 $confirm->setHeaderText($this->lng->txt("info_delete_sure"));
517 $confirm->setConfirm($this->lng->txt('delete'), 'deleteRole');
518 $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
519
520
521 include_once './Services/AccessControl/classes/class.ilObjRole.php';
522 foreach($_POST['roles'] as $role_id)
523 {
524 $confirm->addItem(
525 'roles[]',
526 $role_id,
528 );
529 }
530 $this->tpl->setContent($confirm->getHTML());
531 }
Confirmation screen class.
_getTranslation($a_role_title)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_POST, $ilCtrl, ilObjRole\_getTranslation(), ilObject\_lookupTitle(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ copyRoleObject()

ilObjRoleFolderGUI::copyRoleObject ( )
protected

Copy role.

Definition at line 305 of file class.ilObjRoleFolderGUI.php.

306 {
307 global $ilCtrl;
308
309 // Finally copy role/rolt
310 $roles = explode(',',$_POST['roles']);
311 $source = (int) $_REQUEST['copy_source'];
312
313 $form = $this->initCopyBehaviourForm();
314 if($form->checkInput())
315 {
316 foreach((array) $roles as $role_id)
317 {
318 if($role_id != $source)
319 {
320 $this->doCopyRole($source,$role_id,$form->getInput('change_existing'));
321 }
322 }
323
324 ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
325 $ilCtrl->redirect($this,'view');
326 }
327 }
doCopyRole($source, $target, $change_existing)
Perform copy of role @global ilTree $tree @global <type> $rbacadmin @global <type> $rbacreview.

References $_POST, $_REQUEST, $ilCtrl, doCopyRole(), initCopyBehaviourForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ createObject()

ilObjRoleFolderGUI::createObject ( )

role folders are created automatically DEPRECATED !!! @access public

Reimplemented from ilObjectGUI.

Definition at line 576 of file class.ilObjRoleFolderGUI.php.

577 {
578 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
579
580 /*
581 $this->object->setTitle($this->lng->txt("obj_".$this->object->getType()."_local"));
582 $this->object->setDescription("obj_".$this->object->getType()."_local_desc");
583
584 $this->saveObject();
585 */
586 }
redirection script todo: (a better solution should control the processing via a xml file)

◆ deleteObject()

ilObjRoleFolderGUI::deleteObject ( )

display deletion confirmation screen DEPRECATED !!! @access public

Definition at line 593 of file class.ilObjRoleFolderGUI.php.

594 {
595 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
596 }

◆ deleteRoleObject()

ilObjRoleFolderGUI::deleteRoleObject ( )
protected

Delete roles.

Definition at line 536 of file class.ilObjRoleFolderGUI.php.

537 {
538 global $rbacsystem,$ilErr,$rbacreview,$ilCtrl;
539
540 if(!$rbacsystem->checkAccess('delete',$this->object->getRefId()))
541 {
542 $ilErr->raiseError(
543 $this->lng->txt('msg_no_perm_delete'),
544 $ilErr->MESSAGE
545 );
546 }
547
548 foreach((array) $_POST['roles'] as $id)
549 {
550 // instatiate correct object class (role or rolt)
551 $obj = ilObjectFactory::getInstanceByObjId($id,false);
552
553 if ($obj->getType() == "role")
554 {
555 $rolf_arr = $rbacreview->getFoldersAssignedToRole($obj->getId(),true);
556 $obj->setParent($rolf_arr[0]);
557 }
558
559 $obj->delete();
560 }
561
562 // set correct return location if rolefolder is removed
563 ilUtil::sendSuccess($this->lng->txt("msg_deleted_roles_rolts"),true);
564 $ilCtrl->redirect($this,'view');
565 }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id

References $_POST, $ilCtrl, $ilErr, ilObjectFactory\getInstanceByObjId(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ doAddRolePermissions()

ilObjRoleFolderGUI::doAddRolePermissions (   $source,
  $target,
  $change_existing 
)
protected

do add role permission

Definition at line 359 of file class.ilObjRoleFolderGUI.php.

360 {
361 global $rbacadmin, $rbacreview;
362
363 $rbacadmin->copyRolePermissionUnion(
364 $source,
365 $this->object->getRefId(),
366 $target,
367 $rbacreview->getRoleFolderOfRole($target),
368 $target,
369 $rbacreview->getRoleFolderOfRole($target)
370 );
371 }

Referenced by addRolePermissionsObject().

+ Here is the caller graph for this function:

◆ doCopyRole()

ilObjRoleFolderGUI::doCopyRole (   $source,
  $target,
  $change_existing 
)
protected

Perform copy of role @global ilTree $tree @global <type> $rbacadmin @global <type> $rbacreview.

Parameters
<type>$source
<type>$target
<type>$change_existing
Returns
<type>

Definition at line 427 of file class.ilObjRoleFolderGUI.php.

428 {
429 global $tree, $rbacadmin, $rbacreview;
430
431 $target_obj = $rbacreview->getRoleFolderOfRole($target);
432
433 // Copy role template permissions
434 $rbacadmin->copyRoleTemplatePermissions(
435 $source,
436 $this->object->getRefId(),
437 $target_obj,
438 $target
439 );
440
441 if(!$change_existing || !$target_obj)
442 {
443 return true;
444 }
445
446 $start = $target_obj;
447
448 include_once './Services/AccessControl/classes/class.ilObjRole.php';
449 if($rbacreview->isProtected($this->object->getRefId(),$source))
450 {
452 }
453 else
454 {
456 }
457
458 if($start)
459 {
460 $role = new ilObjRole($target);
461 $role->changeExistingObjects(
462 $start,
463 $mode,
464 array('all')
465 );
466 }
467 }
Class ilObjRole.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES

References ilObjectGUI\$tree, ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, and ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES.

Referenced by copyRoleObject().

+ Here is the caller graph for this function:

◆ doRemoveRolePermissions()

ilObjRoleFolderGUI::doRemoveRolePermissions (   $source,
  $target,
  $change_existing 
)
protected

do add role permission

Definition at line 403 of file class.ilObjRoleFolderGUI.php.

404 {
405 global $rbacadmin, $rbacreview;
406
407 $rbacadmin->copyRolePermissionSubtract(
408 $source,
409 $this->object->getRefId(),
410 $target,
411 $rbacreview->getRoleFolderOfRole($target)
412 );
413 }

Referenced by removeRolePermissionsObject().

+ Here is the caller graph for this function:

◆ editSettingsObject()

ilObjRoleFolderGUI::editSettingsObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 730 of file class.ilObjRoleFolderGUI.php.

731 {
732 if(!$a_form)
733 {
734 $a_form = $this->initSettingsForm();
735 }
736
737 $this->tpl->setContent($a_form->getHTML());
738 }

References initSettingsForm().

Referenced by saveSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjRoleFolderGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 60 of file class.ilObjRoleFolderGUI.php.

61 {
62 global $ilTabs;
63
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
66 $this->prepareOutput();
67
68 switch($next_class)
69 {
70
71 case 'ilpermissiongui':
72 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
73 $perm_gui =& new ilPermissionGUI($this);
74 $ret =& $this->ctrl->forwardCommand($perm_gui);
75 break;
76
77 default:
78 if(!$cmd)
79 {
80 $cmd = "view";
81 }
82 $cmd .= "Object";
83 $this->$cmd();
84
85 break;
86 }
87 return true;
88 }
prepareOutput()
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjRoleFolderGUI::getAdminTabs ( $tabs_gui)

Add role folder tabs @global ilTree $tree @global ilLanguage $lng.

Parameters
ilTabsGUI$tabs_gui

Reimplemented from ilObjectGUI.

Definition at line 699 of file class.ilObjRoleFolderGUI.php.

700 {
701 global $tree,$lng;
702
703 if ($this->checkPermissionBool("visible,read"))
704 {
705 $tabs_gui->addTarget(
706 "view",
707 $this->ctrl->getLinkTarget($this, "view"),
708 array("", "view"),
709 get_class($this)
710 );
711
712 $tabs_gui->addTarget(
713 "settings",
714 $this->ctrl->getLinkTarget($this, "editSettings"),
715 array("editSettings"),
716 get_class($this)
717 );
718 }
719
720 if($this->checkPermissionBool("edit_permission"))
721 {
722 $tabs_gui->addTarget("perm_settings",
723 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'),
724 "perm"),
725 "",
726 "ilpermissiongui");
727 }
728 }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.

References ilObjectGUI\$lng, ilObjectGUI\$tree, and ilObjectGUI\checkPermissionBool().

+ Here is the call graph for this function:

◆ ilObjRoleFolderGUI()

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

Constructor @access public.

Definition at line 51 of file class.ilObjRoleFolderGUI.php.

52 {
53 global $lng;
54
55 $this->type = "rolf";
56 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference, false);
57 $lng->loadLanguageModule('rbac');
58 }
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

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

+ Here is the call graph for this function:

◆ initCopyBehaviourForm()

ilObjRoleFolderGUI::initCopyBehaviourForm ( )
protected

Show copy behaviour form.

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

263 {
264 global $ilCtrl;
265
266 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
267 $form = new ilPropertyFormGUI();
268 $form->setTitle($this->lng->txt('rbac_copy_behaviour'));
269 $form->setFormAction($ilCtrl->getFormAction($this,'chooseCopyBehaviour'));
270
271 $ce = new ilRadioGroupInputGUI($this->lng->txt('change_existing_objects'), 'change_existing');
272 $ce->setRequired(true);
273 $ce->setValue(1);
274 $form->addItem($ce);
275
276 $ceo = new ilRadioOption($this->lng->txt('change_existing_objects'),1);
277 $ce->addOption($ceo);
278
279 $cne = new ilRadioOption($this->lng->txt('rbac_not_change_existing_objects'), 0);
280 $ce->addOption($cne);
281
282 $roles = new ilHiddenInputGUI('roles');
283 $roles->setValue(implode(',',(array) $_POST['roles']));
284 $form->addItem($roles);
285
286
287 // if source is role template show option add permission, remove permissions and copy permissions
288 if(ilObject::_lookupType((int) $_REQUEST['copy_source']) == 'rolt')
289 {
290 $form->addCommandButton('addRolePermissions', $this->lng->txt('rbac_copy_role_add_perm'));
291 $form->addCommandButton('removeRolePermissions', $this->lng->txt('rbac_copy_role_remove_perm'));
292 $form->addCommandButton('copyRole', $this->lng->txt('rbac_copy_role_copy'));
293 }
294 else
295 {
296 $form->addCommandButton('copyRole', $this->lng->txt('rbac_copy_role'));
297 }
298 return $form;
299 }
This class represents a hidden form property in a property form.
static _lookupType($a_id, $a_reference=false)
lookup object type
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

References $_POST, $_REQUEST, $ilCtrl, and ilObject\_lookupType().

Referenced by addRolePermissionsObject(), chooseCopyBehaviourObject(), copyRoleObject(), and removeRolePermissionsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRoleSearchForm()

ilObjRoleFolderGUI::initRoleSearchForm ( )
protected

Init role search form.

Definition at line 161 of file class.ilObjRoleFolderGUI.php.

162 {
163 global $ilCtrl;
164
165 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
166 $form = new ilPropertyFormGUI();
167 $form->setTitle($this->lng->txt('rbac_role_title'));
168 $form->setFormAction($ilCtrl->getFormAction($this,'view'));
169
170 $search = new ilTextInputGUI($this->lng->txt('title'), 'title');
171 $search->setRequired(true);
172 $search->setSize(30);
173 $search->setMaxLength(255);
174 $form->addItem($search);
175
176 $form->addCommandButton('roleSearchForm', $this->lng->txt('search'));
177 return $form;
178 }
This class represents a text property in a property form.

References $ilCtrl.

Referenced by roleSearchFormObject(), and roleSearchObject().

+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjRoleFolderGUI::initSettingsForm ( )
protected

Definition at line 774 of file class.ilObjRoleFolderGUI.php.

775 {
776 global $rbacreview, $ilUser;
777
778 $this->lng->loadLanguageModule('ps');
779
780 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
781 include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
784
785 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
786 $form = new ilPropertyFormGUI();
787 $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings"));
788 $form->setTitle($this->lng->txt('settings'));
789
790 // protected admin
791 $admin = new ilCheckboxInputGUI($GLOBALS['lng']->txt('adm_adm_role_protect'),'admin_role');
792 $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID));
793 $admin->setInfo($this->lng->txt('adm_adm_role_protect_info'));
794 $admin->setChecked((int) $security->isAdminRoleProtected());
795 $admin->setValue(1);
796 $form->addItem($admin);
797
798 $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
799 $check->setInfo($this->lng->txt('rbac_log_info'));
800 $check->setChecked($privacy->enabledRbacLog());
801 $form->addItem($check);
802
803 $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'),'rbac_log_age');
804 $age->setInfo($this->lng->txt('rbac_log_age_info'));
805 $age->setValue($privacy->getRbacLogAge());
806 $age->setMinValue(1);
807 $age->setMaxValue(24);
808 $age->setSize(2);
809 $age->setMaxLength(2);
810 $check->addSubItem($age);
811
812 $form->addCommandButton('saveSettings',$this->lng->txt('save'));
813
814 return $form;
815 }
This class represents a checkbox property in a property form.
This class represents a number property in a property form.
global $ilUser
Definition: imgupload.php:15

References $GLOBALS, $ilUser, ilPrivacySettings\_getInstance(), and ilSecuritySettings\_getInstance().

Referenced by editSettingsObject(), and saveSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeRolePermissionsObject()

ilObjRoleFolderGUI::removeRolePermissionsObject ( )
protected

Remove role permissions.

Definition at line 376 of file class.ilObjRoleFolderGUI.php.

377 {
378 global $ilCtrl;
379
380 // Finally copy role/rolt
381 $roles = explode(',',$_POST['roles']);
382 $source = (int) $_REQUEST['copy_source'];
383
384 $form = $this->initCopyBehaviourForm();
385 if($form->checkInput())
386 {
387 foreach((array) $roles as $role_id)
388 {
389 if($role_id != $source)
390 {
391 $this->doRemoveRolePermissions($source,$role_id,$form->getInput('change_existing'));
392 }
393 }
394
395 ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'),true);
396 $ilCtrl->redirect($this,'view');
397 }
398 }
doRemoveRolePermissions($source, $target, $change_existing)
do add role permission

References $_POST, $_REQUEST, $ilCtrl, doRemoveRolePermissions(), initCopyBehaviourForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjRoleFolderGUI::resetFilterObject ( )

Reset role filter.

Definition at line 486 of file class.ilObjRoleFolderGUI.php.

487 {
488 include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
489 $table = new ilRoleTableGUI($this,'view');
490 $table->init();
491 $table->resetOffset();
492 $table->resetFilter();
493
494 $this->viewObject();
495 }

References viewObject().

+ Here is the call graph for this function:

◆ roleSearchFormObject()

ilObjRoleFolderGUI::roleSearchFormObject ( )
protected

Parse search query @global type $ilCtrl.

Returns
type

Definition at line 186 of file class.ilObjRoleFolderGUI.php.

187 {
188 global $ilCtrl;
189
190 $_SESSION['rolf_search_query'] = '';
191 $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
192
193 $form = $this->initRoleSearchForm();
194 if($form->checkInput())
195 {
196 $_SESSION['rolf_search_query'] = $form->getInput('title');
197 return $this->roleSearchListObject();
198 }
199
200 ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
201 $form->setValuesByPost();
202 $ilCtrl->redirect($this,'roleSearch');
203 }
initRoleSearchForm()
Init role search form.
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

References $_REQUEST, $_SESSION, $ilCtrl, initRoleSearchForm(), roleSearchListObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ roleSearchListObject()

ilObjRoleFolderGUI::roleSearchListObject ( )
protected

List roles.

Definition at line 208 of file class.ilObjRoleFolderGUI.php.

209 {
210 global $ilTabs, $ilCtrl;
211
212 $ilTabs->clearTargets();
213 $ilTabs->setBackTarget(
214 $this->lng->txt('rbac_back_to_overview'),
215 $this->ctrl->getLinkTarget($this,'roleSearchList')
216 );
217
218 $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
219
220 if(strlen($_SESSION['rolf_search_query']))
221 {
222 ilUtil::sendInfo($this->lng->txt('rbac_select_copy_targets'));
223
224 include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
225 $table = new ilRoleTableGUI($this,'roleSearchList');
226 $table->setType(ilRoleTableGUI::TYPE_SEARCH);
227 $table->setRoleTitleFilter($_SESSION['rolf_search_query']);
228 $table->init();
229 $table->parse($this->object->getId());
230 return $this->tpl->setContent($table->getHTML());
231 }
232
233 ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
234 $ilCtrl->redirect($this,'roleSearch');
235 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_REQUEST, $_SESSION, $ilCtrl, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilRoleTableGUI\TYPE_SEARCH.

Referenced by roleSearchFormObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roleSearchObject()

ilObjRoleFolderGUI::roleSearchObject ( )
protected

Search target roles.

Definition at line 136 of file class.ilObjRoleFolderGUI.php.

137 {
138 global $rbacsystem, $ilCtrl, $ilTabs;
139
140 $ilTabs->clearTargets();
141 $ilTabs->setBackTarget(
142 $this->lng->txt('rbac_back_to_overview'),
143 $this->ctrl->getLinkTarget($this,'view')
144 );
145
146 if(!$rbacsystem->checkAccess('visible,read',$this->object->getRefId()))
147 {
148 $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
149 }
150
151 $ilCtrl->setParameter($this,'copy_source',(int) $_REQUEST['copy_source']);
152 ilUtil::sendInfo($this->lng->txt('rbac_choose_copy_targets'));
153
154 $form = $this->initRoleSearchForm();
155 $this->tpl->setContent($form->getHTML());
156 }

References $_REQUEST, $ilCtrl, $ilErr, initRoleSearchForm(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveObject()

ilObjRoleFolderGUI::saveObject ( )

save object @access public

Reimplemented from ilObjectGUI.

Definition at line 673 of file class.ilObjRoleFolderGUI.php.

674 {
675 global $rbacadmin;
676
677 // role folders are created automatically
678 $_GET["new_type"] = $this->object->getType();
679 $_POST["Fobject"]["title"] = $this->object->getTitle();
680 $_POST["Fobject"]["desc"] = $this->object->getDescription();
681
682 // always call parent method first to create an object_data entry & a reference
683 $newObj = parent::saveObject();
684
685 // put here your object specific stuff
686
687 // always send a message
688 ilUtil::sendSuccess($this->lng->txt("rolf_added"),true);
689
690 $this->ctrl->redirect($this, "view");
691 }
$_GET["client_id"]

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

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjRoleFolderGUI::saveSettingsObject ( )

Definition at line 740 of file class.ilObjRoleFolderGUI.php.

741 {
742 global $ilErr, $rbacreview, $ilUser;
743
744 if (!$this->checkPermissionBool("write"))
745 {
746 $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
747 }
748
749 $form = $this->initSettingsForm();
750 if($form->checkInput())
751 {
752 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
754 $privacy->enableRbacLog((int) $_POST['rbac_log']);
755 $privacy->setRbacLogAge((int) $_POST['rbac_log_age']);
756 $privacy->save();
757
758 if($rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
759 {
760 include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
762 $security->protectedAdminRole((int) $_POST['admin_role']);
763 $security->save();
764 }
765
766 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
767 $this->ctrl->redirect($this, "editSettings");
768 }
769
770 $form->setValuesByPost();
771 $this->editSettingsObject($form);
772 }
editSettingsObject(ilPropertyFormGUI $a_form=null)

References $_POST, $ilErr, $ilUser, ilPrivacySettings\_getInstance(), ilSecuritySettings\_getInstance(), ilObjectGUI\checkPermissionBool(), editSettingsObject(), initSettingsForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ showPossibleSubObjects()

ilObjRoleFolderGUI::showPossibleSubObjects (   $a_tpl)

show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders

@access public

Definition at line 616 of file class.ilObjRoleFolderGUI.php.

617 {
618 global $rbacsystem;
619
620 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
621
622 if ($this->object->getRefId() != ROLE_FOLDER_ID or !$rbacsystem->checkAccess('create_rolt',ROLE_FOLDER_ID))
623 {
624 unset($d["rolt"]);
625 }
626
627 if (!$rbacsystem->checkAccess('create_role',$this->object->getRefId()))
628 {
629 unset($d["role"]);
630 }
631
632 if (count($d) > 0)
633 {
634 foreach ($d as $row)
635 {
636 $count = 0;
637 if ($row["max"] > 0)
638 {
639 //how many elements are present?
640 for ($i=0; $i<count($this->data["ctrl"]); $i++)
641 {
642 if ($this->data["ctrl"][$i]["type"] == $row["name"])
643 {
644 $count++;
645 }
646 }
647 }
648 if ($row["max"] == "" || $count < $row["max"])
649 {
650 $subobj[] = $row["name"];
651 }
652 }
653 }
654
655 if (is_array($subobj))
656 {
657 //build form
658 $opts = ilUtil::formSelect(12,"new_type",$subobj);
659 $a_tpl->setCurrentBlock("add_object");
660 $a_tpl->setVariable("SELECT_OBJTYPE", $opts);
661 $a_tpl->setVariable("BTN_NAME", "create");
662 $a_tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
663 $a_tpl->parseCurrentBlock();
664 }
665
666 return $a_tpl;
667 }
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.

References $d, $row, and ilUtil\formSelect().

+ Here is the call graph for this function:

◆ viewObject()

ilObjRoleFolderGUI::viewObject ( )

@global ilErrorHandler $ilErr @global ilRbacSystem $rbacsystem @global ilToolbarGUI $ilToolbar

Reimplemented from ilObjectGUI.

Definition at line 96 of file class.ilObjRoleFolderGUI.php.

97 {
98 global $ilErr, $rbacsystem, $ilToolbar,$rbacreview,$ilTabs;
99
100 $ilTabs->activateTab('view');
101
102 if(!$rbacsystem->checkAccess('visible,read',$this->object->getRefId()))
103 {
104 $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
105 }
106
107 $this->ctrl->setParameter($this,'new_type','role');
108 $ilToolbar->addButton(
109 $this->lng->txt('rolf_create_role'),
110 $this->ctrl->getLinkTarget($this,'create')
111 );
112
113 $this->ctrl->setParameter($this,'new_type','rolt');
114 $ilToolbar->addButton(
115 $this->lng->txt('rolf_create_rolt'),
116 $this->ctrl->getLinkTarget($this,'create')
117 );
118 $this->ctrl->clearParameters($this);
119
120 $ilToolbar->addButton(
121 $this->lng->txt('rbac_import_role'),
122 $this->ctrl->getLinkTargetByClass('ilPermissionGUI','displayImportRoleForm')
123 );
124
125 include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
126 $table = new ilRoleTableGUI($this,'view');
127 $table->init();
128 $table->parse($this->object->getId());
129
130 $this->tpl->setContent($table->getHTML());
131 }

References $ilErr.

Referenced by applyFilterObject(), and resetFilterObject().

+ Here is the caller graph for this function:

Field Documentation

◆ $type

ilObjRoleFolderGUI::$type

Definition at line 45 of file class.ilObjRoleFolderGUI.php.


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