39 public function __construct(
int $role_id,
int $node_ref_id)
46 $this->rbacsystem = $DIC->rbac()->system();
47 $this->rbacreview = $DIC->rbac()->review();
48 $this->
lng = $DIC->language();
49 $this->
ctrl = $DIC->ctrl();
50 $this->
toolbar = $DIC->toolbar();
51 $this->main_tpl = $DIC->ui()->mainTemplate();
53 $request = $DIC->repository()->internal()->gui()->standardRequest();
54 $this->requested_item_ref_id = $request->getItemRefId();
55 $this->requested_item_ref_ids = $request->getItemRefIds();
63 $cmd = $ctrl->
getCmd(
"listItems");
65 switch ($next_class) {
67 if (in_array($cmd, [
"listItems",
"selectItem",
"assignItem",
"confirmRemoveItems",
"removeItems"])) {
84 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'rep_no_assign_rec_content_to_role'));
108 if (count($this->requested_item_ref_ids) === 0) {
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");
120 foreach ($this->requested_item_ref_ids as $item_ref_id) {
121 $confirmation_gui->addItem(
123 (
string) $item_ref_id,
128 $main_tpl->
setContent($confirmation_gui->getHTML());
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);
138 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'rep_rec_content_removed'));
148 if (!$rbacsystem->
checkAccess(
'write', $this->node_ref_id) ||
150 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
151 $ctrl->
redirect($this,
"listItems");
167 $exp->setSkipRootNode(
true);
168 if (!$exp->handleCommand()) {
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);
181 $ctrl->
redirect($this,
'listItems');
Explorer for selecting repository items.
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
getCmd(string $fallback_command=null)
ilGlobalTemplateInterface $main_tpl
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 ...
getNextClass($a_gui_class=null)
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
array $requested_item_ref_ids
static _lookupObjectId(int $ref_id)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
ilRecommendedContentManager $manager
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isAssignable(int $a_rol_id, int $a_ref_id)
Check if its possible to assign users.
int $requested_item_ref_id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...