71 $this->rbacsystem = $DIC->rbac()->system();
72 $this->rbacreview = $DIC->rbac()->review();
73 $this->lng = $DIC->language();
74 $this->ctrl = $DIC->ctrl();
75 $this->toolbar = $DIC->toolbar();
76 $this->main_tpl = $DIC->ui()->mainTemplate();
78 $this->requested_item_ref_id = (int)
$_GET[
'item_ref_id'];
79 $this->requested_item_ref_ids = is_array(
$_POST[
"item_ref_id"])
80 ? array_map(
function (
$i) {
93 $next_class =
$ctrl->getNextClass($this);
94 $cmd =
$ctrl->getCmd(
"listItems");
96 switch ($next_class) {
98 if (in_array($cmd, [
"listItems",
"selectItem",
"assignItem",
"confirmRemoveItems",
"removeItems"])) {
117 if (!
$rbacreview->isAssignable($this->role_id, $this->node_ref_id) &&
118 $this->node_ref_id != ROLE_FOLDER_ID) {
146 if (count($this->requested_item_ref_ids) == 0) {
153 $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
154 $confirmation_gui->setHeaderText($this->lng->txt(
'rep_remove_rec_content'));
155 $confirmation_gui->setCancel($this->lng->txt(
"cancel"),
"listItems");
156 $confirmation_gui->setConfirm($this->lng->txt(
"remove"),
"removeItems");
158 foreach ($this->requested_item_ref_ids as $item_ref_id) {
159 $confirmation_gui->addItem(
166 $main_tpl->setContent($confirmation_gui->getHTML());
176 if (count($this->requested_item_ref_ids) > 0) {
177 foreach ($this->requested_item_ref_ids as $item_ref_id) {
178 $this->manager->removeRoleRecommendation($this->role_id, $item_ref_id);
180 ilUtil::sendSuccess($this->lng->txt(
'rep_rec_content_removed'));
193 if (!
$rbacsystem->checkAccess(
'write', $this->node_ref_id) ||
196 $ctrl->redirect($this,
"listItems");
215 $exp->setSkipRootNode(
true);
216 if (!$exp->handleCommand()) {
228 if ($this->requested_item_ref_id > 0) {
229 $this->manager->addRoleRecommendation($this->role_id, $this->requested_item_ref_id);
230 ilUtil::sendSuccess($this->lng->txt(
'rep_added_rec_content'),
true);
232 $ctrl->redirect($this,
'listItems');
__construct(int $role_id, int $node_ref_id)
Constructor.
Explorer for selecting repository items.
removeItems()
Remove items.
selectItem()
Select recommended content.
static _lookupTitle($a_id)
lookup object title
executeCommand()
Execute command.
static _lookupObjectId($a_ref_id)
lookup object id
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkPushPermission()
Check permission to push recommended content.
confirmRemoveItems()
Remove items confirmation.
const USER_FOLDER_ID
Class ilObjUserFolder.
Recommended content configuration for roles.
Recommended content manager (business logic)
Confirmation screen class.
Recommended content for roles.