ILIAS  release_8 Revision v8.24
ilObjRoleFolderGUI Class Reference

Class ilObjRoleFolderGUI. More...

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

Public Member Functions

 __construct ($a_data, int $a_id, bool $a_call_by_reference)
 Constructor @access public. More...
 
 executeCommand ()
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 resetFilterObject ()
 Reset role filter. More...
 
 getAdminTabs ()
 Add role folder tabs. More...
 
 editSettingsObject (ilPropertyFormGUI $a_form=null)
 
 saveSettingsObject ()
 
 addToExternalSettingsForm (int $a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 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 ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 initCopySourceFromGET ()
 
 initRolesFromPOST ()
 
 roleSearchObject ()
 Search target roles. More...
 
 initRoleSearchForm ()
 Init role search form. More...
 
 roleSearchFormObject ()
 Parse search query. More...
 
 roleSearchListObject ()
 List roles. More...
 
 chooseCopyBehaviourObject (?ilPropertyFormGUI $form=null)
 Choose option for copying roles/role templates. More...
 
 initCopyBehaviourForm ()
 Show copy behaviour form. More...
 
 adjustRoleObject ()
 Copy role. More...
 
 doAddRolePermissions (int $source, int $target)
 do add role permission More...
 
 removeRolePermissionsObject ()
 Remove role permissions. More...
 
 doRemoveRolePermissions (int $source, int $target)
 do add role permission More...
 
 doCopyRole (int $source, int $target)
 Perform copy of role. More...
 
 doChangeExistingObjects (int $a_start_obj, int $a_target_role, int $a_operation_mode, int $a_source_role)
 Do change existing objects. More...
 
 applyFilterObject ()
 Apply role filter. More...
 
 confirmDeleteObject ()
 Confirm deletion of roles. More...
 
 deleteRoleObject ()
 Delete roles. More...
 
 initSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $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...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ilRbacAdmin $rbacadmin
 
GlobalHttpState $http
 
Factory $refinery
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Attributes

const COPY_ADD_PERMISSIONS = 1
 
const COPY_CLONE_PERMISSIONS = 2
 
const COPY_REMOVE_PERMISSIONS = 3
 
const COPY_CHANGE_EXISTING_OBJECTS = 1
 
ilLogger $logger
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjRoleFolderGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference 
)

Constructor @access public.

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

49 {
50 global $DIC;
51
52 $this->logger = $DIC->logger()->ac();
53 $this->rbacadmin = $DIC->rbac()->admin();
54 $this->http = $DIC->http();
55 $this->refinery = $DIC->refinery();
56 $this->type = "rolf";
57 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
58 $this->lng->loadLanguageModule('rbac');
59 }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjRoleFolderGUI::addToExternalSettingsForm ( int  $a_form_id)

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

765 : array
766 {
767 switch ($a_form_id) {
769
771
772 $fields = array('adm_adm_role_protect' => array($security->isAdminRoleProtected(),
774 )
775 );
776
777 return array(array("editSettings", $fields));
778
780
782
783 $subitems = null;
784 if ($privacy->enabledRbacLog()) {
785 $subitems = array('rbac_log_age' => $privacy->getRbacLogAge());
786 }
787 $fields = array('rbac_log' => array($privacy->enabledRbacLog(),
789 $subitems
790 )
791 );
792
793 return array(array("editSettings", $fields));
794 }
795 return [];
796 }
static _getInstance()
Get instance of ilSecuritySettings.

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

+ Here is the call graph for this function:

◆ adjustRoleObject()

ilObjRoleFolderGUI::adjustRoleObject ( )
protected

Copy role.

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

