ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilRecommendedContentRoleConfigGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilRecommendedContentRoleConfigGUI:

Public Member Functions

 executeCommand ()
 
 listItems ()
 
 confirmRemoveItems ()
 
 removeItems ()
 

Protected Member Functions

 checkPushPermission ()
 
 selectItem ()
 
 assignItem ()
 

Protected Attributes

array $requested_item_ref_ids
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilLanguage $lng
 
int $role_id
 
int $node_ref_id
 
ilCtrl $ctrl
 
ilToolbarGUI $toolbar
 
ilGlobalTemplateInterface $main_tpl
 
ilRecommendedContentManager $manager
 
int $requested_item_ref_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Recommended content configuration for roles

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ assignItem()

ilRecommendedContentRoleConfigGUI::assignItem ( )
protected

Definition at line 173 of file class.ilRecommendedContentRoleConfigGUI.php.

173 : void
174 {
176 $this->checkPushPermission();
177 if ($this->requested_item_ref_id > 0) {
178 $this->manager->addRoleRecommendation($this->role_id, $this->requested_item_ref_id);
179 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('rep_added_rec_content'), true);
180 }
181 $ctrl->redirect($this, 'listItems');
182 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

References $ctrl, checkPushPermission(), ILIAS\Repository\lng(), and ilCtrl\redirect().

+ Here is the call graph for this function:

◆ checkPushPermission()

ilRecommendedContentRoleConfigGUI::checkPushPermission ( )
protected

Definition at line 143 of file class.ilRecommendedContentRoleConfigGUI.php.

143 : void
144 {
147
148 if (!$rbacsystem->checkAccess('write', $this->node_ref_id) ||
149 !$rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
150 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
151 $ctrl->redirect($this, "listItems");
152 }
153 }
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
const USER_FOLDER_ID
Definition: constants.php:33

References $ctrl, $rbacsystem, ilRbacSystem\checkAccess(), ILIAS\Repository\lng(), ilCtrl\redirect(), and USER_FOLDER_ID.

Referenced by assignItem(), confirmRemoveItems(), removeItems(), and selectItem().

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

◆ confirmRemoveItems()

ilRecommendedContentRoleConfigGUI::confirmRemoveItems ( )

Definition at line 102 of file class.ilRecommendedContentRoleConfigGUI.php.

102 : void
103 {
104 $this->checkPushPermission();
105
107
108 if (count($this->requested_item_ref_ids) === 0) {
109 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
110 $this->listItems();
111 return;
112 }
113
114 $confirmation_gui = new ilConfirmationGUI();
115 $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
116 $confirmation_gui->setHeaderText($this->lng->txt('rep_remove_rec_content'));
117 $confirmation_gui->setCancel($this->lng->txt("cancel"), "listItems");
118 $confirmation_gui->setConfirm($this->lng->txt("remove"), "removeItems");
119
120 foreach ($this->requested_item_ref_ids as $item_ref_id) {
121 $confirmation_gui->addItem(
122 "item_ref_ids[]",
123 (string) $item_ref_id,
125 );
126 }
127
128 $main_tpl->setContent($confirmation_gui->getHTML());
129 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
setContent(string $a_html)
Sets content for standard template.

References $main_tpl, ilObject\_lookupObjectId(), ilObject\_lookupTitle(), checkPushPermission(), ILIAS\Repository\ctrl(), listItems(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), and ILIAS\UICore\GlobalTemplate\setOnScreenMessage().

+ Here is the call graph for this function:

◆ executeCommand()

ilRecommendedContentRoleConfigGUI::executeCommand ( )

Definition at line 58 of file class.ilRecommendedContentRoleConfigGUI.php.

58 : void
59 {
61
62 $next_class = $ctrl->getNextClass($this);
63 $cmd = $ctrl->getCmd("listItems");
64
65 switch ($next_class) {
66 default:
67 if (in_array($cmd, ["listItems", "selectItem", "assignItem", "confirmRemoveItems", "removeItems"])) {
68 $this->$cmd();
69 }
70 break;
71 }
72 }
getNextClass($a_gui_class=null)
@inheritDoc
getCmd(?string $fallback_command=null)
@inheritDoc

References $ctrl, ilCtrl\getCmd(), and ilCtrl\getNextClass().

+ Here is the call graph for this function:

◆ listItems()

ilRecommendedContentRoleConfigGUI::listItems ( )

Definition at line 74 of file class.ilRecommendedContentRoleConfigGUI.php.

74 : void
75 {
82
83 if ($this->node_ref_id !== ROLE_FOLDER_ID && !$rbacreview->isAssignable($this->role_id, $this->node_ref_id)) {
84 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt('rep_no_assign_rec_content_to_role'));
85 } else {
86 if ($rbacsystem->checkAccess('push_desktop_items', USER_FOLDER_ID)) {
88 $this,
89 'selectItem'
90 ));
91 }
93 $this,
94 'listItems',
95 $this->role_id,
96 $this->manager
97 );
98 $main_tpl->setContent($tbl->getHTML());
99 }
100 }
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
isAssignable(int $a_rol_id, int $a_ref_id)
Check if its possible to assign users.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')
const ROLE_FOLDER_ID
Definition: constants.php:34

References $ctrl, $lng, $main_tpl, $rbacreview, $rbacsystem, $toolbar, ilToolbarGUI\addButton(), ilRbacSystem\checkAccess(), ilCtrl\getLinkTarget(), ilRbacReview\isAssignable(), ILIAS\Repository\lng(), ROLE_FOLDER_ID, ILIAS\UICore\GlobalTemplate\setContent(), ilLanguage\txt(), and USER_FOLDER_ID.

Referenced by confirmRemoveItems(), and removeItems().

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

◆ removeItems()

ilRecommendedContentRoleConfigGUI::removeItems ( )

Definition at line 131 of file class.ilRecommendedContentRoleConfigGUI.php.

131 : void
132 {
133 $this->checkPushPermission();
134 if (count($this->requested_item_ref_ids) > 0) {
135 foreach ($this->requested_item_ref_ids as $item_ref_id) {
136 $this->manager->removeRoleRecommendation($this->role_id, $item_ref_id);
137 }
138 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('rep_rec_content_removed'));
139 }
140 $this->listItems();
141 }

References checkPushPermission(), listItems(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ selectItem()

ilRecommendedContentRoleConfigGUI::selectItem ( )
protected

Definition at line 155 of file class.ilRecommendedContentRoleConfigGUI.php.

155 : void
156 {
157 $this->checkPushPermission();
158
161 $this,
162 "selectItem",
163 $this,
164 "assignItem",
165 "item_ref_id"
166 );
167 $exp->setSkipRootNode(true);
168 if (!$exp->handleCommand()) {
169 $main_tpl->setContent($exp->getHTML());
170 }
171 }
Explorer for selecting repository items.

References $main_tpl, checkPushPermission(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilRecommendedContentRoleConfigGUI::$ctrl
protected

◆ $lng

ilLanguage ilRecommendedContentRoleConfigGUI::$lng
protected

Definition at line 30 of file class.ilRecommendedContentRoleConfigGUI.php.

Referenced by listItems().

◆ $main_tpl

ilGlobalTemplateInterface ilRecommendedContentRoleConfigGUI::$main_tpl
protected

◆ $manager

ilRecommendedContentManager ilRecommendedContentRoleConfigGUI::$manager
protected

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

◆ $node_ref_id

int ilRecommendedContentRoleConfigGUI::$node_ref_id
protected

Definition at line 32 of file class.ilRecommendedContentRoleConfigGUI.php.

◆ $rbacreview

ilRbacReview ilRecommendedContentRoleConfigGUI::$rbacreview
protected

Definition at line 29 of file class.ilRecommendedContentRoleConfigGUI.php.

Referenced by listItems().

◆ $rbacsystem

ilRbacSystem ilRecommendedContentRoleConfigGUI::$rbacsystem
protected

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

Referenced by checkPushPermission(), and listItems().

◆ $requested_item_ref_id

int ilRecommendedContentRoleConfigGUI::$requested_item_ref_id
protected

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

◆ $requested_item_ref_ids

array ilRecommendedContentRoleConfigGUI::$requested_item_ref_ids
protected

Definition at line 27 of file class.ilRecommendedContentRoleConfigGUI.php.

◆ $role_id

int ilRecommendedContentRoleConfigGUI::$role_id
protected

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

◆ $toolbar

ilToolbarGUI ilRecommendedContentRoleConfigGUI::$toolbar
protected

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

Referenced by listItems().


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