385 : void
386 {
387 $this->checkPermission('write');
388
389 $roles = $this->initRolesFromPOST();
391
392 $form = $this->initCopyBehaviourForm();
393 if ($form->checkInput()) {
394 $adjustment_type = $form->getInput('type');
395 foreach ((array) $roles as $role_id) {
396 if ($role_id !== $source) {
397 $start_obj = $this->rbac_review->getRoleFolderOfRole($role_id);
398 $this->logger->debug('Start object: ' . $start_obj);
399
400 switch ($adjustment_type) {
402 $change_existing = (bool) $form->getInput('add_ce_type');
404 $source,
405 $role_id
406 );
407 if ($change_existing) {
409 $start_obj,
410 $role_id,
412 $source
413 );
414 }
415 break;
417 $change_existing = (bool) $form->getInput('clone_ce_type');
418 $this->doCopyRole(
419 $source,
420 $role_id
421 );
422 if ($change_existing) {
424 $start_obj,
425 $role_id,
427 $source
428 );
429 }
430 break;
432 $change_existing = (bool) $form->getInput('remove_ce_type');
434 $source,
435 $role_id
436 );
437 if ($change_existing) {
439 $start_obj,
440 $role_id,
442 $source
443 );
444 }
445 break;
446 }
447 }
448 }
449 $this->tpl->setOnScreenMessage('success', $this->lng->txt('rbac_copy_finished'), true);
450 $this->ctrl->redirect($this, 'view');
451 }
452 }
initCopyBehaviourForm()
Show copy behaviour form.
doAddRolePermissions(int $source, int $target)
do add role permission
doCopyRole(int $source, int $target)
Perform copy of role.
doRemoveRolePermissions(int $source, int $target)
do add role permission
doChangeExistingObjects(int $a_start_obj, int $a_target_role, int $a_operation_mode, int $a_source_role)
Do change existing objects.
const MODE_REMOVE_OPERATIONS
const MODE_ADD_OPERATIONS
const MODE_READ_OPERATIONS
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
$source
Definition: metadata.php:93

References $source, ilObjectGUI\checkPermission(), COPY_ADD_PERMISSIONS, COPY_CLONE_PERMISSIONS, COPY_REMOVE_PERMISSIONS, ILIAS\Repository\ctrl(), doAddRolePermissions(), doChangeExistingObjects(), doCopyRole(), doRemoveRolePermissions(), initCopyBehaviourForm(), initCopySourceFromGET(), initRolesFromPOST(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilObjRole\MODE_ADD_OPERATIONS, ilObjRole\MODE_READ_OPERATIONS, and ilObjRole\MODE_REMOVE_OPERATIONS.

+ Here is the call graph for this function:

◆ applyFilterObject()

ilObjRoleFolderGUI::applyFilterObject ( )
protected

Apply role filter.

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

565 : void
566 {
567 $table = new ilRoleTableGUI($this, 'view');
568 $table->init();
569 $table->resetOffset();
570 $table->writeFilterToSession();
571
572 $this->viewObject();
573 }
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"
TableGUI for the presentation og roles and role templates.

◆ chooseCopyBehaviourObject()

ilObjRoleFolderGUI::chooseCopyBehaviourObject ( ?ilPropertyFormGUI  $form = null)
protected

Choose option for copying roles/role templates.

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

256 : void
257 {
258 $this->initCopySourceFromGET();
259
260 $this->ctrl->saveParameter($this, 'csource');
261 $this->tabs_gui->clearTargets();
262 $this->tabs_gui->setBackTarget(
263 $this->lng->txt('rbac_back_to_overview'),
264 $this->ctrl->getLinkTarget($this, 'view')
265 );
266 if (!$form instanceof \ilPropertyFormGUI) {
267 $form = $this->initCopyBehaviourForm();
268 }
269 $this->tpl->setContent($form->getHTML());
270 }
This class represents a property form user interface.

References ILIAS\Repository\ctrl(), initCopyBehaviourForm(), initCopySourceFromGET(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmDeleteObject()

ilObjRoleFolderGUI::confirmDeleteObject ( )
protected

Confirm deletion of roles.

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

591 : void
592 {
593 $roles = $this->initRolesFromPOST();
594 if ($roles === []) {
595 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
596 $this->ctrl->redirect($this, 'view');
597 }
598
599 $question = $this->lng->txt('rbac_role_delete_qst');
600
601 $confirm = new ilConfirmationGUI();
602 $confirm->setHeaderText($question);
603 $confirm->setFormAction($this->ctrl->getFormAction($this));
604 $confirm->setHeaderText($this->lng->txt("info_delete_sure"));
605 $confirm->setConfirm($this->lng->txt('delete'), 'deleteRole');
606 $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
607
608 foreach ($roles as $role_id) {
609 $confirm->addItem(
610 'roles[]',
611 (string) $role_id,
613 );
614 }
615 $this->tpl->setContent($confirm->getHTML());
616 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getTranslation(string $a_role_title)
static _lookupTitle(int $obj_id)

References ilObjRole\_getTranslation(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ deleteRoleObject()

ilObjRoleFolderGUI::deleteRoleObject ( )
protected

Delete roles.

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

621 : void
622 {
623 if (!$this->rbac_system->checkAccess('delete', $this->object->getRefId())) {
624 $this->error->raiseError(
625 $this->lng->txt('msg_no_perm_delete'),
626 $this->error->MESSAGE
627 );
628 }
629
630 foreach ($this->initRolesFromPOST() as $id) {
631 // instatiate correct object class (role or rolt)
633
634 if ($obj->getType() == "role") {
635 $rolf_arr = $this->rbac_review->getFoldersAssignedToRole($obj->getId(), true);
636 $obj->setParent($rolf_arr[0]);
637 }
638
639 $obj->delete();
640 }
641
642 // set correct return location if rolefolder is removed
643 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_deleted_roles_rolts"), true);
644 $this->ctrl->redirect($this, 'view');
645 }
error(string $a_errmsg)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id

References $id, ILIAS\Repository\ctrl(), error(), ilObjectFactory\getInstanceByObjId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ doAddRolePermissions()

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

do add role permission

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

457 : void
458 {
459 $source_definition = $this->rbac_review->getRoleFolderOfRole($source);
460 $this->rbacadmin->copyRolePermissionUnion(
461 $source,
462 $source_definition,
463 $target,
464 $this->rbac_review->getRoleFolderOfRole($target),
465 $target,
466 $this->rbac_review->getRoleFolderOfRole($target)
467 );
468 }

References $source.

Referenced by adjustRoleObject().

+ Here is the caller graph for this function:

◆ doChangeExistingObjects()

ilObjRoleFolderGUI::doChangeExistingObjects ( int  $a_start_obj,
int  $a_target_role,
int  $a_operation_mode,
int  $a_source_role 
)
protected

Do change existing objects.

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

531 : void {
532 if (!$a_start_obj) {
533 $this->logger->warning('Missing parameter start object.');
534 $this->logger->logStack(\ilLogLevel::WARNING);
535 throw new InvalidArgumentException('Missing parameter: start object');
536 }
537 // the mode is unchanged and read out from the target object
538 $target_ref_id = $this->rbac_review->getRoleFolderOfRole($a_target_role);
539 if ($this->rbac_review->isProtected($target_ref_id, $a_target_role)) {
541 } else {
543 }
544 $operation_stack = [];
545 if ($a_operation_mode !== \ilObjRole::MODE_READ_OPERATIONS) {
546 $operation_stack[] = $this->rbac_review->getAllOperationsOfRole($a_source_role, $this->ref_id);
547 }
548 $this->logger->debug('Current operation stack');
549 $this->logger->dump($operation_stack, ilLogLevel::DEBUG);
550
551 $role = new ilObjRole($a_target_role);
552 $role->changeExistingObjects(
553 $a_start_obj,
554 $mode,
555 array('all'),
556 [],
557 $a_operation_mode,
558 $operation_stack
559 );
560 }
Class ilObjRole.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
const MODE_PROTECTED_KEEP_LOCAL_POLICIES

References ILIAS\Repository\logger(), and ilLogLevel\WARNING.

Referenced by adjustRoleObject().

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

◆ doCopyRole()

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

Perform copy of role.

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

510 : void
511 {
512 $target_obj = $this->rbac_review->getRoleFolderOfRole($target);
513 $source_obj = $this->rbac_review->getRoleFolderOfRole($source);
514 // Copy role template permissions
515 $this->rbacadmin->copyRoleTemplatePermissions(
516 $source,
517 $source_obj,
518 $target_obj,
519 $target
520 );
521 }

References $source.

Referenced by adjustRoleObject().

+ Here is the caller graph for this function:

◆ doRemoveRolePermissions()

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

do add role permission

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

494 : void
495 {
496 $this->logger->debug('Remove permission source: ' . $source);
497 $this->logger->debug('Remove permission target: ' . $target);
498 $source_obj = $this->rbac_review->getRoleFolderOfRole($source);
499 $this->rbacadmin->copyRolePermissionSubtract(
500 $source,
501 $source_obj,
502 $target,
503 $this->rbac_review->getRoleFolderOfRole($target)
504 );
505 }

References $source, and ILIAS\Repository\logger().

Referenced by adjustRoleObject(), and removeRolePermissionsObject().

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

◆ editSettingsObject()

ilObjRoleFolderGUI::editSettingsObject ( ilPropertyFormGUI  $a_form = null)

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

684 : void
685 {
686 if ($a_form === null) {
687 $a_form = $this->initSettingsForm();
688 }
689
690 $this->tpl->setContent($a_form->getHTML());
691 }

◆ executeCommand()

ilObjRoleFolderGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

61 : void
62 {
63 $next_class = $this->ctrl->getNextClass($this);
64 $cmd = $this->ctrl->getCmd();
65 $this->prepareOutput();
66
67 switch ($next_class) {
68
69 case 'ilpermissiongui':
70 $perm_gui = new ilPermissionGUI($this);
71 $ret = $this->ctrl->forwardCommand($perm_gui);
72 break;
73
74 default:
75 $this->ctrl->setReturn($this, "view");
76 if (!$cmd) {
77 $cmd = "view";
78 }
79 $cmd .= "Object";
80 $this->$cmd();
81
82 break;
83 }
84 }
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References ILIAS\Repository\ctrl(), and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjRoleFolderGUI::getAdminTabs ( )

Add role folder tabs.

Parameters
ilTabsGUI$tabs_gui@global ilLanguage $lng @global ilTree $tree

Reimplemented from ilObjectGUI.

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

653 : void
654 {
655 if ($this->checkPermissionBool("visible,read")) {
656 $this->tabs_gui->addTarget(
657 "view",
658 $this->ctrl->getLinkTarget($this, "view"),
659 array("", "view"),
660 get_class($this)
661 );
662
663 $this->tabs_gui->addTarget(
664 "settings",
665 $this->ctrl->getLinkTarget($this, "editSettings"),
666 array("editSettings"),
667 get_class($this)
668 );
669 }
670
671 if ($this->checkPermissionBool("edit_permission")) {
672 $this->tabs_gui->addTarget(
673 "perm_settings",
674 $this->ctrl->getLinkTargetByClass(
675 array(get_class($this), 'ilpermissiongui'),
676 "perm"
677 ),
678 "",
679 "ilpermissiongui"
680 );
681 }
682 }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initCopyBehaviourForm()

ilObjRoleFolderGUI::initCopyBehaviourForm ( )
protected

Show copy behaviour form.

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

276 {
277 // not only for role templates; add/remove permissions is also applicable for roles
278 $full_featured = true;
279
280 $form = new ilPropertyFormGUI();
281 $form->setTitle($this->lng->txt('rbac_copy_behaviour'));
282 $form->setFormAction($this->ctrl->getFormAction($this, 'chooseCopyBehaviour'));
283
284 $copy_type = new \ilRadioGroupInputGUI(
285 $this->lng->txt('rbac_form_copy_roles_adjust_type'),
286 'type'
287 );
288 $copy_type->setRequired(true);
289 $copy_type->setValue((string) self::COPY_CLONE_PERMISSIONS);
290
291 if ($full_featured) {
292 $add = new \ilRadioOption(
293 $this->lng->txt('rbac_form_copy_roles_adjust_type_add'),
294 (string) self::COPY_ADD_PERMISSIONS,
295 $this->lng->txt('rbac_form_copy_roles_adjust_type_add_info')
296 );
297 $copy_type->addOption($add);
298
299 $ce_type_add = new \ilRadioGroupInputGUI(
300 '',
301 'add_ce_type'
302 );
303 $ce_type_add->setRequired(true);
304 $ce_add_yes = new \ilRadioOption(
305 $this->lng->txt('rbac_form_copy_roles_ce_add_yes'),
306 (string) self::COPY_CHANGE_EXISTING_OBJECTS,
307 $this->lng->txt('rbac_form_copy_roles_ce_add_yes_info')
308 );
309 $ce_type_add->addOption($ce_add_yes);
310 $ce_add_no = new \ilRadioOption(
311 $this->lng->txt('rbac_form_copy_roles_ce_add_no'),
312 (string) 0,
313 $this->lng->txt('rbac_form_copy_roles_ce_add_no_info')
314 );
315 $ce_type_add->addOption($ce_add_no);
316 $add->addSubItem($ce_type_add);
317 }
318 $clone = new \ilRadioOption(
319 $this->lng->txt('rbac_form_copy_roles_adjust_type_clone'),
320 (string) self::COPY_CLONE_PERMISSIONS,
321 $this->lng->txt('rbac_form_copy_roles_adjust_type_clone_info')
322 );
323 $copy_type->addOption($clone);
324
325 $ce_type_clone = new \ilRadioGroupInputGUI(
326 '',
327 'clone_ce_type'
328 );
329 $ce_type_clone->setRequired(true);
330 $ce_clone_yes = new \ilRadioOption(
331 $this->lng->txt('rbac_form_copy_roles_ce_clone_yes'),
332 (string) self::COPY_CHANGE_EXISTING_OBJECTS,
333 $this->lng->txt('rbac_form_copy_roles_ce_clone_yes_info')
334 );
335 $ce_type_clone->addOption($ce_clone_yes);
336 $ce_clone_no = new \ilRadioOption(
337 $this->lng->txt('rbac_form_copy_roles_ce_clone_no'),
338 (string) 0,
339 $this->lng->txt('rbac_form_copy_roles_ce_clone_no_info')
340 );
341 $ce_type_clone->addOption($ce_clone_no);
342 $clone->addSubItem($ce_type_clone);
343
344 if ($full_featured) {
345 $remove = new \ilRadioOption(
346 $this->lng->txt('rbac_form_copy_roles_adjust_type_remove'),
347 (string) self::COPY_REMOVE_PERMISSIONS,
348 $this->lng->txt('rbac_form_copy_roles_adjust_type_remove_info')
349 );
350 $copy_type->addOption($remove);
351 $ce_type_remove = new \ilRadioGroupInputGUI(
352 '',
353 'remove_ce_type'
354 );
355 $ce_type_remove->setRequired(true);
356 $ce_remove_yes = new \ilRadioOption(
357 $this->lng->txt('rbac_form_copy_roles_ce_remove_yes'),
358 (string) self::COPY_CHANGE_EXISTING_OBJECTS,
359 $this->lng->txt('rbac_form_copy_roles_ce_remove_yes_info')
360 );
361 $ce_type_remove->addOption($ce_remove_yes);
362 $ce_remove_no = new \ilRadioOption(
363 $this->lng->txt('rbac_form_copy_roles_ce_remove_no'),
364 (string) 0,
365 $this->lng->txt('rbac_form_copy_roles_ce_remove_no_info')
366 );
367 $ce_type_remove->addOption($ce_remove_no);
368 $remove->addSubItem($ce_type_remove);
369 }
370
371 $form->addItem($copy_type);
372
373 $roles = new ilHiddenInputGUI('roles');
374 $roles->setValue(implode(',', $this->initRolesFromPOST()));
375 $form->addItem($roles);
376
377 $form->addCommandButton('roleSearchList', $this->lng->txt('back'));
378 $form->addCommandButton('adjustRole', $this->lng->txt('rbac_form_copy_roles_adjust_button'));
379 return $form;
380 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), initRolesFromPOST(), and ILIAS\Repository\lng().

Referenced by adjustRoleObject(), chooseCopyBehaviourObject(), and removeRolePermissionsObject().

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

◆ initCopySourceFromGET()

ilObjRoleFolderGUI::initCopySourceFromGET ( )
protected

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

86 : int
87 {
88 if ($this->http->wrapper()->query()->has('csource')) {
89 return $this->http->wrapper()->query()->retrieve(
90 'csource',
91 $this->refinery->kindlyTo()->int()
92 );
93 }
94 return 0;
95 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by adjustRoleObject(), chooseCopyBehaviourObject(), removeRolePermissionsObject(), roleSearchFormObject(), roleSearchListObject(), and roleSearchObject().

+ 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 189 of file class.ilObjRoleFolderGUI.php.

190 {
191 $form = new ilPropertyFormGUI();
192 $form->setTitle($this->lng->txt('rbac_role_title'));
193 $form->setFormAction($this->ctrl->getFormAction($this, 'view'));
194
195 $search = new ilTextInputGUI($this->lng->txt('title'), 'title');
196 $search->setRequired(true);
197 $search->setSize(30);
198 $search->setMaxLength(255);
199 $form->addItem($search);
200
201 $form->addCommandButton('roleSearchForm', $this->lng->txt('search'));
202 return $form;
203 }
This class represents a text property in a property form.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by roleSearchFormObject(), and roleSearchObject().

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

◆ initRolesFromPOST()

ilObjRoleFolderGUI::initRolesFromPOST ( )
protected
Returns
int[]

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

100 : array
101 {
102 if ($this->http->wrapper()->post()->has('roles')) {
103 return $this->http->wrapper()->post()->retrieve(
104 'roles',
105 $this->refinery->byTrying([
106 $this->refinery->kindlyTo()->listOf(
107 $this->refinery->kindlyTo()->int()
108 ),
109 $this->refinery->in()->series([
110 $this->refinery->custom()->transformation(function ($v) {
111 return explode(',', $v);
112 }),
113 $this->refinery->kindlyTo()->listOf(
114 $this->refinery->kindlyTo()->int()
115 )
116 ])
117 ])
118 );
119 }
120 return [];
121 }
static return function(ContainerConfigurator $containerConfigurator)
Definition: basic_rector.php:9

References function, ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by adjustRoleObject(), initCopyBehaviourForm(), and removeRolePermissionsObject().

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

◆ initSettingsForm()

ilObjRoleFolderGUI::initSettingsForm ( )
protected

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

724 {
725 global $DIC;
726
727 $user = $DIC->user();
728
729 $this->lng->loadLanguageModule('ps');
730
733
734 $form = new ilPropertyFormGUI();
735 $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings"));
736 $form->setTitle($this->lng->txt('settings'));
737
738 // protected admin
739 $admin = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('adm_adm_role_protect'), 'admin_role');
740 $admin->setDisabled(!$this->rbac_review->isAssigned($user->getId(), SYSTEM_ROLE_ID));
741 $admin->setInfo($this->lng->txt('adm_adm_role_protect_info'));
742 $admin->setChecked($security->isAdminRoleProtected());
743 $admin->setValue((string) 1);
744 $form->addItem($admin);
745
746 $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
747 $check->setInfo($this->lng->txt('rbac_log_info'));
748 $check->setChecked($privacy->enabledRbacLog());
749 $form->addItem($check);
750
751 $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'), 'rbac_log_age');
752 $age->setInfo($this->lng->txt('rbac_log_age_info'));
753 $age->setValue((string) $privacy->getRbacLogAge());
754 $age->setMinValue(1);
755 $age->setMaxValue(24);
756 $age->setSize(2);
757 $age->setMaxLength(2);
758 $check->addSubItem($age);
759
760 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
761
762 return $form;
763 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$check
Definition: buildRTE.php:81
This class represents a checkbox property in a property form.
This class represents a number property in a property form.
const SYSTEM_ROLE_ID
Definition: constants.php:29

References $check, $DIC, $GLOBALS, ilSecuritySettings\_getInstance(), ILIAS\Repository\ctrl(), ilPrivacySettings\getInstance(), ILIAS\Repository\lng(), and SYSTEM_ROLE_ID.

+ Here is the call graph for this function:

◆ removeRolePermissionsObject()

ilObjRoleFolderGUI::removeRolePermissionsObject ( )
protected

Remove role permissions.

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

473 : void
474 {
475 // Finally copy role/rolt
476 $roles = $this->initRolesFromPOST();
478
479 $form = $this->initCopyBehaviourForm();
480 if ($form->checkInput()) {
481 foreach ((array) $roles as $role_id) {
482 if ($role_id !== $source) {
483 $this->doRemoveRolePermissions($source, $role_id);
484 }
485 }
486 $this->tpl->setOnScreenMessage('success', $this->lng->txt('rbac_copy_finished'), true);
487 $this->ctrl->redirect($this, 'view');
488 }
489 }

References $source, ILIAS\Repository\ctrl(), doRemoveRolePermissions(), initCopyBehaviourForm(), initCopySourceFromGET(), initRolesFromPOST(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjRoleFolderGUI::resetFilterObject ( )

Reset role filter.

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

578 : void
579 {
580 $table = new ilRoleTableGUI($this, 'view');
581 $table->init();
582 $table->resetOffset();
583 $table->resetFilter();
584
585 $this->viewObject();
586 }

◆ roleSearchFormObject()

ilObjRoleFolderGUI::roleSearchFormObject ( )
protected

Parse search query.

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

208 : void
209 {
210 ilSession::set('rolf_search_query', '');
211 $this->ctrl->setParameter($this, 'csource', $this->initCopySourceFromGET());
212
213 $form = $this->initRoleSearchForm();
214 if ($form->checkInput()) {
215 ilSession::set('rolf_search_query', $form->getInput('title'));
216 $this->roleSearchListObject();
217 return;
218 }
219
220 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_search_string'), true);
221 $form->setValuesByPost();
222 $this->ctrl->redirect($this, 'roleSearch');
223 }
initRoleSearchForm()
Init role search form.
static set(string $a_var, $a_val)
Set a value.

References ILIAS\Repository\ctrl(), initCopySourceFromGET(), initRoleSearchForm(), ILIAS\Repository\lng(), roleSearchListObject(), and ilSession\set().

+ Here is the call graph for this function:

◆ roleSearchListObject()

ilObjRoleFolderGUI::roleSearchListObject ( )
protected

List roles.

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

228 : void
229 {
230 $this->tabs_gui->clearTargets();
231 $this->tabs_gui->setBackTarget(
232 $this->lng->txt('rbac_back_to_overview'),
233 $this->ctrl->getLinkTarget($this, 'view')
234 );
235
236 $this->ctrl->setParameter($this, 'csource', $this->initCopySourceFromGET());
237
238 if (strlen(ilSession::get('rolf_search_query'))) {
239 $this->tpl->setOnScreenMessage('info', $this->lng->txt('rbac_select_copy_targets'));
240 $table = new ilRoleTableGUI($this, 'roleSearchList');
241 $table->setType(ilRoleTableGUI::TYPE_SEARCH);
242 $table->setRoleTitleFilter(ilSession::get('rolf_search_query'));
243 $table->init();
244 $table->parse($this->object->getId());
245 $this->tpl->setContent($table->getHTML());
246 return;
247 }
248
249 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_search_string'), true);
250 $this->ctrl->redirect($this, 'roleSearch');
251 }
static get(string $a_var)

References ILIAS\Repository\ctrl(), ilSession\get(), initCopySourceFromGET(), ILIAS\Repository\lng(), ILIAS\Repository\object(), 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 167 of file class.ilObjRoleFolderGUI.php.

167 : void
168 {
169 $this->tabs_gui->clearTargets();
170 $this->tabs_gui->setBackTarget(
171 $this->lng->txt('rbac_back_to_overview'),
172 $this->ctrl->getLinkTarget($this, 'view')
173 );
174
175 if (!$this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
176 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
177 }
178
179 $this->ctrl->setParameter($this, 'csource', $this->initCopySourceFromGET());
180 $this->tpl->setOnScreenMessage('info', $this->lng->txt('rbac_choose_copy_targets'));
181
182 $form = $this->initRoleSearchForm();
183 $this->tpl->setContent($form->getHTML());
184 }

References ILIAS\Repository\ctrl(), error(), initCopySourceFromGET(), initRoleSearchForm(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjRoleFolderGUI::saveSettingsObject ( )

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

693 : void
694 {
695 global $DIC;
696
697 $user = $DIC->user();
698
699 if (!$this->checkPermissionBool("write")) {
700 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
701 }
702
703 $form = $this->initSettingsForm();
704 if ($form->checkInput()) {
706 $privacy->enableRbacLog((bool) $form->getInput('rbac_log'));
707 $privacy->setRbacLogAge((int) $form->getInput('rbac_log_age'));
708 $privacy->save();
709
710 if ($this->rbac_review->isAssigned($user->getId(), SYSTEM_ROLE_ID)) {
712 $security->protectedAdminRole((bool) $form->getInput('admin_role'));
713 $security->save();
714 }
715 $this->tpl->setOnScreenMessage('success', $this->lng->txt("settings_saved"), true);
716 $this->ctrl->redirect($this, "editSettings");
717 }
718
719 $form->setValuesByPost();
720 $this->editSettingsObject($form);
721 }
editSettingsObject(ilPropertyFormGUI $a_form=null)

References $DIC, ilSecuritySettings\_getInstance(), ILIAS\Repository\ctrl(), error(), ilPrivacySettings\getInstance(), ILIAS\Repository\lng(), and SYSTEM_ROLE_ID.

+ Here is the call graph for this function:

◆ viewObject()

ilObjRoleFolderGUI::viewObject ( )

viewObject container presentation for "administration -> repository, trash, permissions"

Reimplemented from ilObjectGUI.

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

123 : void
124 {
125 $this->tabs_gui->activateTab('view');
126
127 if (!$this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
128 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
129 }
130
131 if ($this->rbac_system->checkAccess('create_role', $this->object->getRefId())) {
132 $this->ctrl->setParameter($this, 'new_type', 'role');
133 $this->toolbar->addButton(
134 $this->lng->txt('rolf_create_role'),
135 $this->ctrl->getLinkTarget($this, 'create')
136 );
137 }
138 if ($this->rbac_system->checkAccess('create_rolt', $this->object->getRefId())) {
139 $this->ctrl->setParameter($this, 'new_type', 'rolt');
140 $this->toolbar->addButton(
141 $this->lng->txt('rolf_create_rolt'),
142 $this->ctrl->getLinkTarget($this, 'create')
143 );
144 $this->ctrl->clearParameters($this);
145 }
146
147 if (
148 $this->rbac_system->checkAccess('create_rolt', $this->object->getRefId()) ||
149 $this->rbac_system->checkAccess('create_rolt', $this->object->getRefId())
150 ) {
151 $this->toolbar->addButton(
152 $this->lng->txt('rbac_import_role'),
153 $this->ctrl->getLinkTargetByClass('ilPermissionGUI', 'displayImportRoleForm')
154 );
155 }
156
157 $table = new ilRoleTableGUI($this, 'view');
158 $table->init();
159 $table->parse($this->object->getId());
160
161 $this->tpl->setContent($table->getHTML());
162 }

References ILIAS\Repository\ctrl(), error(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Field Documentation

◆ $http

GlobalHttpState ilObjRoleFolderGUI::$http
protected

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

◆ $logger

ilLogger ilObjRoleFolderGUI::$logger
private

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

◆ $rbacadmin

ilRbacAdmin ilObjRoleFolderGUI::$rbacadmin
protected

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

◆ $refinery

Factory ilObjRoleFolderGUI::$refinery
protected

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

◆ COPY_ADD_PERMISSIONS

const ilObjRoleFolderGUI::COPY_ADD_PERMISSIONS = 1
private

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

Referenced by adjustRoleObject().

◆ COPY_CHANGE_EXISTING_OBJECTS

const ilObjRoleFolderGUI::COPY_CHANGE_EXISTING_OBJECTS = 1
private

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

◆ COPY_CLONE_PERMISSIONS

const ilObjRoleFolderGUI::COPY_CLONE_PERMISSIONS = 2
private

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

Referenced by adjustRoleObject().

◆ COPY_REMOVE_PERMISSIONS

const ilObjRoleFolderGUI::COPY_REMOVE_PERMISSIONS = 3
private

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

Referenced by adjustRoleObject().


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